diff --git a/.gitignore b/.gitignore index 76be7613..39816ccc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.class *.log *.pid +*.log.gz # Package Files *.jar @@ -35,4 +36,10 @@ Thumbs.db desktop.ini # Misc -download/ \ No newline at end of file +download/ +config/ +saves/ +crash-reports/ +screenshots/ +usernamecache.json +options.txt \ No newline at end of file diff --git a/OpenModsLib b/OpenModsLib index 930c8427..cb83cbc5 160000 --- a/OpenModsLib +++ b/OpenModsLib @@ -1 +1 @@ -Subproject commit 930c842774bcb88f83d4ece114396eb07f86fbcc +Subproject commit cb83cbc551fb9489f1355ffafec533288bed5948 diff --git a/README.md b/README.md index c6f85b06..b1e8ea38 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,14 @@ OpenBlocks ========= -An open source random collection of blocks and miscellaneous cool stuff +An open source random collection of blocks and miscellaneous cool stuff. -Current Version -- -**1.4.0 for Minecraft 1.7.10** -You'll also need OpenModsLib 0.6. +For stable release downloads, click [here](https://www.openmods.info). -For stable release downloads, click [here](http://www.openmods.info/). -For snapshot versions, check the [Jenkins](http://www.openmods.info:8080/). +For snapshot versions, check the [Jenkins](https://builds.openmods.info). -FREQUENTLY ASKED QUESTIONS: ------------ -* "I dropped OpenBlocks into the mod folder and I **can't get it to work**!" - * OpenModsLib is required for versions past v.1.2.2. -* "I want to **disable** feature X!" - * Setting any block or item's ID to 0 will disable it. -* "How come my **elevators don't always work?**" - * Recently, we made a change to the way elevators work-- they now require XP. You can disable this change in the config. -* "Automatic enchantment tables won't enchant past a certain level!" - * They require bookshelves, just like their mundane counterparts. -* "Things like Thermal Expansion Fluiducts won't work with the automatic enchanter/anvil!" - * You need to select the relevant side on the GUI to allow input. The tab you're looking for is on the right. -* "How can I **contact** the OpenMods team?" - * We're often on EsperNet IRC at #OpenMods, but you can also open up a new issue on our GitHub or send a message to us on reddit. +**[FAQ](https://openmods.info/faq.html)** What does it contain? diff --git a/build.gradle b/build.gradle index 3ba54b59..6342cbdb 100644 --- a/build.gradle +++ b/build.gradle @@ -16,29 +16,16 @@ buildscript { name = 'Forge' url = 'http://files.minecraftforge.net/maven' } + maven { + name 'OpenMods Third Party' + url 'http://repo.openmods.info/artifactory/simple/thirdparty' + } } + dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' - } -} - -repositories { - maven { - name 'Forge' - url 'http://files.minecraftforge.net/maven' - } - maven { - name 'MinecraftS3' - url 'http://s3.amazonaws.com/Minecraft.Download/libraries' - } - maven { - name "OpenMods" - url "http://repo.openmods.info/artifactory/openmods" - } - maven { - name "OpenMods 3rd party" - url "http://repo.openmods.info/artifactory/thirdparty" + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + classpath 'net.thesilkminer.gradle.translationchecker:TranslationChecker:1.1' } } @@ -50,8 +37,8 @@ apply plugin: 'net.minecraftforge.gradle.forge' dependencies { compile project(":OpenModsLib") // Load OpenModsLib from submodule - compile "info.computercraft:ComputerCraft-API:1.78" - compile "openperipheral:OpenPeripheralCore-API:"+opc_api_version + compile "info.computercraft:ComputerCraft-API:1.80pr0" + compile "info.openmods:OpenPeripheralCore-API:"+opc_api_version } //================================================ @@ -60,8 +47,7 @@ dependencies { // Grab system env ext.env = System.getenv() -mod_version += "." + (env.BUILD_NUMBER ?: 'dev') -version = mc_ver + "-" + mod_version +version = mc_version + "-" + mod_version ext.in_jenkins = false // Get Jenkins metadata @@ -93,14 +79,14 @@ if (!in_jenkins) { // Get Git metadata (if in Jenkins) ext.gitManifest = manifest { - if (env.GIT_BRANCH != null) { + if (branch != null) { attributes("Git-Branch": branch, "Git-Hash": hash) } } // Setup Forge plugin minecraft { - version = mc_ver + "-" + forge_ver + version = mc_version + "-" + forge_version runDir = "run" mappings = mcp_mappings @@ -116,12 +102,13 @@ minecraft { } processResources { - inputs.property "version", rootProject.mod_version + inputs.property "version", mod_version + inputs.property "mc_version", mc_version // Process mcmod.info from(sourceSets.main.resources.srcDirs) { include '**/*.info' - expand 'version':mod_version,'MCVersion':mc_ver + expand 'version':mod_version, 'mc_version':mc_version } // Copy anything else directly @@ -178,3 +165,16 @@ artifacts { archives apiJar archives apiSrcJar } + +task updateTranslations(type: net.thesilkminer.gradle.plugin.translationchecker.tasks.TranslationCheckTask) { + modId = "openblocks" +} + +task checkTranslations(type: net.thesilkminer.gradle.plugin.translationchecker.tasks.TranslationCheckTask) { + modId = "openblocks" + dryRun = true +} + +task wrapper (type: Wrapper) { + gradleVersion = "2.14" +} diff --git a/gradle.properties b/gradle.properties index 24fcd60c..233aa1de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ -mod_version=1.5.1 +mod_version=1.6 api_version=1.1 -opc_api_version=3.3.2-1.8 -mc_ver=1.8.9 -forge_ver=11.15.0.1675 -mcp_mappings=stable_20 \ No newline at end of file +opc_api_version=3.5-unstable +mc_version=1.10.2 +forge_version=12.18.3.2185 +mcp_mappings=snapshot_20161111 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 30d399d8..d3b83982 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9397848f..3c0ec58f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Sep 14 12:28:28 PDT 2015 +#Sun Mar 19 21:46:20 CET 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip diff --git a/gradlew b/gradlew index 2ec45c60..27309d92 100755 --- a/gradlew +++ b/gradlew @@ -6,12 +6,30 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -30,6 +48,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,31 +59,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -90,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -114,6 +113,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` @@ -161,4 +161,4 @@ function splitJvmOpts() { eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" \ No newline at end of file +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat index d4552f3d..f6d5974e 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega \ No newline at end of file +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/main/java/openblocks/Config.java b/src/main/java/openblocks/Config.java index 3e389bf3..2f2a2f2e 100644 --- a/src/main/java/openblocks/Config.java +++ b/src/main/java/openblocks/Config.java @@ -2,7 +2,6 @@ package openblocks; import java.util.Arrays; import java.util.List; - import net.minecraft.enchantment.EnchantmentData; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -10,19 +9,36 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.IFuelHandler; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.RegistryDelegate; -import net.minecraftforge.oredict.*; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.RecipeSorter; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; import openblocks.OpenBlocks.Enchantments; import openblocks.common.Stencil; import openblocks.common.TrophyHandler; -import openblocks.common.item.*; -import openblocks.common.recipe.*; -import openblocks.enchantments.*; +import openblocks.common.item.ItemGoldenEye; +import openblocks.common.item.ItemImaginary; +import openblocks.common.item.ItemPaintBrush; +import openblocks.common.item.MetaStencil; +import openblocks.common.item.MetasBucket; +import openblocks.common.item.MetasGeneric; +import openblocks.common.item.MetasGenericUnstackable; +import openblocks.common.recipe.CrayonGlassesRecipe; +import openblocks.common.recipe.CrayonMixingRecipe; +import openblocks.common.recipe.EpicEraserRecipe; +import openblocks.common.recipe.GoldenEyeRechargeRecipe; +import openblocks.common.recipe.MapCloneRecipe; +import openblocks.common.recipe.MapResizeRecipe; +import openblocks.enchantments.EnchantmentExplosive; +import openblocks.enchantments.EnchantmentFlimFlam; +import openblocks.enchantments.EnchantmentLastStand; +import openblocks.enchantments.ExplosiveEnchantmentsHandler; +import openblocks.enchantments.FlimFlamEnchantmentsHandler; +import openblocks.enchantments.LastStandEnchantmentsHandler; import openmods.colors.ColorMeta; import openmods.config.properties.ConfigProperty; import openmods.config.properties.OnLineModifiable; @@ -69,9 +85,17 @@ public class Config { public static boolean displayAllFilledTanks = true; @OnLineModifiable - @ConfigProperty(category = "trophy", name = "trophyDropChance", comment = "The chance (from 0 to 1) of a trophy drop. for example, 0.001 for 1/1000") + @ConfigProperty(category = "tanks", name = "fluidDifferenceUpdateThreshold", comment = "Minimal difference in fluid level between neigbors required for tank update (can be used for performance finetuning") + public static int tankFluidUpdateThreshold = 0; + + @OnLineModifiable + @ConfigProperty(category = "trophy", name = "trophyDropChance", comment = "Legacy value. For actual configuration, see 'trophyDropChanceFormula'") public static double trophyDropChance = 0.001; + @OnLineModifiable + @ConfigProperty(category = "trophy", name = "trophyDropChanceFormula", comment = "Formula for calculating trophy drop chance. Trophy drops when result is positive.") + public static String trophyDropChanceFormula = "let([bias=rand()/4, selection=rand()], (looting + bias) * chance - selection)"; + @OnLineModifiable @ConfigProperty(category = "dropblock", name = "irregularBlocksArePassable", comment = "The elevator will try to pass through blocks that have custom collision boxes") public static boolean irregularBlocksArePassable = true; @@ -193,6 +217,10 @@ public class Config { @ConfigProperty(category = "graves", name = "skeletonSpawnRate", comment = "Spawn rate, range: 0..1, default: about 1 per 50s") public static double skeletonSpawnRate = 0.002; + @OnLineModifiable + @ConfigProperty(category = "graves", name = "requiresGraveInInv", comment = "Require gravestone to be in a player's inventory (it is consumed)") + public static boolean requiresGraveInInv = false; + @OnLineModifiable @ConfigProperty(category = "graves", name = "specialActionFrequency", comment = "Frequency of special action on grave digging, 0..1") public static double graveSpecialAction = 0.03; @@ -202,23 +230,32 @@ public class Config { public static boolean graveBase = true; @OnLineModifiable - @ConfigProperty(category = "graves", name = "voidFix", comment = "Should grave try to spawn when player died by falling into void? (false -> legacy behaviour)") - public static boolean voidGraves = true; + @ConfigProperty(category = "graves", name = "minimalPosY", comment = "Minimal height where grave should be spawned (default value selected to prevent spawning in bedrock)") + public static int minGraveY = 6; - @ConfigProperty(category = "features", name = "explosiveEnchantmentId", comment = "Id of explosive enchantment") - public static int explosiveEnchantmentId = 211; + @OnLineModifiable + @ConfigProperty(category = "graves", name = "maximalPosY", comment = "Maximal height where grave should be spawned (default value selected to prevent spawning in bedrock)") + public static int maxGraveY = 255 - 6; - @ConfigProperty(category = "features", name = "lastStandEnchantmentId", comment = "Id of last stand enchantment") - public static int lastStandEnchantmentId = 212; + @ConfigProperty(category = "features", name = "explosiveEnchantment", comment = "Is 'Explosive' enchantment enabled") + public static boolean explosiveEnchantmentEnabled = true; - @ConfigProperty(category = "features", name = "flimFlamEnchantmentId", comment = "Id of flim flam enchantment") - public static int flimFlamEnchantmentId = 213; + @ConfigProperty(category = "features", name = "lastStandEnchantment", comment = "Is 'Last Stand' enchantment enabled") + public static boolean lastStandEnchantmentEnabled = true; + + @ConfigProperty(category = "features", name = "flimFlamEnchantment", comment = "Is 'Flim-flam' enchantment enabled") + public static boolean flimFlamEnchantmentEnabled = true; @ConfigProperty(category = "features", name = "explosiveEnchantGrief", comment = "Explosive enchant can break blocks at level 3") public static boolean explosiveEnchantGrief = true; - @ConfigProperty(category = "cursor", name = "cursorMaxDamage", comment = "Amount of damage a cursor can take") - public static int cursorMaxDamage = 128; + @OnLineModifiable + @ConfigProperty(category = "features", name = "lastStandFormula", comment = "Formula for XP cost (variables: hp,dmg,ench,xp). Note: calculation only triggers when hp - dmg < 1.") + public static String lastStandEnchantmentFormula = "max(1, 50*(1-(hp-dmg))/ench)"; + + // 64 blocks, since containers usually have 64 blocks usability range (IInventory.isUseableByPlayer) + @ConfigProperty(category = "cursor", name = "cursorMaxDistance", comment = "Maximum distance cursor can reach (warning: increasing may cause crashes)") + public static int cursorDistanceLimit = 64; @OnLineModifiable @ConfigProperty(category = "additional", name = "disableMobNames", comment = "List any mob names you want disabled on the server") @@ -268,6 +305,25 @@ public class Config { @ConfigProperty(category = "sponge", name = "spongeRange", comment = "Sponge block range (distance from center)") public static int spongeStickRange = 3; + @ConfigProperty(category = "projector", name = "lightUpWhenWorking", comment = "Projector will light up whenever it is displaying a map") + public static boolean litWhenDisplayingMap = true; + + @ConfigProperty(category = "projector", name = "renderHolographicCone", comment = "Projector will render a holographic cone whenever active") + public static boolean renderHoloCone = true; + + @ConfigProperty(category = "projector", name = "brightness", comment = "The projector's cone will use the specified brightness value to render.\n" + + "Value must be between 0 and 255 inclusive. To use the default world brightness set -1 as the value.\n" + + "Keep in mind that default brightness means that the cone will render as light blue during the day and dark blue during the night.") + public static int coneBrightness = -1; + + @ConfigProperty(category = "projector", name = "lightLevel", comment = "Level of light emitted by the active projector. Defaults to 10. Must be at maximum 15 and positive") + public static int projectorLightLevelValue = 10; + + @ConfigProperty(category = "projector", name = "renderHolographicGrid", comment = "The holographic cone will display a grid.\n" + + "The grid texture may look a bit pixelated and there may be a little gap between two corners.\n" + + "This is not an error and it is only a texture calculation problem (e.g. 0.25 does not correctly correspond to 16 pixels in a 64x64 texture)") + public static boolean renderHoloGrid = false; + @OnLineModifiable @ConfigProperty(category = "loot", name = "donationStation") public static boolean donationStationLoot = false; @@ -303,6 +359,9 @@ public class Config { @ConfigProperty(category = "guide", name = "renderDistanceSq", comment = "Square of guide maximum render distance") public static double guideRenderRangeSq = 256 * 256; + @ConfigProperty(category = "guide", name = "useAdvancedRenderer", comment = "Try to use advanced OpenGL for performance improvement") + public static boolean useAdvancedRenderer = true; + @OnLineModifiable @ConfigProperty(category = "scaffolding", name = "despawnRate", comment = "The rate at which scaffolding should break. 0 - fastest") public static int scaffoldingDespawnRate = 4; @@ -327,6 +386,10 @@ public class Config { @ConfigProperty(category = "devnull", name = "sneakClickToGui", comment = "If true, /dev/null will require sneaking in addition to clicking air to open gui") public static boolean devNullSneakGui = true; + @OnLineModifiable + @ConfigProperty(category = "hangglider", name = "enableThermal", comment = "Enable a whole new level of hanggliding experience through thermal lift. See keybindings for acoustic vario controls") + public static boolean hanggliderEnableThermal = true; + public static void register() { final List recipeList = CraftingManager.getInstance().getRecipeList(); @@ -340,23 +403,23 @@ public class Config { OpenBlocks.Items.genericUnstackable.initRecipes(); if (OpenBlocks.Blocks.ladder != null) { - recipeList.add(new ShapelessOreRecipe(OpenBlocks.Blocks.ladder, Blocks.ladder, Blocks.trapdoor)); + recipeList.add(new ShapelessOreRecipe(OpenBlocks.Blocks.ladder, Blocks.LADDER, Blocks.TRAPDOOR)); } if (OpenBlocks.Blocks.guide != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.guide, "grg", "gtg", "grg", 'g', "blockGlass", 't', Blocks.torch, 'r', "dustRedstone")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.guide, "grg", "gtg", "grg", 'g', "blockGlass", 't', Blocks.TORCH, 'r', "dustRedstone")); } if (OpenBlocks.Blocks.builderGuide != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.builderGuide, "grg", "ete", "grg", 'g', "blockGlass", 't', Blocks.torch, 'r', "dustRedstone", 'e', Items.ender_pearl)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.builderGuide, "grg", "ete", "grg", 'g', "blockGlass", 't', Blocks.TORCH, 'r', "dustRedstone", 'e', Items.ENDER_PEARL)); } if (OpenBlocks.Blocks.elevator != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.elevator, "www", "wew", "www", 'w', Blocks.wool, 'e', Items.ender_pearl)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.elevator, "www", "wew", "www", 'w', Blocks.WOOL, 'e', Items.ENDER_PEARL)); } if (OpenBlocks.Blocks.elevatorRotating != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.elevatorRotating, "wiw", "wew", "wiw", 'w', Blocks.wool, 'e', Items.ender_pearl, 'i', "ingotIron")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.elevatorRotating, "wiw", "wew", "wiw", 'w', Blocks.WOOL, 'e', Items.ENDER_PEARL, 'i', "ingotIron")); if (OpenBlocks.Blocks.elevator != null) { recipeList.add(new ShapelessOreRecipe(OpenBlocks.Blocks.elevatorRotating, OpenBlocks.Blocks.elevator, "ingotIron", "ingotIron")); @@ -364,51 +427,51 @@ public class Config { } if (OpenBlocks.Blocks.target != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.target, "www", "www", "s s", 'w', Blocks.wool, 's', "stickWood")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.target, "www", "www", "s s", 'w', Blocks.WOOL, 's', "stickWood")); } if (OpenBlocks.Blocks.flag != null) { - recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Blocks.flag, 3), "scc", "sc ", "s ", 'c', Blocks.carpet, 's', "stickWood")); + recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Blocks.flag, 3), "scc", "sc ", "s ", 'c', Blocks.CARPET, 's', "stickWood")); } if (OpenBlocks.Blocks.tank != null) { - recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Blocks.tank, 2), "ogo", "ggg", "ogo", 'g', "paneGlass", 'o', Blocks.obsidian)); + recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Blocks.tank, 2), "ogo", "ggg", "ogo", 'g', "paneGlass", 'o', Blocks.OBSIDIAN)); } if (OpenBlocks.Blocks.trophy != null) { MinecraftForge.EVENT_BUS.register(new TrophyHandler()); } if (OpenBlocks.Blocks.bearTrap != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.bearTrap, "fif", "fif", "fif", 'f', Blocks.iron_bars, 'i', "ingotIron")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.bearTrap, "fif", "fif", "fif", 'f', Blocks.IRON_BARS, 'i', "ingotIron")); } if (OpenBlocks.Blocks.sprinkler != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.sprinkler, "ifi", "iri", "ifi", 'i', "ingotIron", 'r', Blocks.redstone_torch, 'f', Blocks.iron_bars)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.sprinkler, "ifi", "iri", "ifi", 'i', "ingotIron", 'r', Blocks.REDSTONE_TORCH, 'f', Blocks.IRON_BARS)); } if (OpenBlocks.Blocks.cannon != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.cannon, " d ", " f ", "iri", 'd', Blocks.dispenser, 'f', Blocks.iron_bars, 'i', "ingotIron", 'r', "blockRedstone")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.cannon, " d ", " f ", "iri", 'd', Blocks.DISPENSER, 'f', Blocks.IRON_BARS, 'i', "ingotIron", 'r', "blockRedstone")); } if (OpenBlocks.Blocks.vacuumHopper != null) { - recipeList.add(new ShapelessOreRecipe(OpenBlocks.Blocks.vacuumHopper, Blocks.hopper, Blocks.obsidian, Items.ender_eye)); + recipeList.add(new ShapelessOreRecipe(OpenBlocks.Blocks.vacuumHopper, Blocks.HOPPER, Blocks.OBSIDIAN, Items.ENDER_EYE)); } if (OpenBlocks.Blocks.sponge != null) { - recipeList.add(new ShapelessOreRecipe(OpenBlocks.Blocks.sponge, Blocks.wool, "slimeball")); + recipeList.add(new ShapelessOreRecipe(OpenBlocks.Blocks.sponge, Blocks.WOOL, "slimeball")); } if (OpenBlocks.Blocks.bigButton != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.bigButton, "bb", "bb", 'b', Blocks.stone_button)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.bigButton, "bb", "bb", 'b', Blocks.STONE_BUTTON)); } if (OpenBlocks.Blocks.imaginary != null) { { ItemStack pencil = ItemImaginary.setupValues(null, new ItemStack(OpenBlocks.Blocks.imaginary, 1, ItemImaginary.DAMAGE_PENCIL)); - recipeList.add(new ShapelessOreRecipe(pencil, Items.coal, "stickWood", Items.ender_eye, "slimeball")); + recipeList.add(new ShapelessOreRecipe(pencil, Items.COAL, "stickWood", Items.ENDER_EYE, "slimeball")); } for (ColorMeta color : ColorMeta.getAllColors()) { ItemStack crayon = ItemImaginary.setupValues(color.rgb, new ItemStack(OpenBlocks.Blocks.imaginary, 1, ItemImaginary.DAMAGE_CRAYON)); - recipeList.add(new ShapelessOreRecipe(crayon, color.oreName, Items.paper, Items.ender_eye, "slimeball")); + recipeList.add(new ShapelessOreRecipe(crayon, color.oreName, Items.PAPER, Items.ENDER_EYE, "slimeball")); } recipeList.add(new CrayonMixingRecipe()); @@ -416,11 +479,11 @@ public class Config { } if (OpenBlocks.Blocks.fan != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.fan, "f", "i", "s", 'f', Blocks.iron_bars, 'i', "ingotIron", 's', Blocks.stone_slab)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.fan, "f", "i", "s", 'f', Blocks.IRON_BARS, 'i', "ingotIron", 's', Blocks.STONE_SLAB)); } if (OpenBlocks.Blocks.xpBottler != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.xpBottler, "iii", "ibi", "iii", 'i', "ingotIron", 'b', Items.glass_bottle)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.xpBottler, "iii", "ibi", "iii", 'i', "ingotIron", 'b', Items.GLASS_BOTTLE)); } if (OpenBlocks.Blocks.villageHighlighter != null) { @@ -432,66 +495,61 @@ public class Config { } if (OpenBlocks.Blocks.autoAnvil != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.autoAnvil, "iii", "iai", "rrr", 'i', "ingotIron", 'a', Blocks.anvil, 'r', "dustRedstone")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.autoAnvil, "iii", "iai", "rrr", 'i', "ingotIron", 'a', Blocks.ANVIL, 'r', "dustRedstone")); } if (OpenBlocks.Blocks.autoEnchantmentTable != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.autoEnchantmentTable, "iii", "iei", "rrr", 'i', "ingotIron", 'e', Blocks.enchanting_table, 'r', "dustRedstone")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.autoEnchantmentTable, "iii", "iei", "rrr", 'i', "ingotIron", 'e', Blocks.ENCHANTING_TABLE, 'r', "dustRedstone")); } if (OpenBlocks.Blocks.xpDrain != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.xpDrain, "iii", "iii", "iii", 'i', Blocks.iron_bars)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.xpDrain, "iii", "iii", "iii", 'i', Blocks.IRON_BARS)); } if (OpenBlocks.Blocks.blockBreaker != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.blockBreaker, "icc", "src", "icc", 'i', "ingotIron", 'c', "cobblestone", 'r', "dustRedstone", 's', Items.diamond_pickaxe)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.blockBreaker, "icc", "src", "icc", 'i', "ingotIron", 'c', "cobblestone", 'r', "dustRedstone", 's', Items.DIAMOND_PICKAXE)); } if (OpenBlocks.Blocks.blockPlacer != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.blockPlacer, "icc", "src", "icc", 'i', "ingotIron", 'c', "cobblestone", 'r', "dustRedstone", 's', Blocks.piston)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.blockPlacer, "icc", "src", "icc", 'i', "ingotIron", 'c', "cobblestone", 'r', "dustRedstone", 's', Blocks.PISTON)); } if (OpenBlocks.Blocks.itemDropper != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.itemDropper, "icc", "src", "icc", 'i', "ingotIron", 'c', "cobblestone", 'r', "dustRedstone", 's', Blocks.hopper)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.itemDropper, "icc", "src", "icc", 'i', "ingotIron", 'c', "cobblestone", 'r', "dustRedstone", 's', Blocks.HOPPER)); } if (OpenBlocks.Blocks.ropeLadder != null) { - recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Blocks.ropeLadder, 8), "sts", "sts", "sts", 't', "stickWood", 's', Items.string)); + recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Blocks.ropeLadder, 8), "sts", "sts", "sts", 't', "stickWood", 's', Items.STRING)); } if (OpenBlocks.Blocks.donationStation != null) { - WeightedRandomChestContent drop = new WeightedRandomChestContent(new ItemStack(OpenBlocks.Blocks.donationStation), 1, 1, 2); - - if (donationStationLoot) { - ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(drop); - ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(drop); - } - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.donationStation, "ppp", "pcp", "ppp", 'p', Items.porkchop, 'c', "chestWood")); + // TODO 1.10 Loot tables + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.donationStation, "ppp", "pcp", "ppp", 'p', Items.PORKCHOP, 'c', "chestWood")); } if (OpenBlocks.Blocks.paintMixer != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.paintMixer, "ooo", "i i", "iii", 'o', Blocks.obsidian, 'i', "ingotIron")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.paintMixer, "ooo", "i i", "iii", 'o', Blocks.OBSIDIAN, 'i', "ingotIron")); } if (OpenBlocks.Blocks.canvas != null) { - recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Blocks.canvas, 9), "ppp", "pfp", "ppp", 'p', Items.paper, 'f', Blocks.oak_fence)); // TODO OreDict? + recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Blocks.canvas, 9), "ppp", "pfp", "ppp", 'p', Items.PAPER, 'f', Blocks.OAK_FENCE)); // TODO OreDict? } if (OpenBlocks.Blocks.projector != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.projector, "grl", "iri", "srs", 's', Blocks.stone_slab, 'r', "dustRedstone", 'g', "dustGlowstone", 'i', "ingotIron", 'l', "gemLapis")); - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.projector, "lrg", "iri", "srs", 's', Blocks.stone_slab, 'r', "dustRedstone", 'g', "dustGlowstone", 'i', "ingotIron", 'l', "gemLapis")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.projector, "grl", "iri", "srs", 's', Blocks.STONE_SLAB, 'r', "dustRedstone", 'g', "dustGlowstone", 'i', "ingotIron", 'l', "gemLapis")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.projector, "lrg", "iri", "srs", 's', Blocks.STONE_SLAB, 'r', "dustRedstone", 'g', "dustGlowstone", 'i', "ingotIron", 'l', "gemLapis")); } if (OpenBlocks.Blocks.goldenEgg != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.goldenEgg, "ggg", "geg", "ggg", 'g', "ingotGold", 'e', Items.egg)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.goldenEgg, "ggg", "geg", "ggg", 'g', "ingotGold", 'e', Items.EGG)); } if (OpenBlocks.Blocks.sky != null) { final ItemStack normal6 = new ItemStack(OpenBlocks.Blocks.sky, 6, 0); final ItemStack normal = new ItemStack(OpenBlocks.Blocks.sky, 1, 1); final ItemStack inverted = new ItemStack(OpenBlocks.Blocks.sky, 1, 0); - recipeList.add(new ShapedOreRecipe(normal6, "geg", "gsg", "geg", 'g', "blockGlassColorless", 'e', Items.ender_eye, 's', Blocks.end_stone)); - recipeList.add(new ShapelessOreRecipe(inverted, normal, Blocks.redstone_torch)); - recipeList.add(new ShapelessOreRecipe(normal, inverted, Blocks.redstone_torch)); + recipeList.add(new ShapedOreRecipe(normal6, "geg", "gsg", "geg", 'g', "blockGlassColorless", 'e', Items.ENDER_EYE, 's', Blocks.END_STONE)); + recipeList.add(new ShapelessOreRecipe(inverted, normal, Blocks.REDSTONE_TORCH)); + recipeList.add(new ShapelessOreRecipe(normal, inverted, Blocks.REDSTONE_TORCH)); } if (OpenBlocks.Blocks.drawingTable != null) { @@ -499,7 +557,7 @@ public class Config { } if (OpenBlocks.Blocks.xpShower != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.xpShower, "iii", " o", 'i', "ingotIron", 'o', Blocks.obsidian)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Blocks.xpShower, "iii", " o", 'i', "ingotIron", 'o', Blocks.OBSIDIAN)); } if (OpenBlocks.Blocks.scaffolding != null) { @@ -523,12 +581,11 @@ public class Config { } if (OpenBlocks.Items.sonicGlasses != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.sonicGlasses, "ihi", "oso", " ", 's', "stickWood", 'h', Items.iron_helmet, 'o', Blocks.obsidian, 'i', "ingotIron")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.sonicGlasses, "ihi", "oso", " ", 's', "stickWood", 'h', Items.IRON_HELMET, 'o', Blocks.OBSIDIAN, 'i', "ingotIron")); ItemStack stack = new ItemStack(OpenBlocks.Items.sonicGlasses); if (sonicGlassesLoot) { - WeightedRandomChestContent drop = new WeightedRandomChestContent(stack, 1, 1, 2); - ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(drop); + // TODO 1.10 Loot tables } } @@ -536,7 +593,7 @@ public class Config { if (OpenBlocks.Items.pencilGlasses != null) { ItemStack block = new ItemStack(OpenBlocks.Blocks.imaginary, 1, ItemImaginary.DAMAGE_PENCIL); ItemImaginary.setupValues(null, block); - recipeList.add(new ShapelessOreRecipe(OpenBlocks.Items.pencilGlasses, block, Items.paper)); + recipeList.add(new ShapelessOreRecipe(OpenBlocks.Items.pencilGlasses, block, Items.PAPER)); } if (OpenBlocks.Items.crayonGlasses != null) { @@ -546,9 +603,7 @@ public class Config { } if (technicolorGlassesLoot && OpenBlocks.Items.technicolorGlasses != null) { - WeightedRandomChestContent drop = new WeightedRandomChestContent(new ItemStack(OpenBlocks.Items.technicolorGlasses), 1, 1, 2); - ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(drop); - ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(drop); + // TODO 1.10 Loot tables } } @@ -559,7 +614,7 @@ public class Config { if (OpenBlocks.Items.craneBackpack != null) { ItemStack line = MetasGeneric.line.newItemStack(); ItemStack beam = MetasGeneric.beam.newItemStack(); - recipeList.add(new ShapelessOreRecipe(OpenBlocks.Items.craneBackpack, MetasGeneric.craneEngine.newItemStack(), MetasGeneric.craneMagnet.newItemStack(), beam, beam, line, line, line, Items.leather)); + recipeList.add(new ShapelessOreRecipe(OpenBlocks.Items.craneBackpack, MetasGeneric.craneEngine.newItemStack(), MetasGeneric.craneMagnet.newItemStack(), beam, beam, line, line, line, Items.LEATHER)); } if (OpenBlocks.Items.slimalyzer != null) { @@ -567,11 +622,11 @@ public class Config { } if (OpenBlocks.Items.sleepingBag != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.sleepingBag, "cc ", "www", "ccw", 'c', Blocks.carpet, 'w', Blocks.wool)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.sleepingBag, "cc ", "www", "ccw", 'c', Blocks.CARPET, 'w', Blocks.WOOL)); } if (OpenBlocks.Items.paintBrush != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.paintBrush, "w ", " s ", " s", 'w', Blocks.wool, 's', "stickWood")); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.paintBrush, "w ", " s ", " s", 'w', Blocks.WOOL, 's', "stickWood")); final ItemStack template = new ItemStack(OpenBlocks.Items.paintBrush, 1, OreDictionary.WILDCARD_VALUE); for (ColorMeta color : ColorMeta.getAllColors()) { @@ -582,11 +637,7 @@ public class Config { if (paintBrushLoot) { for (int color : new int[] { 0xFF0000, 0x00FF00, 0x0000FF }) { ItemStack stack = ItemPaintBrush.createStackWithColor(color); - WeightedRandomChestContent drop = new WeightedRandomChestContent(stack, 1, 1, 2); - ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(drop); - ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH).addItem(drop); - ChestGenHooks.getInfo(ChestGenHooks.BONUS_CHEST).addItem(drop); - ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(drop); + // TODO 1.10 Loot tables } } } @@ -597,9 +648,7 @@ public class Config { if (stencilLoot) { for (Stencil stencil : Stencil.values()) { - WeightedRandomChestContent drop = new WeightedRandomChestContent(new ItemStack(OpenBlocks.Items.stencil, 1, stencil.ordinal()), 1, 1, 2); - ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(drop); - ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(drop); + // TODO 1.10 Loot tables } } } @@ -628,32 +677,32 @@ public class Config { } if (OpenBlocks.Items.cartographer != null) { - recipeList.add(new ShapelessOreRecipe(OpenBlocks.Items.cartographer, MetasGeneric.assistantBase.newItemStack(), Items.ender_eye)); + recipeList.add(new ShapelessOreRecipe(OpenBlocks.Items.cartographer, MetasGeneric.assistantBase.newItemStack(), Items.ENDER_EYE)); } if (OpenBlocks.Items.goldenEye != null) { recipeList.add(new GoldenEyeRechargeRecipe()); RecipeSorter.register("openblocks:golden_eye_recharge", GoldenEyeRechargeRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless"); - recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Items.goldenEye, 1, ItemGoldenEye.MAX_DAMAGE), "ggg", "geg", "ggg", 'g', "nuggetGold", 'e', Items.ender_eye)); + recipeList.add(new ShapedOreRecipe(new ItemStack(OpenBlocks.Items.goldenEye, 1, ItemGoldenEye.MAX_DAMAGE), "ggg", "geg", "ggg", 'g', "nuggetGold", 'e', Items.ENDER_EYE)); } if (OpenBlocks.Items.tastyClay != null) { - final ItemStack cocoa = ColorMeta.BROWN.createStack(Items.dye, 1); - recipeList.add(new ShapelessOreRecipe(new ItemStack(OpenBlocks.Items.tastyClay, 2), Items.clay_ball, Items.milk_bucket, cocoa)); + final ItemStack cocoa = ColorMeta.BROWN.createStack(Items.DYE, 1); + recipeList.add(new ShapelessOreRecipe(new ItemStack(OpenBlocks.Items.tastyClay, 2), Items.CLAY_BALL, Items.MILK_BUCKET, cocoa)); } if (OpenBlocks.Items.cursor != null) { - final ItemStack whiteWool = ColorMeta.WHITE.createStack(Blocks.wool, 1); + final ItemStack whiteWool = ColorMeta.WHITE.createStack(Blocks.WOOL, 1); recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.cursor, "w ", "www", "www", 'w', whiteWool)); } if (OpenBlocks.Items.infoBook != null) { - recipeList.add(new ShapelessOreRecipe(new ItemStack(OpenBlocks.Items.infoBook), Items.clay_ball, Items.book)); + recipeList.add(new ShapelessOreRecipe(new ItemStack(OpenBlocks.Items.infoBook), Items.CLAY_BALL, Items.BOOK)); } if (OpenBlocks.Items.devNull != null) { MinecraftForge.EVENT_BUS.register(OpenBlocks.Items.devNull); - recipeList.add(new ShapelessOreRecipe(new ItemStack(OpenBlocks.Items.devNull), "cobblestone", Items.apple)); + recipeList.add(new ShapelessOreRecipe(new ItemStack(OpenBlocks.Items.devNull), "cobblestone", Items.APPLE)); } if (OpenBlocks.Items.spongeonastick != null) { @@ -663,13 +712,13 @@ public class Config { } if (OpenBlocks.Items.pedometer != null) { - recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.pedometer, "www", "rcr", "www", 'w', "plankWood", 'r', "dustRedstone", 'c', Items.clock)); + recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.pedometer, "www", "rcr", "www", 'w', "plankWood", 'r', "dustRedstone", 'c', Items.CLOCK)); } if (OpenBlocks.Items.epicEraser != null) { recipeList.add(new EpicEraserRecipe()); RecipeSorter.register("openblocks:epic_eraser", EpicEraserRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless"); - recipeList.add(new ShapelessOreRecipe(OpenBlocks.Items.epicEraser, "gemLapis", "slimeball", Blocks.wool)); + recipeList.add(new ShapelessOreRecipe(OpenBlocks.Items.epicEraser, "gemLapis", "slimeball", Blocks.WOOL)); } if (OpenBlocks.Items.filledBucket != null) { @@ -681,25 +730,26 @@ public class Config { recipeList.add(new ShapedOreRecipe(OpenBlocks.Items.wrench, "iii", "iii", 'i', "ingotIron")); } - if (explosiveEnchantmentId > 0) { + if (explosiveEnchantmentEnabled) { MinecraftForge.EVENT_BUS.register(new ExplosiveEnchantmentsHandler()); - Enchantments.explosive = new EnchantmentExplosive(explosiveEnchantmentId); + GameRegistry.register(new EnchantmentExplosive().setRegistryName(OpenBlocks.location("explosive"))); } - if (lastStandEnchantmentId > 0) { + if (lastStandEnchantmentEnabled) { MinecraftForge.EVENT_BUS.register(new LastStandEnchantmentsHandler()); - Enchantments.lastStand = new EnchantmentLastStand(lastStandEnchantmentId); + GameRegistry.register(new EnchantmentLastStand().setRegistryName(OpenBlocks.location("last_stand"))); } - if (flimFlamEnchantmentId > 0) { + if (flimFlamEnchantmentEnabled) { + FlimFlamEnchantmentsHandler.registerCapability(); MinecraftForge.EVENT_BUS.register(new FlimFlamEnchantmentsHandler()); - Enchantments.flimFlam = new EnchantmentFlimFlam(flimFlamEnchantmentId); + GameRegistry.register(new EnchantmentFlimFlam().setRegistryName(OpenBlocks.location("flim_flam"))); for (int i = 0; i < 4; i++) { int emeraldCount = 1 << i; - ItemStack result = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(Enchantments.flimFlam, i + 1)); + ItemStack result = Items.ENCHANTED_BOOK.getEnchantedItemStack(new EnchantmentData(Enchantments.flimFlam, i + 1)); Object recipe[] = new Object[emeraldCount + 1]; - recipe[0] = Items.book; + recipe[0] = Items.BOOK; Arrays.fill(recipe, 1, recipe.length, "gemEmerald"); recipeList.add(new ShapelessOreRecipe(result, recipe)); } diff --git a/src/main/java/openblocks/IOpenBlocksProxy.java b/src/main/java/openblocks/IOpenBlocksProxy.java index bffbc939..8f3a7989 100644 --- a/src/main/java/openblocks/IOpenBlocksProxy.java +++ b/src/main/java/openblocks/IOpenBlocksProxy.java @@ -1,10 +1,13 @@ package openblocks; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import openmods.api.IProxy; public interface IOpenBlocksProxy extends IProxy { - public void spawnLiquidSpray(World worldObj, FluidStack fluid, double x, double y, double z, float scale, float gravity, Vec3 velocity); + public int getParticleSettings(); + + public void spawnLiquidSpray(World worldObj, FluidStack fluid, double x, double y, double z, float scale, float gravity, Vec3d velocity); + } diff --git a/src/main/java/openblocks/NEIOpenBlocksConfig.java b/src/main/java/openblocks/NEIOpenBlocksConfig.java index cfd1f619..0b6db9d2 100644 --- a/src/main/java/openblocks/NEIOpenBlocksConfig.java +++ b/src/main/java/openblocks/NEIOpenBlocksConfig.java @@ -1,27 +1,30 @@ package openblocks; +import codechicken.nei.api.IConfigureNEI; +import com.google.common.base.Throwables; import java.lang.reflect.Method; - import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import openblocks.OpenBlocks.Items; -import codechicken.nei.api.IConfigureNEI; - -import com.google.common.base.Throwables; +import openmods.Log; public class NEIOpenBlocksConfig implements IConfigureNEI { + private static final String API = "codechicken.nei.api.API"; + private static final String HIDE_ITEM = "hideItem"; + + private Method hideItem; + @Override public void loadConfig() { - try { - // I have no idea how to link with NEI API - Class cls = Class.forName("codechicken.nei.api.API"); - Method hide = cls.getMethod("hideItem", ItemStack.class); - - if (Items.heightMap != null) hide.invoke(null, new ItemStack(Items.heightMap, 1, OreDictionary.WILDCARD_VALUE)); - } catch (Throwable t) { - Throwables.propagate(t); + if (OpenBlocks.Blocks.canvasGlass != null) { + API$hideItem(new ItemStack(OpenBlocks.Blocks.canvasGlass)); } + + if (OpenBlocks.Items.heightMap != null) { + API$hideItem(new ItemStack(OpenBlocks.Items.heightMap, 1, OreDictionary.WILDCARD_VALUE)); + } + + Log.info("OpenBlocks NEI Integration loaded successfully"); } @Override @@ -34,4 +37,12 @@ public class NEIOpenBlocksConfig implements IConfigureNEI { return "0.0"; } + private void API$hideItem(final ItemStack stack) { + try { + if (this.hideItem == null) this.hideItem = Class.forName(API).getMethod(HIDE_ITEM, ItemStack.class); + this.hideItem.invoke(null, stack); + } catch (final Throwable thr) { + Throwables.propagate(thr); + } + } } diff --git a/src/main/java/openblocks/OpenBlocks.java b/src/main/java/openblocks/OpenBlocks.java index 1994e6c2..0766fd94 100644 --- a/src/main/java/openblocks/OpenBlocks.java +++ b/src/main/java/openblocks/OpenBlocks.java @@ -1,7 +1,7 @@ package openblocks; +import com.google.common.base.Objects; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; @@ -11,35 +11,190 @@ import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import net.minecraft.stats.StatBase; import net.minecraft.stats.StatBasic; -import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fml.common.*; +import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; -import net.minecraftforge.fml.common.event.*; +import net.minecraftforge.fml.common.SidedProxy; +import net.minecraftforge.fml.common.event.FMLConstructionEvent; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLInterModComms; +import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.registry.*; +import net.minecraftforge.fml.common.registry.EntityRegistry; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; -import openblocks.common.*; -import openblocks.common.block.*; -import openblocks.common.entity.*; -import openblocks.common.item.*; +import openblocks.common.CommandInventory; +import openblocks.common.DonationUrlManager; +import openblocks.common.ElevatorActionHandler; +import openblocks.common.ElevatorBlockRules; +import openblocks.common.EntityEventHandler; +import openblocks.common.GameRuleManager; +import openblocks.common.LuggageDropHandler; +import openblocks.common.MagnetWhitelists; +import openblocks.common.MapDataManager; +import openblocks.common.PedometerHandler; +import openblocks.common.PlayerDeathHandler; +import openblocks.common.PlayerInventoryStore; +import openblocks.common.ServerTickHandler; +import openblocks.common.block.BlockAutoAnvil; +import openblocks.common.block.BlockAutoEnchantmentTable; +import openblocks.common.block.BlockBearTrap; +import openblocks.common.block.BlockBigButton; +import openblocks.common.block.BlockBlockBreaker; +import openblocks.common.block.BlockBlockPlacer; +import openblocks.common.block.BlockBuilderGuide; +import openblocks.common.block.BlockCannon; +import openblocks.common.block.BlockCanvas; +import openblocks.common.block.BlockCanvasGlass; +import openblocks.common.block.BlockDonationStation; +import openblocks.common.block.BlockDrawingTable; +import openblocks.common.block.BlockElevator; +import openblocks.common.block.BlockElevatorRotating; +import openblocks.common.block.BlockFan; +import openblocks.common.block.BlockFlag; +import openblocks.common.block.BlockGoldenEgg; +import openblocks.common.block.BlockGrave; +import openblocks.common.block.BlockGuide; +import openblocks.common.block.BlockHeal; +import openblocks.common.block.BlockImaginary; +import openblocks.common.block.BlockItemDropper; +import openblocks.common.block.BlockLadder; +import openblocks.common.block.BlockPaintCan; +import openblocks.common.block.BlockPaintMixer; +import openblocks.common.block.BlockPath; +import openblocks.common.block.BlockProjector; +import openblocks.common.block.BlockRopeLadder; +import openblocks.common.block.BlockScaffolding; +import openblocks.common.block.BlockSky; +import openblocks.common.block.BlockSponge; +import openblocks.common.block.BlockSprinkler; +import openblocks.common.block.BlockTank; +import openblocks.common.block.BlockTarget; +import openblocks.common.block.BlockTrophy; +import openblocks.common.block.BlockVacuumHopper; +import openblocks.common.block.BlockVillageHighlighter; +import openblocks.common.block.BlockXPBottler; +import openblocks.common.block.BlockXPDrain; +import openblocks.common.block.BlockXPShower; +import openblocks.common.entity.EntityCartographer; +import openblocks.common.entity.EntityGoldenEye; +import openblocks.common.entity.EntityHangGlider; +import openblocks.common.entity.EntityItemProjectile; +import openblocks.common.entity.EntityLuggage; +import openblocks.common.entity.EntityMagnet; +import openblocks.common.entity.EntityMiniMe; +import openblocks.common.entity.EntityMountedBlock; +import openblocks.common.entity.EntityXPOrbNoFly; +import openblocks.common.item.ItemCartographer; +import openblocks.common.item.ItemCraneBackpack; +import openblocks.common.item.ItemCraneControl; +import openblocks.common.item.ItemCursor; +import openblocks.common.item.ItemDevNull; +import openblocks.common.item.ItemElevator; +import openblocks.common.item.ItemEmptyMap; +import openblocks.common.item.ItemEpicEraser; +import openblocks.common.item.ItemFilledBucket; +import openblocks.common.item.ItemFlagBlock; +import openblocks.common.item.ItemGoldenEye; +import openblocks.common.item.ItemGuide; +import openblocks.common.item.ItemHangGlider; +import openblocks.common.item.ItemHeightMap; +import openblocks.common.item.ItemImaginary; +import openblocks.common.item.ItemImaginationGlasses; import openblocks.common.item.ItemImaginationGlasses.ItemCrayonGlasses; -import openblocks.common.tileentity.*; -import openblocks.enchantments.flimflams.*; +import openblocks.common.item.ItemInfoBook; +import openblocks.common.item.ItemLuggage; +import openblocks.common.item.ItemOBGeneric; +import openblocks.common.item.ItemOBGenericUnstackable; +import openblocks.common.item.ItemPaintBrush; +import openblocks.common.item.ItemPaintCan; +import openblocks.common.item.ItemPedometer; +import openblocks.common.item.ItemSkyBlock; +import openblocks.common.item.ItemSleepingBag; +import openblocks.common.item.ItemSlimalyzer; +import openblocks.common.item.ItemSonicGlasses; +import openblocks.common.item.ItemSpongeOnAStick; +import openblocks.common.item.ItemSqueegee; +import openblocks.common.item.ItemTankBlock; +import openblocks.common.item.ItemTastyClay; +import openblocks.common.item.ItemTrophyBlock; +import openblocks.common.item.ItemWrench; +import openblocks.common.tileentity.TileEntityAutoAnvil; +import openblocks.common.tileentity.TileEntityAutoEnchantmentTable; +import openblocks.common.tileentity.TileEntityBearTrap; +import openblocks.common.tileentity.TileEntityBigButton; +import openblocks.common.tileentity.TileEntityBlockBreaker; +import openblocks.common.tileentity.TileEntityBlockPlacer; +import openblocks.common.tileentity.TileEntityBuilderGuide; +import openblocks.common.tileentity.TileEntityCannon; +import openblocks.common.tileentity.TileEntityCanvas; +import openblocks.common.tileentity.TileEntityDonationStation; +import openblocks.common.tileentity.TileEntityDrawingTable; +import openblocks.common.tileentity.TileEntityElevatorRotating; +import openblocks.common.tileentity.TileEntityFan; +import openblocks.common.tileentity.TileEntityFlag; +import openblocks.common.tileentity.TileEntityGoldenEgg; +import openblocks.common.tileentity.TileEntityGrave; +import openblocks.common.tileentity.TileEntityGuide; +import openblocks.common.tileentity.TileEntityHealBlock; +import openblocks.common.tileentity.TileEntityImaginary; +import openblocks.common.tileentity.TileEntityItemDropper; +import openblocks.common.tileentity.TileEntityPaintCan; +import openblocks.common.tileentity.TileEntityPaintMixer; +import openblocks.common.tileentity.TileEntityProjector; +import openblocks.common.tileentity.TileEntitySky; +import openblocks.common.tileentity.TileEntitySprinkler; +import openblocks.common.tileentity.TileEntityTank; +import openblocks.common.tileentity.TileEntityTarget; +import openblocks.common.tileentity.TileEntityTrophy; +import openblocks.common.tileentity.TileEntityVacuumHopper; +import openblocks.common.tileentity.TileEntityVillageHighlighter; +import openblocks.common.tileentity.TileEntityXPBottler; +import openblocks.common.tileentity.TileEntityXPDrain; +import openblocks.common.tileentity.TileEntityXPShower; +import openblocks.enchantments.flimflams.BaneFlimFlam; +import openblocks.enchantments.flimflams.DummyCreepersFlimFlam; +import openblocks.enchantments.flimflams.EffectFlimFlam; +import openblocks.enchantments.flimflams.EncaseFlimFlam; +import openblocks.enchantments.flimflams.FlimFlamRegistry; +import openblocks.enchantments.flimflams.InventoryShuffleFlimFlam; +import openblocks.enchantments.flimflams.InvisibleMobsFlimFlam; +import openblocks.enchantments.flimflams.ItemDropFlimFlam; +import openblocks.enchantments.flimflams.LoreFlimFlam; +import openblocks.enchantments.flimflams.MountFlimFlam; +import openblocks.enchantments.flimflams.RenameFlimFlam; +import openblocks.enchantments.flimflams.SheepDyeFlimFlam; +import openblocks.enchantments.flimflams.SkyblockFlimFlam; +import openblocks.enchantments.flimflams.SnowballsFlimFlam; +import openblocks.enchantments.flimflams.SoundFlimFlam; +import openblocks.enchantments.flimflams.SquidFilmFlam; +import openblocks.enchantments.flimflams.TeleportFlimFlam; +import openblocks.enchantments.flimflams.UselessToolFlimFlam; import openblocks.events.ElevatorActionEvent; import openblocks.events.PlayerActionEvent; import openblocks.integration.ModuleAdapters; import openblocks.integration.ModuleTurtles; -import openblocks.rpc.*; +import openblocks.rpc.IColorChanger; +import openblocks.rpc.IGuideAnimationTrigger; +import openblocks.rpc.ILevelChanger; +import openblocks.rpc.IRotatable; +import openblocks.rpc.IStencilCrafter; +import openblocks.rpc.ITriggerable; import openblocks.rubbish.BrickManager; import openblocks.rubbish.CommandFlimFlam; import openblocks.rubbish.CommandLuck; @@ -48,7 +203,11 @@ import openmods.OpenMods; import openmods.colors.ColoredModelProvider; import openmods.config.BlockInstances; import openmods.config.ItemInstances; -import openmods.config.game.*; +import openmods.config.game.FactoryRegistry; +import openmods.config.game.GameRegistryObjectsProvider; +import openmods.config.game.ModStartupHelper; +import openmods.config.game.RegisterBlock; +import openmods.config.game.RegisterItem; import openmods.config.properties.ConfigProcessing; import openmods.integration.Integration; import openmods.liquids.BucketFillHandler; @@ -56,8 +215,6 @@ import openmods.network.event.NetworkEventManager; import openmods.network.rpc.RpcCallDispatcher; import openmods.utils.EnchantmentUtils; -import com.google.common.base.Objects; - @Mod(modid = OpenBlocks.MODID, name = OpenBlocks.NAME, version = OpenBlocks.VERSION, dependencies = OpenBlocks.DEPENDENCIES, guiFactory = "openblocks.client.ModGuiFactory") public class OpenBlocks { public static final String MODID = "OpenBlocks"; @@ -87,214 +244,214 @@ public class OpenBlocks { private final ApiSetup apiSetup = new ApiSetup(); public static class Blocks implements BlockInstances { - @RegisterBlock(name = "ladder") + @RegisterBlock(id = "ladder") public static BlockLadder ladder; - @RegisterBlock(name = "guide", tileEntity = TileEntityGuide.class, itemBlock = ItemGuide.class) + @RegisterBlock(id = "guide", tileEntity = TileEntityGuide.class, itemBlock = ItemGuide.class) public static BlockGuide guide; - @RegisterBlock(name = "builder_guide", tileEntity = TileEntityBuilderGuide.class, itemBlock = ItemGuide.class) + @RegisterBlock(id = "builder_guide", tileEntity = TileEntityBuilderGuide.class, itemBlock = ItemGuide.class) public static BlockBuilderGuide builderGuide; - @RegisterBlock(name = "elevator", itemBlock = ItemElevator.class, registerDefaultItemModel = false, customItemModels = ColoredModelProvider.class) + @RegisterBlock(id = "elevator", itemBlock = ItemElevator.class, registerDefaultItemModel = false, customItemModels = ColoredModelProvider.class) public static BlockElevator elevator; - @RegisterBlock(name = "elevator_rotating", tileEntity = TileEntityElevatorRotating.class, itemBlock = ItemElevator.class, registerDefaultItemModel = false, customItemModels = ColoredModelProvider.class) + @RegisterBlock(id = "elevator_rotating", tileEntity = TileEntityElevatorRotating.class, itemBlock = ItemElevator.class, registerDefaultItemModel = false, customItemModels = ColoredModelProvider.class) public static BlockElevatorRotating elevatorRotating; - @RegisterBlock(name = "heal", tileEntity = TileEntityHealBlock.class) + @RegisterBlock(id = "heal", tileEntity = TileEntityHealBlock.class) public static BlockHeal heal; - @RegisterBlock(name = "target", tileEntity = TileEntityTarget.class) + @RegisterBlock(id = "target", tileEntity = TileEntityTarget.class) public static BlockTarget target; - @RegisterBlock(name = "grave", tileEntity = TileEntityGrave.class) + @RegisterBlock(id = "grave", tileEntity = TileEntityGrave.class) public static BlockGrave grave; - @RegisterBlock(name = "flag", tileEntity = TileEntityFlag.class, itemBlock = ItemFlagBlock.class) + @RegisterBlock(id = "flag", tileEntity = TileEntityFlag.class, itemBlock = ItemFlagBlock.class) public static BlockFlag flag; - @RegisterBlock(name = "tank", tileEntity = TileEntityTank.class, itemBlock = ItemTankBlock.class) + @RegisterBlock(id = "tank", tileEntity = TileEntityTank.class, itemBlock = ItemTankBlock.class) public static BlockTank tank; - @RegisterBlock(name = "trophy", tileEntity = TileEntityTrophy.class, itemBlock = ItemTrophyBlock.class) + @RegisterBlock(id = "trophy", tileEntity = TileEntityTrophy.class, itemBlock = ItemTrophyBlock.class) public static BlockTrophy trophy; - @RegisterBlock(name = "beartrap", tileEntity = TileEntityBearTrap.class) + @RegisterBlock(id = "beartrap", tileEntity = TileEntityBearTrap.class) public static BlockBearTrap bearTrap; - @RegisterBlock(name = "sprinkler", tileEntity = TileEntitySprinkler.class) + @RegisterBlock(id = "sprinkler", tileEntity = TileEntitySprinkler.class) public static BlockSprinkler sprinkler; - @RegisterBlock(name = "cannon", tileEntity = TileEntityCannon.class) + @RegisterBlock(id = "cannon", tileEntity = TileEntityCannon.class) public static BlockCannon cannon; - @RegisterBlock(name = "vacuumhopper", tileEntity = TileEntityVacuumHopper.class) + @RegisterBlock(id = "vacuumhopper", tileEntity = TileEntityVacuumHopper.class) public static BlockVacuumHopper vacuumHopper; - @RegisterBlock(name = "sponge") + @RegisterBlock(id = "sponge") public static BlockSponge sponge; - @RegisterBlock(name = "bigbutton", tileEntity = TileEntityBigButton.class) + @RegisterBlock(id = "bigbutton", tileEntity = TileEntityBigButton.class) public static BlockBigButton bigButton; - @RegisterBlock(name = "imaginary", tileEntity = TileEntityImaginary.class, itemBlock = ItemImaginary.class) + @RegisterBlock(id = "imaginary", tileEntity = TileEntityImaginary.class, itemBlock = ItemImaginary.class) public static BlockImaginary imaginary; - @RegisterBlock(name = "fan", tileEntity = TileEntityFan.class) + @RegisterBlock(id = "fan", tileEntity = TileEntityFan.class) public static BlockFan fan; - @RegisterBlock(name = "xpbottler", tileEntity = TileEntityXPBottler.class) + @RegisterBlock(id = "xpbottler", tileEntity = TileEntityXPBottler.class) public static BlockXPBottler xpBottler; - @RegisterBlock(name = "village_highlighter", tileEntity = TileEntityVillageHighlighter.class) + @RegisterBlock(id = "village_highlighter", tileEntity = TileEntityVillageHighlighter.class) public static BlockVillageHighlighter villageHighlighter; - @RegisterBlock(name = "path") + @RegisterBlock(id = "path") public static BlockPath path; - @RegisterBlock(name = "autoanvil", tileEntity = TileEntityAutoAnvil.class) + @RegisterBlock(id = "autoanvil", tileEntity = TileEntityAutoAnvil.class) public static BlockAutoAnvil autoAnvil; - @RegisterBlock(name = "autoenchantmenttable", tileEntity = TileEntityAutoEnchantmentTable.class) + @RegisterBlock(id = "autoenchantmenttable", tileEntity = TileEntityAutoEnchantmentTable.class) public static BlockAutoEnchantmentTable autoEnchantmentTable; - @RegisterBlock(name = "xpdrain", tileEntity = TileEntityXPDrain.class) + @RegisterBlock(id = "xpdrain", tileEntity = TileEntityXPDrain.class) public static BlockXPDrain xpDrain; - @RegisterBlock(name = "blockbreaker", tileEntity = TileEntityBlockBreaker.class) + @RegisterBlock(id = "blockbreaker", tileEntity = TileEntityBlockBreaker.class) public static BlockBlockBreaker blockBreaker; - @RegisterBlock(name = "blockPlacer", tileEntity = TileEntityBlockPlacer.class) + @RegisterBlock(id = "blockPlacer", tileEntity = TileEntityBlockPlacer.class) public static BlockBlockPlacer blockPlacer; - @RegisterBlock(name = "itemDropper", tileEntity = TileEntityItemDropper.class) + @RegisterBlock(id = "itemDropper", tileEntity = TileEntityItemDropper.class) public static BlockItemDropper itemDropper; - @RegisterBlock(name = "ropeladder") + @RegisterBlock(id = "ropeladder") public static BlockRopeLadder ropeLadder; - @RegisterBlock(name = "donationStation", tileEntity = TileEntityDonationStation.class) + @RegisterBlock(id = "donationStation", tileEntity = TileEntityDonationStation.class) public static BlockDonationStation donationStation; - @RegisterBlock(name = "paintmixer", tileEntity = TileEntityPaintMixer.class) + @RegisterBlock(id = "paintmixer", tileEntity = TileEntityPaintMixer.class) public static BlockPaintMixer paintMixer; - @RegisterBlock(name = "canvas", tileEntity = TileEntityCanvas.class) + @RegisterBlock(id = "canvas", tileEntity = TileEntityCanvas.class) public static BlockCanvas canvas; - @RegisterBlock(name = "paintcan", tileEntity = TileEntityPaintCan.class, itemBlock = ItemPaintCan.class) + @RegisterBlock(id = "paintcan", tileEntity = TileEntityPaintCan.class, itemBlock = ItemPaintCan.class) public static BlockPaintCan paintCan; - @RegisterBlock(name = "canvasglass", tileEntity = TileEntityCanvas.class) + @RegisterBlock(id = "canvasglass", tileEntity = TileEntityCanvas.class) public static BlockCanvasGlass canvasGlass; - @RegisterBlock(name = "projector", tileEntity = TileEntityProjector.class) + @RegisterBlock(id = "projector", tileEntity = TileEntityProjector.class) public static BlockProjector projector; - @RegisterBlock(name = "drawingtable", tileEntity = TileEntityDrawingTable.class) + @RegisterBlock(id = "drawingtable", tileEntity = TileEntityDrawingTable.class) public static BlockDrawingTable drawingTable; - @RegisterBlock(name = "sky", tileEntity = TileEntitySky.class, itemBlock = ItemSkyBlock.class, unlocalizedName = "sky.normal") + @RegisterBlock(id = "sky", tileEntity = TileEntitySky.class, itemBlock = ItemSkyBlock.class, unlocalizedName = "sky.normal") public static BlockSky sky; - @RegisterBlock(name = "xpshower", tileEntity = TileEntityXPShower.class) + @RegisterBlock(id = "xpshower", tileEntity = TileEntityXPShower.class) public static BlockXPShower xpShower; - @RegisterBlock(name = "goldenegg", tileEntity = TileEntityGoldenEgg.class) + @RegisterBlock(id = "goldenegg", tileEntity = TileEntityGoldenEgg.class) public static BlockGoldenEgg goldenEgg; - @RegisterBlock(name = "scaffolding") + @RegisterBlock(id = "scaffolding") public static BlockScaffolding scaffolding; } public static class Items implements ItemInstances { - @RegisterItem(name = "hangglider") + @RegisterItem(id = "hangglider") public static ItemHangGlider hangGlider; - @RegisterItem(name = "generic", isConfigurable = false, registerDefaultModel = false) + @RegisterItem(id = "generic", isConfigurable = false, registerDefaultModel = false) public static ItemOBGeneric generic; - @RegisterItem(name = "luggage") + @RegisterItem(id = "luggage") public static ItemLuggage luggage; - @RegisterItem(name = "sonicglasses") + @RegisterItem(id = "sonicglasses") public static ItemSonicGlasses sonicGlasses; - @RegisterItem(name = "pencilGlasses", unlocalizedName = "glasses.pencil") + @RegisterItem(id = "pencilGlasses", unlocalizedName = "glasses.pencil") public static ItemImaginationGlasses pencilGlasses; - @RegisterItem(name = "crayonGlasses", unlocalizedName = "glasses.crayon") + @RegisterItem(id = "crayonGlasses", unlocalizedName = "glasses.crayon") public static ItemCrayonGlasses crayonGlasses; - @RegisterItem(name = "technicolorGlasses", unlocalizedName = "glasses.technicolor") + @RegisterItem(id = "technicolorGlasses", unlocalizedName = "glasses.technicolor") public static ItemImaginationGlasses technicolorGlasses; - @RegisterItem(name = "seriousGlasses", unlocalizedName = "glasses.admin") + @RegisterItem(id = "seriousGlasses", unlocalizedName = "glasses.admin") public static ItemImaginationGlasses seriousGlasses; - @RegisterItem(name = "craneControl", unlocalizedName = "crane_control") + @RegisterItem(id = "craneControl", unlocalizedName = "crane_control") public static ItemCraneControl craneControl; - @RegisterItem(name = "craneBackpack", unlocalizedName = "crane_backpack") + @RegisterItem(id = "craneBackpack", unlocalizedName = "crane_backpack") public static ItemCraneBackpack craneBackpack; - @RegisterItem(name = "slimalyzer") + @RegisterItem(id = "slimalyzer") public static ItemSlimalyzer slimalyzer; - @RegisterItem(name = "filledbucket", registerDefaultModel = false) + @RegisterItem(id = "filledbucket", registerDefaultModel = false) public static ItemFilledBucket filledBucket; - @RegisterItem(name = "sleepingBag", unlocalizedName = "sleepingbag") + @RegisterItem(id = "sleepingBag", unlocalizedName = "sleepingbag") public static ItemSleepingBag sleepingBag; - @RegisterItem(name = "paintBrush", unlocalizedName = "paintbrush") + @RegisterItem(id = "paintBrush", unlocalizedName = "paintbrush") public static ItemPaintBrush paintBrush; - @RegisterItem(name = "stencil", registerDefaultModel = false) + @RegisterItem(id = "stencil", registerDefaultModel = false) public static ItemOBGeneric stencil; - @RegisterItem(name = "squeegee") + @RegisterItem(id = "squeegee") public static ItemSqueegee squeegee; - @RegisterItem(name = "heightMap", unlocalizedName = "height_map") + @RegisterItem(id = "heightMap", unlocalizedName = "height_map") public static ItemHeightMap heightMap; - @RegisterItem(name = "emptyMap", unlocalizedName = "empty_map") + @RegisterItem(id = "emptyMap", unlocalizedName = "empty_map") public static ItemEmptyMap emptyMap; - @RegisterItem(name = "cartographer") + @RegisterItem(id = "cartographer") public static ItemCartographer cartographer; - @RegisterItem(name = "tastyClay", unlocalizedName = "tasty_clay") + @RegisterItem(id = "tastyClay", unlocalizedName = "tasty_clay") public static ItemTastyClay tastyClay; - @RegisterItem(name = "goldenEye", unlocalizedName = "golden_eye") + @RegisterItem(id = "goldenEye", unlocalizedName = "golden_eye") public static ItemGoldenEye goldenEye; - @RegisterItem(name = "genericUnstackable", isConfigurable = false, registerDefaultModel = false) + @RegisterItem(id = "genericUnstackable", isConfigurable = false, registerDefaultModel = false) public static ItemOBGenericUnstackable genericUnstackable; - @RegisterItem(name = "cursor") + @RegisterItem(id = "cursor") public static ItemCursor cursor; - @RegisterItem(name = "infoBook", unlocalizedName = "info_book") + @RegisterItem(id = "infoBook", unlocalizedName = "info_book") public static ItemInfoBook infoBook; - @RegisterItem(name = "devnull") + @RegisterItem(id = "devnull") public static ItemDevNull devNull; - @RegisterItem(name = "spongeonastick") + @RegisterItem(id = "spongeonastick") public static ItemSpongeOnAStick spongeonastick; - @RegisterItem(name = "pedometer") + @RegisterItem(id = "pedometer") public static ItemPedometer pedometer; - @RegisterItem(name = "epicEraser", unlocalizedName = "epic_eraser") + @RegisterItem(id = "epicEraser", unlocalizedName = "epic_eraser") public static ItemEpicEraser epicEraser; - @RegisterItem(name = "wrench") + @RegisterItem(id = "wrench") public static ItemWrench wrench; } @@ -311,23 +468,118 @@ public class OpenBlocks { public static final Fluid xpJuice = new Fluid("xpjuice", location("xpjuicestill"), location("xpjuiceflowing")).setLuminosity(10).setDensity(800).setViscosity(1500).setUnlocalizedName("OpenBlocks.xpjuice"); } + @ObjectHolder(MODID) + public static class Sounds { + // TODO subtitles where sensible + // TODO remove categories from sounds.json + @ObjectHolder("elevator.activate") + public static final SoundEvent BLOCK_ELEVATOR_ACTIVATE = null; + + @ObjectHolder("grave.rob") + public static final SoundEvent BLOCK_GRAVE_ROB = null; + + @ObjectHolder("beartrap.open") + public static final SoundEvent BLOCK_BEARTRAP_OPEN = null; + + @ObjectHolder("beartrap.close") + public static final SoundEvent BLOCK_BEARTRAP_CLOSE = null; + + @ObjectHolder("cannon.activate") + public static final SoundEvent BLOCK_CANNON_ACTIVATE = null; + + @ObjectHolder("target.open") + public static final SoundEvent BLOCK_TARGET_OPEN = null; + + @ObjectHolder("target.close") + public static final SoundEvent BLOCK_TARGET_CLOSE = null; + + @ObjectHolder("bottler.signal") + public static final SoundEvent BLOCK_XPBOTTLER_DONE = null; + + @ObjectHolder("crayon.place") + public static final SoundEvent ITEM_CRAYON_PLACE = null; + + @ObjectHolder("luggage.walk") + public static final SoundEvent ENTITY_LUGGAGE_WALK = null; + + @ObjectHolder("luggage.eat.food") + public static final SoundEvent ENTITY_LUGGAGE_EAT_FOOD = null; + + @ObjectHolder("luggage.eat.item") + public static final SoundEvent ENTITY_LUGGAGE_EAT_ITEM = null; + + @ObjectHolder("pedometer.use") + public static final SoundEvent ITEM_PEDOMETER_USE = null; + + @ObjectHolder("slimalyzer.signal") + public static final SoundEvent ITEM_SLIMALYZER_PING = null; + + @ObjectHolder("squeegee.use") + public static final SoundEvent ITEM_SQUEEGEE_ACTION = null; + + @ObjectHolder("best.feature.ever.fart") + public static final SoundEvent PLAYER_WHOOPS = null; + + @ObjectHolder("annoying.mosquito") + public static final SoundEvent MISC_MOSQUITO = null; + + @ObjectHolder("annoying.alarmclock") + public static final SoundEvent MISC_ALARM_CLOCK = null; + + @ObjectHolder("annoying.vibrate") + public static final SoundEvent MISC_VIBRATE = null; + + public static void registerSounds() { + registerSound("elevator.activate"); + registerSound("grave.rob"); + registerSound("crayon.place"); + registerSound("luggage.walk"); + registerSound("luggage.eat.food"); + registerSound("luggage.eat.item"); + registerSound("pedometer.use"); + registerSound("slimalyzer.signal"); + registerSound("squeegee.use"); + registerSound("best.feature.ever.fart"); + registerSound("annoying.mosquito"); + registerSound("annoying.alarmclock"); + registerSound("annoying.vibrate"); + registerSound("beartrap.open"); + registerSound("beartrap.close"); + registerSound("cannon.activate"); + registerSound("target.open"); + registerSound("target.close"); + registerSound("bottler.signal"); + } + + private static void registerSound(String id) { + final ResourceLocation resourceLocation = location(id); + GameRegistry.register(new SoundEvent(resourceLocation).setRegistryName(resourceLocation)); + } + } + + @ObjectHolder(MODID) public static class Enchantments { - public static Enchantment explosive; - public static Enchantment lastStand; - public static Enchantment flimFlam; + @ObjectHolder("explosive") + public static final Enchantment explosive = null; + + @ObjectHolder("last_stand") + public static final Enchantment lastStand = null; + + @ObjectHolder("flim_flam") + public static final Enchantment flimFlam = null; } public static CreativeTabs tabOpenBlocks = new CreativeTabs("tabOpenBlocks") { @Override public Item getTabIconItem() { - Block block = Objects.firstNonNull(OpenBlocks.Blocks.flag, net.minecraft.init.Blocks.sponge); + Block block = Objects.firstNonNull(OpenBlocks.Blocks.flag, net.minecraft.init.Blocks.SPONGE); return Item.getItemFromBlock(block); } @Override @SideOnly(Side.CLIENT) - public void displayAllReleventItems(List result) { - super.displayAllReleventItems(result); + public void displayAllRelevantItems(List result) { + super.displayAllRelevantItems(result); if (Enchantments.explosive != null) EnchantmentUtils.addAllBooks(Enchantments.explosive, result); if (Enchantments.lastStand != null) EnchantmentUtils.addAllBooks(Enchantments.lastStand, result); if (Enchantments.flimFlam != null) EnchantmentUtils.addAllBooks(Enchantments.flimFlam, result); @@ -335,12 +587,12 @@ public class OpenBlocks { }; - public static final Achievement brickAchievement = new Achievement("openblocks.oops", "openblocks.droppedBrick", 13, 13, net.minecraft.init.Items.brick, null).registerStat(); + public static final Achievement brickAchievement = new Achievement("openblocks.oops", "openblocks.droppedBrick", 13, 13, net.minecraft.init.Items.BRICK, null).registerStat(); - public static final Achievement stackAchievement = new Achievement("openblocks.tma2", "openblocks.stackOverflow", -13, 13, net.minecraft.init.Items.nether_star, null).registerStat(); + public static final Achievement stackAchievement = new Achievement("openblocks.tma2", "openblocks.stackOverflow", -13, 13, net.minecraft.init.Items.NETHER_STAR, null).registerStat(); public static final StatBase brickStat = new StatBasic("openblocks.dropped", - new ChatComponentTranslation("stat.openblocks.bricksDropped"), + new TextComponentTranslation("stat.openblocks.bricksDropped"), StatBase.simpleStatType).registerStat(); private final ModStartupHelper startupHelper = new ModStartupHelper("openblocks") { @@ -351,7 +603,7 @@ public class OpenBlocks { } @Override - protected void setupConfigPre(GameConfigProvider gameConfig) { + protected void setupConfigPre(GameRegistryObjectsProvider gameConfig) { gameConfig.setCreativeTab(tabOpenBlocks); } @@ -415,6 +667,8 @@ public class OpenBlocks { Config.register(); + Sounds.registerSounds(); + apiSetup.setupApis(); apiSetup.installHolderAccess(evt.getAsmData()); @@ -423,7 +677,8 @@ public class OpenBlocks { MinecraftForge.EVENT_BUS.register(new PlayerDeathHandler()); if (OpenBlocks.Items.cursor != null) { - MinecraftForge.EVENT_BUS.register(new GuiOpenHandler()); + // TODO maybe figure way to validate GUIs over distance? + // was: GuiOpenHandler: handler for PlayerOpenContainerEvent } EntityRegistry.registerModEntity(EntityLuggage.class, "Luggage", ENTITY_LUGGAGE_ID, OpenBlocks.instance, 64, 1, true); @@ -445,6 +700,7 @@ public class OpenBlocks { Integration.addModule(new ModuleTurtles()); if (!Config.soSerious) { + BrickManager.registerCapability(); MinecraftForge.EVENT_BUS.register(new BrickManager()); } @@ -457,7 +713,8 @@ public class OpenBlocks { } { - String luggageName = EntityList.classToStringMapping.get(EntityLuggage.class); + String luggageName = EntityList.getEntityStringFromClass(EntityLuggage.class); + // TODO 1.10 verify if it still works FMLInterModComms.sendMessage(Mods.MFR, "registerAutoSpawnerBlacklist", luggageName); } @@ -473,6 +730,10 @@ public class OpenBlocks { BucketFillHandler.instance.addToWhitelist(TileEntityTank.class); } + if (Items.pedometer != null) { + PedometerHandler.registerCapability(); + } + MinecraftForge.EVENT_BUS.register(PlayerInventoryStore.instance); MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); @@ -482,14 +743,14 @@ public class OpenBlocks { proxy.preInit(); } - @SuppressWarnings({ "deprecation", "unused" }) + @SuppressWarnings({ "unused" }) protected void registerUselessVillager() { - VillagerRegistry.instance().registerVillagerId(Config.radioVillagerId); - final VillagerProfession prof = new VillagerProfession( - "openblocks:radio", - "openblocks:textures/models/king-ish.png"); - VillagerRegistry.instance().register(prof); - new VillagerCareer(prof, "basic"); // TODO? + final VillagerProfession prof = GameRegistry.register(new VillagerProfession( + "radio", + "openblocks:textures/models/king-ish.png", + "openblocks:textures/models/king-ish.png")); // TODO: zombie texture? + + new VillagerCareer(prof, "basic"); // TODO re-add trades } @EventHandler @@ -556,7 +817,7 @@ public class OpenBlocks { } private static void registerOreDictionary() { - OreDictionary.registerOre("craftingTableWood", new ItemStack(net.minecraft.init.Blocks.crafting_table)); - OreDictionary.registerOre("chestWood", new ItemStack(net.minecraft.init.Blocks.chest)); + OreDictionary.registerOre("craftingTableWood", new ItemStack(net.minecraft.init.Blocks.CRAFTING_TABLE)); + OreDictionary.registerOre("chestWood", new ItemStack(net.minecraft.init.Blocks.CHEST)); } } diff --git a/src/main/java/openblocks/OpenBlocksCorePlugin.java b/src/main/java/openblocks/OpenBlocksCorePlugin.java index 5e1233b1..31572cdc 100644 --- a/src/main/java/openblocks/OpenBlocksCorePlugin.java +++ b/src/main/java/openblocks/OpenBlocksCorePlugin.java @@ -1,7 +1,6 @@ package openblocks; import java.util.Map; - import net.minecraft.launchwrapper.Launch; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.SortingIndex; diff --git a/src/main/java/openblocks/OpenBlocksGuiHandler.java b/src/main/java/openblocks/OpenBlocksGuiHandler.java index bee41a2f..5d5a3732 100644 --- a/src/main/java/openblocks/OpenBlocksGuiHandler.java +++ b/src/main/java/openblocks/OpenBlocksGuiHandler.java @@ -21,8 +21,8 @@ public class OpenBlocksGuiHandler implements IGuiHandler { public static final GuiId[] VALUES = GuiId.values(); } - private static ContainerDevNull createDevNullContainer(EntityPlayer player) { - return new ContainerDevNull(player.inventory, new ItemDevNull.DevNullInventory(player)); + private static ContainerDevNull createDevNullContainer(EntityPlayer player, int protectedSlot) { + return new ContainerDevNull(player.inventory, new ItemDevNull.DevNullInventory(player, protectedSlot), protectedSlot); } private static ContainerLuggage createLuggageContainer(EntityPlayer player, World world, int entityId) { @@ -43,7 +43,7 @@ public class OpenBlocksGuiHandler implements IGuiHandler { return createLuggageContainer(player, world, x); case devNull: if (player.inventory.getCurrentItem() == null) return null; - return createDevNullContainer(player); + return createDevNullContainer(player, x); default: return null; } @@ -60,7 +60,7 @@ public class OpenBlocksGuiHandler implements IGuiHandler { return container != null? new GuiLuggage(container) : null; } case devNull: - return new GuiDevNull(createDevNullContainer(player)); + return new GuiDevNull(createDevNullContainer(player, x)); default: return null; } diff --git a/src/main/java/openblocks/api/ApiHolder.java b/src/main/java/openblocks/api/ApiHolder.java index 9ced5310..3aeb5c1c 100644 --- a/src/main/java/openblocks/api/ApiHolder.java +++ b/src/main/java/openblocks/api/ApiHolder.java @@ -1,6 +1,9 @@ package openblocks.api; -import java.lang.annotation.*; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Static variables marked with this annotation will be filled with instance diff --git a/src/main/java/openblocks/api/GraveDropsEvent.java b/src/main/java/openblocks/api/GraveDropsEvent.java index 1cce343d..16490191 100644 --- a/src/main/java/openblocks/api/GraveDropsEvent.java +++ b/src/main/java/openblocks/api/GraveDropsEvent.java @@ -1,15 +1,13 @@ package openblocks.api; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; import java.util.List; - import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fml.common.eventhandler.Cancelable; import net.minecraftforge.fml.common.eventhandler.Event; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; - @Cancelable public class GraveDropsEvent extends Event { diff --git a/src/main/java/openblocks/api/GraveSpawnEvent.java b/src/main/java/openblocks/api/GraveSpawnEvent.java index 8f85daf1..78eb4f7f 100644 --- a/src/main/java/openblocks/api/GraveSpawnEvent.java +++ b/src/main/java/openblocks/api/GraveSpawnEvent.java @@ -1,11 +1,10 @@ package openblocks.api; import java.util.List; - import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.util.IChatComponent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.fml.common.eventhandler.Cancelable; @@ -14,13 +13,13 @@ public class GraveSpawnEvent extends PlayerEvent { public List loot; - public IChatComponent clickText; + public ITextComponent clickText; public String gravestoneText; public BlockPos location; - public GraveSpawnEvent(EntityPlayer player, BlockPos pos, List loot, String gravestoneText, IChatComponent clickText) { + public GraveSpawnEvent(EntityPlayer player, BlockPos pos, List loot, String gravestoneText, ITextComponent clickText) { super(player); this.loot = loot; this.gravestoneText = gravestoneText; diff --git a/src/main/java/openblocks/api/IElevatorBlock.java b/src/main/java/openblocks/api/IElevatorBlock.java index 1fb636c4..67d4b589 100644 --- a/src/main/java/openblocks/api/IElevatorBlock.java +++ b/src/main/java/openblocks/api/IElevatorBlock.java @@ -2,7 +2,7 @@ package openblocks.api; import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public interface IElevatorBlock { diff --git a/src/main/java/openblocks/api/IPaintableBlock.java b/src/main/java/openblocks/api/IPaintableBlock.java index 866a09f1..82e95494 100644 --- a/src/main/java/openblocks/api/IPaintableBlock.java +++ b/src/main/java/openblocks/api/IPaintableBlock.java @@ -1,7 +1,7 @@ package openblocks.api; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public interface IPaintableBlock { diff --git a/src/main/java/openblocks/api/IPointable.java b/src/main/java/openblocks/api/IPointable.java index 0ad8e632..446fb7a0 100644 --- a/src/main/java/openblocks/api/IPointable.java +++ b/src/main/java/openblocks/api/IPointable.java @@ -2,7 +2,7 @@ package openblocks.api; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; public interface IPointable { void onPointingStart(ItemStack itemStack, EntityPlayer player); diff --git a/src/main/java/openblocks/api/InventoryEvent.java b/src/main/java/openblocks/api/InventoryEvent.java index 4f9b3ad4..88ea1004 100644 --- a/src/main/java/openblocks/api/InventoryEvent.java +++ b/src/main/java/openblocks/api/InventoryEvent.java @@ -1,15 +1,13 @@ package openblocks.api; -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.player.PlayerEvent; - import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.player.PlayerEvent; public class InventoryEvent extends PlayerEvent { diff --git a/src/main/java/openblocks/api/SleepingBagUseEvent.java b/src/main/java/openblocks/api/SleepingBagUseEvent.java index 3fe4bb22..985a6457 100644 --- a/src/main/java/openblocks/api/SleepingBagUseEvent.java +++ b/src/main/java/openblocks/api/SleepingBagUseEvent.java @@ -1,7 +1,7 @@ package openblocks.api; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.IChatComponent; +import net.minecraft.util.text.ITextComponent; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraftforge.fml.common.eventhandler.Event.HasResult; @@ -11,24 +11,25 @@ import net.minecraftforge.fml.common.eventhandler.Event.HasResult; * Use {@link Event#setResult(Result)} to override: {@link Event.Result.ALLOW} to allow even if original algorithm forbids it, {@link Event.Result.DENY} to block normally allowed action. */ @HasResult +@Deprecated // TODO switch to forge public class SleepingBagUseEvent extends PlayerEvent { /** * Text displayed to player if action was denied */ - public IChatComponent playerChat; + public ITextComponent playerChat; /** * Status determined by original algorithm */ - public final EntityPlayer.EnumStatus status; + public final EntityPlayer.SleepResult status; - public SleepingBagUseEvent(EntityPlayer player, EntityPlayer.EnumStatus cause) { + public SleepingBagUseEvent(EntityPlayer player, EntityPlayer.SleepResult cause) { super(player); this.status = cause; } public boolean defaultCanSleep() { - return status == EntityPlayer.EnumStatus.OK; + return status == EntityPlayer.SleepResult.OK; } } diff --git a/src/main/java/openblocks/api/package-info.java b/src/main/java/openblocks/api/package-info.java index 6845c2b7..9ecf1470 100644 --- a/src/main/java/openblocks/api/package-info.java +++ b/src/main/java/openblocks/api/package-info.java @@ -2,4 +2,3 @@ package openblocks.api; import net.minecraftforge.fml.common.API; - diff --git a/src/main/java/openblocks/asm/EntityPlayerVisitor.java b/src/main/java/openblocks/asm/EntityPlayerVisitor.java index 04d20aa6..e7465301 100644 --- a/src/main/java/openblocks/asm/EntityPlayerVisitor.java +++ b/src/main/java/openblocks/asm/EntityPlayerVisitor.java @@ -2,8 +2,10 @@ package openblocks.asm; import openmods.Log; import openmods.asm.MethodMatcher; - -import org.objectweb.asm.*; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; public class EntityPlayerVisitor extends ClassVisitor { diff --git a/src/main/java/openblocks/asm/OpenBlocksClassTransformer.java b/src/main/java/openblocks/asm/OpenBlocksClassTransformer.java index dbcfb319..b825be0f 100644 --- a/src/main/java/openblocks/asm/OpenBlocksClassTransformer.java +++ b/src/main/java/openblocks/asm/OpenBlocksClassTransformer.java @@ -4,7 +4,6 @@ import net.minecraft.launchwrapper.IClassTransformer; import openmods.Log; import openmods.asm.VisitorHelper; import openmods.asm.VisitorHelper.TransformProvider; - import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ClassWriter; diff --git a/src/main/java/openblocks/client/ChangelogBuilder.java b/src/main/java/openblocks/client/ChangelogBuilder.java index 7e84a733..33d76616 100644 --- a/src/main/java/openblocks/client/ChangelogBuilder.java +++ b/src/main/java/openblocks/client/ChangelogBuilder.java @@ -1,22 +1,20 @@ package openblocks.client; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.resources.IResource; import net.minecraft.util.ResourceLocation; import openmods.Log; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; - public class ChangelogBuilder { private static final ResourceLocation CHANGELOG = new ResourceLocation("openblocks", "changelog.json"); diff --git a/src/main/java/openblocks/client/ClientProxy.java b/src/main/java/openblocks/client/ClientProxy.java index dc994a07..7c498a25 100644 --- a/src/main/java/openblocks/client/ClientProxy.java +++ b/src/main/java/openblocks/client/ClientProxy.java @@ -1,16 +1,17 @@ package openblocks.client; +import com.google.common.base.Throwables; import java.lang.reflect.Field; - import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderSnowball; -import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; -import net.minecraft.util.Vec3; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.model.ModelLoader; @@ -24,12 +25,64 @@ import openblocks.IOpenBlocksProxy; import openblocks.OpenBlocks; import openblocks.client.bindings.KeyInputHandler; import openblocks.client.fx.FXLiquidSpray; -import openblocks.client.model.*; -import openblocks.client.renderer.entity.*; -import openblocks.client.renderer.tileentity.*; +import openblocks.client.model.ModelAutoAnvil; +import openblocks.client.model.ModelBearTrap; +import openblocks.client.model.ModelCraneBackpack; +import openblocks.client.model.ModelPiggy; +import openblocks.client.model.ModelSprinkler; +import openblocks.client.model.ModelTarget; +import openblocks.client.model.ModelVacuumHopper; +import openblocks.client.model.ModelXPShower; +import openblocks.client.renderer.entity.EntityCartographerRenderer; +import openblocks.client.renderer.entity.EntityHangGliderRenderer; +import openblocks.client.renderer.entity.EntityLuggageRenderer; +import openblocks.client.renderer.entity.EntityMagnetRenderer; +import openblocks.client.renderer.entity.EntityMiniMeRenderer; +import openblocks.client.renderer.entity.EntitySelectionHandler; +import openblocks.client.renderer.tileentity.TileEntityAutoEnchantmentTableRenderer; +import openblocks.client.renderer.tileentity.TileEntityCannonRenderer; +import openblocks.client.renderer.tileentity.TileEntityFanRenderer; +import openblocks.client.renderer.tileentity.TileEntityFlagRenderer; +import openblocks.client.renderer.tileentity.TileEntityGoldenEggRenderer; +import openblocks.client.renderer.tileentity.TileEntityGraveRenderer; +import openblocks.client.renderer.tileentity.TileEntityImaginaryRenderer; +import openblocks.client.renderer.tileentity.TileEntityPaintMixerRenderer; +import openblocks.client.renderer.tileentity.TileEntityProjectorRenderer; +import openblocks.client.renderer.tileentity.TileEntitySkyRenderer; +import openblocks.client.renderer.tileentity.TileEntityTankRenderer; +import openblocks.client.renderer.tileentity.TileEntityTrophyRenderer; +import openblocks.client.renderer.tileentity.TileEntityVillageHighlighterRenderer; +import openblocks.client.renderer.tileentity.guide.TileEntityBuilderGuideRenderer; +import openblocks.client.renderer.tileentity.guide.TileEntityGuideRenderer; import openblocks.common.TrophyHandler.Trophy; -import openblocks.common.entity.*; -import openblocks.common.tileentity.*; +import openblocks.common.entity.EntityCartographer; +import openblocks.common.entity.EntityGoldenEye; +import openblocks.common.entity.EntityHangGlider; +import openblocks.common.entity.EntityLuggage; +import openblocks.common.entity.EntityMagnet; +import openblocks.common.entity.EntityMiniMe; +import openblocks.common.tileentity.TileEntityAutoAnvil; +import openblocks.common.tileentity.TileEntityAutoEnchantmentTable; +import openblocks.common.tileentity.TileEntityBearTrap; +import openblocks.common.tileentity.TileEntityBuilderGuide; +import openblocks.common.tileentity.TileEntityCannon; +import openblocks.common.tileentity.TileEntityDonationStation; +import openblocks.common.tileentity.TileEntityFan; +import openblocks.common.tileentity.TileEntityFlag; +import openblocks.common.tileentity.TileEntityGoldenEgg; +import openblocks.common.tileentity.TileEntityGrave; +import openblocks.common.tileentity.TileEntityGuide; +import openblocks.common.tileentity.TileEntityImaginary; +import openblocks.common.tileentity.TileEntityPaintMixer; +import openblocks.common.tileentity.TileEntityProjector; +import openblocks.common.tileentity.TileEntitySky; +import openblocks.common.tileentity.TileEntitySprinkler; +import openblocks.common.tileentity.TileEntityTank; +import openblocks.common.tileentity.TileEntityTarget; +import openblocks.common.tileentity.TileEntityTrophy; +import openblocks.common.tileentity.TileEntityVacuumHopper; +import openblocks.common.tileentity.TileEntityVillageHighlighter; +import openblocks.common.tileentity.TileEntityXPShower; import openblocks.enchantments.flimflams.LoreFlimFlam; import openmods.config.game.RegisterBlock; import openmods.entity.EntityBlock; @@ -37,8 +90,6 @@ import openmods.entity.renderer.EntityBlockRenderer; import openmods.renderer.SimpleModelTileEntityRenderer; import openmods.utils.render.MarkerClassGenerator; -import com.google.common.base.Throwables; - public class ClientProxy implements IOpenBlocksProxy { public ClientProxy() {} @@ -47,7 +98,7 @@ public class ClientProxy implements IOpenBlocksProxy { public void preInit() { new KeyInputHandler().setup(); - if (Config.flimFlamEnchantmentId > 0) { + if (Config.flimFlamEnchantmentEnabled) { MinecraftForge.EVENT_BUS.register(new LoreFlimFlam.DisplayHandler()); } @@ -195,12 +246,13 @@ public class ClientProxy implements IOpenBlocksProxy { @SuppressWarnings("deprecation") private static void tempHackRegisterTesrItemRenderers() { + // TODO kill it with fire! for (Field f : OpenBlocks.Blocks.class.getFields()) { RegisterBlock ann = f.getAnnotation(RegisterBlock.class); if (ann.tileEntity() != null) { try { Block block = (Block)f.get(null); - if (block.getRenderType() == 2) { + if (block.getDefaultState().getRenderType() == EnumBlockRenderType.ENTITYBLOCK_ANIMATED) { Item item = Item.getItemFromBlock(block); ForgeHooksClient.registerTESRItemStack(item, 0, ann.tileEntity()); } @@ -211,12 +263,17 @@ public class ClientProxy implements IOpenBlocksProxy { } } - private static void spawnParticle(EntityFX spray) { + @Override + public int getParticleSettings() { + return Minecraft.getMinecraft().gameSettings.particleSetting; + } + + private static void spawnParticle(Particle spray) { Minecraft.getMinecraft().effectRenderer.addEffect(spray); } @Override - public void spawnLiquidSpray(World worldObj, FluidStack fluid, double x, double y, double z, float scale, float gravity, Vec3 velocity) { + public void spawnLiquidSpray(World worldObj, FluidStack fluid, double x, double y, double z, float scale, float gravity, Vec3d velocity) { spawnParticle(new FXLiquidSpray(worldObj, fluid, x, y, z, scale, gravity, velocity)); } } diff --git a/src/main/java/openblocks/client/GliderPlayerRenderHandler.java b/src/main/java/openblocks/client/GliderPlayerRenderHandler.java index 3c4ef010..8b58763b 100644 --- a/src/main/java/openblocks/client/GliderPlayerRenderHandler.java +++ b/src/main/java/openblocks/client/GliderPlayerRenderHandler.java @@ -4,7 +4,6 @@ import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import openblocks.common.entity.EntityHangGlider; import openmods.renderer.PlayerBodyRenderEvent; - import org.lwjgl.opengl.GL11; public class GliderPlayerRenderHandler { @@ -12,7 +11,7 @@ public class GliderPlayerRenderHandler { @SubscribeEvent public void onPlayerBodyRender(PlayerBodyRenderEvent evt) { final AbstractClientPlayer player = evt.player; - if (!EntityHangGlider.isGliderDeployed(player)) { + if (EntityHangGlider.isGliderDeployed(player)) { player.limbSwing = 0f; player.prevLimbSwingAmount = 0f; player.limbSwingAmount = 0f; diff --git a/src/main/java/openblocks/client/Icons.java b/src/main/java/openblocks/client/Icons.java index 78eb673e..7af6eccc 100644 --- a/src/main/java/openblocks/client/Icons.java +++ b/src/main/java/openblocks/client/Icons.java @@ -1,22 +1,20 @@ package openblocks.client; +import com.google.common.base.Preconditions; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; import openmods.colors.RGB; - import org.lwjgl.opengl.GL11; -import com.google.common.base.Preconditions; - public class Icons { - private static void addVertexWithUV(WorldRenderer wr, double x, double y, double u, double v) { + private static void addVertexWithUV(VertexBuffer wr, double x, double y, double u, double v) { wr.pos(x, y, 0).tex(u, v).endVertex(); } @@ -49,7 +47,7 @@ public class Icons { Preconditions.checkNotNull(icon); GlStateManager.color(r, g, b, MathHelper.floor_double(255 * alpha)); final Tessellator tes = Tessellator.getInstance(); - final WorldRenderer wr = tes.getWorldRenderer(); + final VertexBuffer wr = tes.getBuffer(); wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); addVertexWithUV(wr, scale, scale, icon.getMinU(), icon.getMinV()); addVertexWithUV(wr, scale, -scale, icon.getMinU(), icon.getMaxV()); diff --git a/src/main/java/openblocks/client/ModGuiFactory.java b/src/main/java/openblocks/client/ModGuiFactory.java index a0170b7a..d480f31f 100644 --- a/src/main/java/openblocks/client/ModGuiFactory.java +++ b/src/main/java/openblocks/client/ModGuiFactory.java @@ -1,15 +1,13 @@ package openblocks.client; +import com.google.common.collect.ImmutableSet; import java.util.Set; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.fml.client.IModGuiFactory; import openblocks.OpenBlocks; import openmods.config.gui.OpenModsConfigScreen; -import com.google.common.collect.ImmutableSet; - public class ModGuiFactory implements IModGuiFactory { public static class ConfigScreen extends OpenModsConfigScreen { @@ -32,6 +30,7 @@ public class ModGuiFactory implements IModGuiFactory { } @Override + @Deprecated public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { return null; } diff --git a/src/main/java/openblocks/client/SleepingBagRenderHandler.java b/src/main/java/openblocks/client/SleepingBagRenderHandler.java index 2c92a0cf..dd2310cf 100644 --- a/src/main/java/openblocks/client/SleepingBagRenderHandler.java +++ b/src/main/java/openblocks/client/SleepingBagRenderHandler.java @@ -10,10 +10,10 @@ public class SleepingBagRenderHandler { @SubscribeEvent public void onPrePlayerRender(RenderPlayerEvent.Pre event) { - final EntityPlayer entityPlayer = event.entityPlayer; + final EntityPlayer entityPlayer = event.getEntityPlayer(); if (entityPlayer instanceof EntityOtherPlayerMP) { if (entityPlayer.isPlayerSleeping() && ItemSleepingBag.isWearingSleepingBag(entityPlayer)) { - event.entityPlayer.renderOffsetY = 1.7f; + entityPlayer.renderOffsetY = 1.7f; } } diff --git a/src/main/java/openblocks/client/SoundEventsManager.java b/src/main/java/openblocks/client/SoundEventsManager.java index 73ebbf6c..8497e487 100644 --- a/src/main/java/openblocks/client/SoundEventsManager.java +++ b/src/main/java/openblocks/client/SoundEventsManager.java @@ -1,8 +1,8 @@ package openblocks.client; +import com.google.common.collect.Lists; import java.util.Iterator; import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.SoundHandler; @@ -11,11 +11,12 @@ import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import openblocks.Config; import openblocks.client.Icons.IDrawableIcon; @@ -24,11 +25,8 @@ import openmods.config.properties.ConfigurationChange; import openmods.renderer.ManualDisplayList; import openmods.renderer.ManualDisplayList.Renderer; import openmods.utils.render.RenderUtils; - import org.lwjgl.opengl.GL11; -import com.google.common.collect.Lists; - public class SoundEventsManager { private SoundEventsManager() {} @@ -94,10 +92,10 @@ public class SoundEventsManager { return isEntityWearingGlasses(e); } - @SubscribeEvent + @SubscribeEvent(priority = EventPriority.LOWEST) public void onSoundEvent(PlaySoundEvent evt) { if (SoundEventsManager.isPlayerWearingGlasses()) { - final ISound sound = evt.sound; + final ISound sound = evt.getResultSound(); final IDrawableIcon icon = icons.getIcon(sound.getSoundLocation()); synchronized (events) { @@ -217,9 +215,10 @@ public class SoundEventsManager { GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); dimWorld(tex, mc); - final double interpX = rve.prevPosX + (rve.posX - rve.prevPosX) * evt.partialTicks; - final double interpY = rve.prevPosY + (rve.posY - rve.prevPosY) * evt.partialTicks; - final double interpZ = rve.prevPosZ + (rve.posZ - rve.prevPosZ) * evt.partialTicks; + final float partialTicks = evt.getPartialTicks(); + final double interpX = rve.prevPosX + (rve.posX - rve.prevPosX) * partialTicks; + final double interpY = rve.prevPosY + (rve.posY - rve.prevPosY) * partialTicks; + final double interpZ = rve.prevPosZ + (rve.posZ - rve.prevPosZ) * partialTicks; GlStateManager.disableLighting(); GlStateManager.enableBlend(); @@ -233,7 +232,7 @@ public class SoundEventsManager { GL11.glPushMatrix(); GL11.glTranslated(px, py, pz); RenderUtils.setupBillboard(rve); - snd.icon.draw(snd.getAlpha(evt.partialTicks), snd.size); + snd.icon.draw(snd.getAlpha(partialTicks), snd.size); GL11.glPopMatrix(); } } diff --git a/src/main/java/openblocks/client/SoundIconRegistry.java b/src/main/java/openblocks/client/SoundIconRegistry.java index 5c048e1a..cad05674 100644 --- a/src/main/java/openblocks/client/SoundIconRegistry.java +++ b/src/main/java/openblocks/client/SoundIconRegistry.java @@ -2,10 +2,12 @@ package openblocks.client; import static openblocks.client.Icons.createIcon; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import com.google.common.collect.Maps; import java.util.Iterator; import java.util.Map; import java.util.NoSuchElementException; - import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList.EntityEggInfo; @@ -17,10 +19,6 @@ import openblocks.client.Icons.ComposedIcon; import openblocks.client.Icons.IDrawableIcon; import openmods.Log; -import com.google.common.base.Preconditions; -import com.google.common.base.Splitter; -import com.google.common.collect.Maps; - public class SoundIconRegistry { private static ResourceLocation ob(String id) { @@ -160,7 +158,7 @@ public class SoundIconRegistry { } public void addMob(String soundId, int mobId, boolean isHostile) { - EntityEggInfo mobInfo = EntityList.entityEggs.get(mobId); + EntityEggInfo mobInfo = EntityList.ENTITY_EGGS.get(mobId); if (mobInfo != null) mobs.put(soundId, createMobIcons(isHostile? "mob_hostile" : "mob_friendly", mobInfo.primaryColor, mobInfo.secondaryColor)); else mobs.put(soundId, unknownMob); @@ -201,12 +199,13 @@ public class SoundIconRegistry { @SubscribeEvent public void registerIcons(TextureStitchEvent evt) { - genericIcon.registerIcons(evt.map); - unknownIcon.registerIcons(evt.map); - defaultRoot.registerIcons(evt.map); + final TextureMap map = evt.getMap(); + genericIcon.registerIcons(map); + unknownIcon.registerIcons(map); + defaultRoot.registerIcons(map); for (MappedCategory category : roots.values()) - category.registerIcons(evt.map); + category.registerIcons(map); } private IDrawableIcon findIcon(ResourceLocation sound) { diff --git a/src/main/java/openblocks/client/StencilSkyRenderer.java b/src/main/java/openblocks/client/StencilSkyRenderer.java index 942a6e0c..e702901a 100644 --- a/src/main/java/openblocks/client/StencilSkyRenderer.java +++ b/src/main/java/openblocks/client/StencilSkyRenderer.java @@ -1,7 +1,6 @@ package openblocks.client; import java.lang.reflect.Method; - import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.GlStateManager; @@ -9,7 +8,6 @@ import net.minecraft.client.renderer.RenderGlobal; import net.minecraftforge.fml.relauncher.ReflectionHelper; import openmods.Log; import openmods.renderer.StencilRendererHandler; - import org.apache.commons.lang3.ArrayUtils; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/openblocks/client/bindings/KeyInputHandler.java b/src/main/java/openblocks/client/bindings/KeyInputHandler.java index 93a1dd5a..54b01f2d 100644 --- a/src/main/java/openblocks/client/bindings/KeyInputHandler.java +++ b/src/main/java/openblocks/client/bindings/KeyInputHandler.java @@ -7,21 +7,37 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import openblocks.Config; +import openblocks.common.Vario; import openblocks.events.PlayerActionEvent; - import org.lwjgl.input.Keyboard; public class KeyInputHandler { private KeyBinding brickBinding; + private KeyBinding varioSwitchBinding; + private KeyBinding varioVolUpBinding; + private KeyBinding varioVolDownBinding; private boolean brickKeyPressed; + private boolean varioSwitchKeyPressed; + private boolean varioVolUpKeyPressed; + private boolean varioVolDownKeyPressed; public void setup() { if (!Config.soSerious) { brickBinding = new KeyBinding("openblocks.keybind.drop_brick", Keyboard.KEY_B, "openblocks.keybind.category"); ClientRegistry.registerKeyBinding(brickBinding); } + + if (Config.hanggliderEnableThermal) { + varioSwitchBinding = new KeyBinding("openblocks.keybind.vario_switch", Keyboard.KEY_V, "openblocks.keybind.category"); + varioVolUpBinding = new KeyBinding("openblocks.keybind.vario_vol_up", Keyboard.KEY_NONE, "openblocks.keybind.category"); + varioVolDownBinding = new KeyBinding("openblocks.keybind.vario_vol_down", Keyboard.KEY_NONE, "openblocks.keybind.category"); + ClientRegistry.registerKeyBinding(varioSwitchBinding); + ClientRegistry.registerKeyBinding(varioVolUpBinding); + ClientRegistry.registerKeyBinding(varioVolDownBinding); + } + MinecraftForge.EVENT_BUS.register(this); } @@ -37,6 +53,24 @@ public class KeyInputHandler { brickKeyPressed = true; } } else brickKeyPressed = false; + if (varioSwitchBinding != null && varioSwitchBinding.isPressed()) { + if (!varioSwitchKeyPressed) { + Vario.instance.toggle(); + varioSwitchKeyPressed = true; + } + } else varioSwitchKeyPressed = false; + if (varioVolUpBinding != null && varioVolUpBinding.isPressed()) { + if (!varioVolUpKeyPressed) { + Vario.instance.incVolume(); + varioVolUpKeyPressed = true; + } + } else varioVolUpKeyPressed = false; + if (varioVolDownBinding != null && varioVolDownBinding.isPressed()) { + if (!varioVolDownKeyPressed) { + Vario.instance.decVolume(); + varioVolDownKeyPressed = true; + } + } else varioVolDownKeyPressed = false; } } diff --git a/src/main/java/openblocks/client/fx/FXLiquidSpray.java b/src/main/java/openblocks/client/fx/FXLiquidSpray.java index 59359df2..c2145a6c 100644 --- a/src/main/java/openblocks/client/fx/FXLiquidSpray.java +++ b/src/main/java/openblocks/client/fx/FXLiquidSpray.java @@ -1,40 +1,36 @@ package openblocks.client.fx; -import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.Particle; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import openmods.utils.TextureUtils; -public class FXLiquidSpray extends EntityFX { +public class FXLiquidSpray extends Particle { - public FXLiquidSpray(World world, FluidStack fluid, double x, double y, double z, float scale, float gravity, Vec3 velocity) { + public FXLiquidSpray(World world, FluidStack fluid, double x, double y, double z, float scale, float gravity, Vec3d velocity) { this(world, TextureUtils.getFluidTexture(fluid), x, y, z, scale, gravity, velocity); } - public FXLiquidSpray(World world, Fluid fluid, double x, double y, double z, float scale, float gravity, Vec3 velocity) { + public FXLiquidSpray(World world, Fluid fluid, double x, double y, double z, float scale, float gravity, Vec3d velocity) { this(world, TextureUtils.getFluidTexture(fluid), x, y, z, scale, gravity, velocity); } - public FXLiquidSpray(World world, TextureAtlasSprite icon, double x, double y, double z, float scale, float gravity, Vec3 velocity) { - super(world, x, y, z, 0, 0, 0); - - this.lastTickPosX = this.prevPosX = this.posX = x; - this.lastTickPosY = this.prevPosY = this.posY = y; - this.lastTickPosZ = this.prevPosZ = this.posZ = z; + public FXLiquidSpray(World world, TextureAtlasSprite icon, double x, double y, double z, float scale, float gravity, Vec3d velocity) { + super(world, x, y, z, velocity.xCoord, velocity.yCoord, velocity.zCoord); particleGravity = gravity; this.particleMaxAge = 50; setSize(0.2f, 0.2f); this.particleScale = scale; - this.noClip = false; + this.canCollide = true; motionX = velocity.xCoord; motionY = velocity.yCoord; motionZ = velocity.zCoord; - setParticleIcon(icon); + setParticleTexture(icon); } @Override diff --git a/src/main/java/openblocks/client/gui/ChangelogPage.java b/src/main/java/openblocks/client/gui/ChangelogPage.java index 76d19297..c9d74106 100644 --- a/src/main/java/openblocks/client/gui/ChangelogPage.java +++ b/src/main/java/openblocks/client/gui/ChangelogPage.java @@ -1,15 +1,17 @@ package openblocks.client.gui; -import java.util.List; - -import net.minecraft.util.StatCollector; -import openmods.gui.component.*; -import openmods.gui.component.page.BookScaleConfig; -import openmods.gui.component.page.PageBase; - import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.collect.Iterables; +import java.util.List; +import openmods.gui.component.EmptyComposite; +import openmods.gui.component.GuiComponentBook; +import openmods.gui.component.GuiComponentHBox; +import openmods.gui.component.GuiComponentHCenter; +import openmods.gui.component.GuiComponentLabel; +import openmods.gui.component.page.BookScaleConfig; +import openmods.gui.component.page.PageBase; +import openmods.utils.TranslationUtils; public class ChangelogPage extends PageBase { @@ -29,7 +31,7 @@ public class ChangelogPage extends PageBase { final float scaleContent = BookScaleConfig.getPageContentScale(); final int lineSpace = BookScaleConfig.getTitlePageSeparator(); - section = StatCollector.translateToLocal(section); + section = TranslationUtils.translateToLocal(section); final GuiComponentLabel currentVersionLabel = new GuiComponentLabel(0, 0, section).setScale(scaleTitle); addComponent(new GuiComponentHCenter(0, 24, getWidth()).addComponent(currentVersionLabel)); diff --git a/src/main/java/openblocks/client/gui/GuiAutoAnvil.java b/src/main/java/openblocks/client/gui/GuiAutoAnvil.java index b4a75609..db397d61 100644 --- a/src/main/java/openblocks/client/gui/GuiAutoAnvil.java +++ b/src/main/java/openblocks/client/gui/GuiAutoAnvil.java @@ -1,18 +1,21 @@ package openblocks.client.gui; -import net.minecraft.enchantment.Enchantment; +import com.google.common.collect.ImmutableList; +import net.minecraft.init.Enchantments; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import openblocks.common.container.ContainerAutoAnvil; import openblocks.common.tileentity.TileEntityAutoAnvil; import openblocks.common.tileentity.TileEntityAutoAnvil.AutoSlots; import openmods.gui.GuiConfigurableSlots; -import openmods.gui.component.*; +import openmods.gui.component.BaseComposite; +import openmods.gui.component.GuiComponentLabel; +import openmods.gui.component.GuiComponentSprite; +import openmods.gui.component.GuiComponentTab; +import openmods.gui.component.GuiComponentTankLevel; import openmods.gui.logic.ValueCopyAction; import openmods.utils.MiscUtils; - -import com.google.common.collect.ImmutableList; +import openmods.utils.TranslationUtils; public class GuiAutoAnvil extends GuiConfigurableSlots { @@ -41,16 +44,16 @@ public class GuiAutoAnvil extends GuiConfigurableSlots { @@ -49,7 +52,7 @@ public class GuiAutoEnchantmentTable extends GuiConfigurableSlots() { @Override public void setValue(Integer value) { - maxLevel.setText(StatCollector.translateToLocalFormatted("openblocks.gui.max_level", value)); + maxLevel.setText(TranslationUtils.translateToLocalFormatted("openblocks.gui.max_level", value)); } })); root.addComponent(maxLevel); @@ -63,14 +66,14 @@ public class GuiAutoEnchantmentTable extends GuiConfigurableSlots { private final int PROMPT_REPLY_ACTION = 0; diff --git a/src/main/java/openblocks/client/gui/GuiDrawingTable.java b/src/main/java/openblocks/client/gui/GuiDrawingTable.java index ec226ed2..78daaec3 100644 --- a/src/main/java/openblocks/client/gui/GuiDrawingTable.java +++ b/src/main/java/openblocks/client/gui/GuiDrawingTable.java @@ -9,7 +9,10 @@ import openblocks.common.container.ContainerDrawingTable; import openblocks.rpc.IStencilCrafter; import openmods.gui.BaseGuiContainer; import openmods.gui.Icon; -import openmods.gui.component.*; +import openmods.gui.component.BaseComponent; +import openmods.gui.component.GuiComponentIconButton; +import openmods.gui.component.GuiComponentSprite; +import openmods.gui.component.GuiComponentTextButton; import openmods.gui.listener.IMouseDownListener; public class GuiDrawingTable extends BaseGuiContainer { @@ -58,10 +61,11 @@ public class GuiDrawingTable extends BaseGuiContainer { }); root.addComponent(buttonDraw); + (iconDisplay = new GuiComponentSprite(80, 34) .setColor(0f, 0f, 0f)) - .setOverlayMode(true) - .setEnabled(inventorySlots.getSlot(0).getStack() != null); + .setOverlayMode(true) + .setEnabled(inventorySlots.getSlot(0).getStack() != null); root.addComponent(iconDisplay); root.addComponent(buttonLeft); root.addComponent(buttonRight); diff --git a/src/main/java/openblocks/client/gui/GuiInfoBook.java b/src/main/java/openblocks/client/gui/GuiInfoBook.java index 28d8f699..c86ef45c 100644 --- a/src/main/java/openblocks/client/gui/GuiInfoBook.java +++ b/src/main/java/openblocks/client/gui/GuiInfoBook.java @@ -1,13 +1,13 @@ package openblocks.client.gui; +import com.google.common.collect.Lists; import java.io.File; import java.io.IOException; import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.server.MinecraftServer; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.fml.common.FMLCommonHandler; import openblocks.OpenBlocks; import openblocks.client.ChangelogBuilder; import openblocks.client.ChangelogBuilder.Changelog; @@ -19,15 +19,13 @@ import openmods.gui.ComponentGui; import openmods.gui.DummyContainer; import openmods.gui.component.BaseComposite; import openmods.gui.component.GuiComponentBook; -import openmods.gui.component.GuiComponentLabel; -import openmods.gui.component.page.*; +import openmods.gui.component.page.PageBase; import openmods.gui.component.page.PageBase.ActionIcon; +import openmods.gui.component.page.SectionPage; +import openmods.gui.component.page.TitledPage; import openmods.infobook.PageBuilder; - import org.lwjgl.input.Keyboard; -import com.google.common.collect.Lists; - public class GuiInfoBook extends ComponentGui { private GuiComponentBook book; @@ -36,10 +34,6 @@ public class GuiInfoBook extends ComponentGui { super(new DummyContainer(), 0, 0); } - private static void setupBookmark(GuiComponentLabel label, GuiComponentBook book, int index) { - label.setListener(book.createBookmarkListener(index)); - } - private static final PageBase blankPage = new PageBase() {}; @Override @@ -60,12 +54,6 @@ public class GuiInfoBook extends ComponentGui { return index; } - private static int tocLine(int index) { - final int tocStartHeight = 70; - final int tocLineHeight = 15; - return tocStartHeight + index * tocLineHeight; - } - @Override public void handleKeyboardInput() throws IOException { super.handleKeyboardInput(); @@ -92,30 +80,15 @@ public class GuiInfoBook extends ComponentGui { protected BaseComposite createRoot() { book = new GuiComponentBook(); - PageBase contentsPage = new TitledPage("openblocks.gui.welcome.title", "openblocks.gui.welcome.content"); - - GuiComponentLabel lblBlocks = new GuiComponentLabel(27, tocLine(0), "- " + StatCollector.translateToLocal("openblocks.gui.blocks")); - contentsPage.addComponent(lblBlocks); - - GuiComponentLabel lblItems = new GuiComponentLabel(27, tocLine(1), "- " + StatCollector.translateToLocal("openblocks.gui.items")); - contentsPage.addComponent(lblItems); - - GuiComponentLabel lblMisc = new GuiComponentLabel(27, tocLine(2), "- " + StatCollector.translateToLocal("openblocks.gui.misc")); - contentsPage.addComponent(lblMisc); - - GuiComponentLabel lblChangelogs = new GuiComponentLabel(27, tocLine(3), "- " + StatCollector.translateToLocal("openblocks.gui.changelogs")); - contentsPage.addComponent(lblChangelogs); - book.addPage(blankPage); book.addPage(new IntroPage()); book.addPage(new TitledPage("openblocks.gui.credits.title", "openblocks.gui.credits.content")); + + final TocPage contentsPage = new TocPage(book, Minecraft.getMinecraft().fontRendererObj); book.addPage(contentsPage); { - int blocksIndex = alignToEven(book); - setupBookmark(lblBlocks, book, blocksIndex); - book.addPage(blankPage); - book.addPage(new SectionPage("openblocks.gui.blocks")); + addSectionPage(book, contentsPage, "openblocks.gui.blocks"); PageBuilder builder = new PageBuilder(); builder.includeModId(OpenBlocks.MODID); @@ -126,10 +99,7 @@ public class GuiInfoBook extends ComponentGui { } { - int itemsIndex = alignToEven(book); - setupBookmark(lblItems, book, itemsIndex); - book.addPage(blankPage); - book.addPage(new SectionPage("openblocks.gui.items")); + addSectionPage(book, contentsPage, "openblocks.gui.items"); PageBuilder builder = new PageBuilder(); builder.includeModId(OpenBlocks.MODID); @@ -140,10 +110,8 @@ public class GuiInfoBook extends ComponentGui { } { - int miscIndex = alignToEven(book); - setupBookmark(lblMisc, book, miscIndex); - book.addPage(blankPage); - book.addPage(new SectionPage("openblocks.gui.misc")); + addSectionPage(book, contentsPage, "openblocks.gui.misc"); + book.addPage(new TitledPage("openblocks.gui.config.title", "openblocks.gui.config.content")); book.addPage(new TitledPage("openblocks.gui.restore_inv.title", "openblocks.gui.restore_inv.content") .addActionButton(10, 133, getSavePath(), ActionIcon.FOLDER.icon, "openblocks.gui.save_folder")); @@ -155,12 +123,10 @@ public class GuiInfoBook extends ComponentGui { } - int changelogsIndex = alignToEven(book); - book.addPage(blankPage); - setupBookmark(lblChangelogs, book, changelogsIndex); - book.addPage(new SectionPage("openblocks.gui.changelogs")); - - createChangelogPages(book); + { + addSectionPage(book, contentsPage, "openblocks.gui.changelogs"); + createChangelogPages(book); + } book.enablePages(); @@ -170,9 +136,17 @@ public class GuiInfoBook extends ComponentGui { return book; } + private static void addSectionPage(GuiComponentBook book, TocPage contentsPage, String sectionLabel) { + final int startIndex = alignToEven(book); + + book.addPage(blankPage); + book.addPage(new SectionPage(sectionLabel)); + contentsPage.addTocEntry(sectionLabel, startIndex, startIndex + 2); + } + private static File getSavePath() { try { - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); if (server != null) { World world = server.worldServerForDimension(0); diff --git a/src/main/java/openblocks/client/gui/GuiLuggage.java b/src/main/java/openblocks/client/gui/GuiLuggage.java index 89de3343..24f3be17 100644 --- a/src/main/java/openblocks/client/gui/GuiLuggage.java +++ b/src/main/java/openblocks/client/gui/GuiLuggage.java @@ -1,11 +1,10 @@ package openblocks.client.gui; +import com.google.common.base.Strings; import openblocks.common.container.ContainerLuggage; import openblocks.common.entity.EntityLuggage; import openmods.gui.BaseGuiContainer; -import com.google.common.base.Strings; - public class GuiLuggage extends BaseGuiContainer { private static String getInventoryName(EntityLuggage owner) { diff --git a/src/main/java/openblocks/client/gui/GuiPaintMixer.java b/src/main/java/openblocks/client/gui/GuiPaintMixer.java index 0a132669..e77c0234 100644 --- a/src/main/java/openblocks/client/gui/GuiPaintMixer.java +++ b/src/main/java/openblocks/client/gui/GuiPaintMixer.java @@ -1,8 +1,8 @@ package openblocks.client.gui; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; import java.util.List; - -import net.minecraft.util.StatCollector; import openblocks.common.container.ContainerPaintMixer; import openblocks.common.tileentity.TileEntityPaintMixer; import openblocks.common.tileentity.TileEntityPaintMixer.DyeSlot; @@ -10,15 +10,21 @@ import openblocks.rpc.IColorChanger; import openmods.api.IValueProvider; import openmods.colors.ColorMeta; import openmods.gui.SyncedGuiContainer; -import openmods.gui.component.*; +import openmods.gui.component.BaseComponent; +import openmods.gui.component.GuiComponentColorPicker; +import openmods.gui.component.GuiComponentLevel; +import openmods.gui.component.GuiComponentPalettePicker; import openmods.gui.component.GuiComponentPalettePicker.PaletteEntry; +import openmods.gui.component.GuiComponentProgress; +import openmods.gui.component.GuiComponentRect; +import openmods.gui.component.GuiComponentSlider; +import openmods.gui.component.GuiComponentTextButton; +import openmods.gui.component.GuiComponentTextbox; import openmods.gui.listener.IMouseDownListener; import openmods.gui.listener.IValueChangedListener; import openmods.gui.logic.IValueUpdateAction; import openmods.gui.logic.ValueCopyAction; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; +import openmods.utils.TranslationUtils; public class GuiPaintMixer extends SyncedGuiContainer { @@ -102,7 +108,7 @@ public class GuiPaintMixer extends SyncedGuiContainer { { final List vanillaPalette = Lists.newArrayList(); for (ColorMeta color : ColorMeta.getAllColors()) { - vanillaPalette.add(new PaletteEntry(color.vanillaBlockId, color.rgb, StatCollector.translateToLocal(color.unlocalizedName))); + vanillaPalette.add(new PaletteEntry(color.vanillaBlockId, color.rgb, TranslationUtils.translateToLocal(color.unlocalizedName))); } palettePicker.setPalette(vanillaPalette); } diff --git a/src/main/java/openblocks/client/gui/GuiProjector.java b/src/main/java/openblocks/client/gui/GuiProjector.java index 538ee846..08cb4998 100644 --- a/src/main/java/openblocks/client/gui/GuiProjector.java +++ b/src/main/java/openblocks/client/gui/GuiProjector.java @@ -12,11 +12,13 @@ import openblocks.common.container.ContainerProjector; import openblocks.rpc.IRotatable; import openmods.gui.BaseGuiContainer; import openmods.gui.Icon; -import openmods.gui.component.*; +import openmods.gui.component.BaseComponent; +import openmods.gui.component.BaseComposite; +import openmods.gui.component.EmptyComposite; +import openmods.gui.component.GuiComponentIconButton; import openmods.gui.listener.IMouseDownListener; import openmods.gui.misc.Trackball.TrackballWrapper; import openmods.utils.MathUtils; - import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -61,7 +63,7 @@ public class GuiProjector extends BaseGuiContainer { @Override protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY) { - if (isInitialized == false || Mouse.isButtonDown(2)) { + if (!isInitialized || Mouse.isButtonDown(2)) { trackball.setTransform(MathUtils.createEntityRotateMatrix(Minecraft.getMinecraft().getRenderViewEntity())); isInitialized = true; } diff --git a/src/main/java/openblocks/client/gui/GuiVacuumHopper.java b/src/main/java/openblocks/client/gui/GuiVacuumHopper.java index 7436d294..2128923f 100644 --- a/src/main/java/openblocks/client/gui/GuiVacuumHopper.java +++ b/src/main/java/openblocks/client/gui/GuiVacuumHopper.java @@ -5,13 +5,18 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; -import net.minecraft.util.StatCollector; import openblocks.common.container.ContainerVacuumHopper; import openblocks.common.tileentity.TileEntityVacuumHopper; import openmods.gui.SyncedGuiContainer; -import openmods.gui.component.*; +import openmods.gui.component.BaseComposite; +import openmods.gui.component.GuiComponentLabel; +import openmods.gui.component.GuiComponentSideSelector; import openmods.gui.component.GuiComponentSideSelector.ISideSelectedListener; +import openmods.gui.component.GuiComponentTab; +import openmods.gui.component.GuiComponentTabWrapper; +import openmods.gui.component.GuiComponentTankLevel; import openmods.gui.logic.ValueCopyAction; +import openmods.utils.TranslationUtils; import openmods.utils.bitmap.IReadableBitMap; import openmods.utils.bitmap.IWriteableBitMap; @@ -33,21 +38,21 @@ public class GuiVacuumHopper extends SyncedGuiContainer { final IBlockState state = te.getWorld().getBlockState(te.getPos()); { - GuiComponentTab itemTab = new GuiComponentTab(StandardPalette.lightblue.getColor(), new ItemStack(Blocks.chest), 100, 100); + GuiComponentTab itemTab = new GuiComponentTab(StandardPalette.lightblue.getColor(), new ItemStack(Blocks.CHEST), 100, 100); final GuiComponentSideSelector sideSelector = new GuiComponentSideSelector(15, 15, 40.0, state, te, false); wireSideSelector(sideSelector, te.getReadableItemOutputs(), te.getWriteableItemOutputs()); - itemTab.addComponent(new GuiComponentLabel(24, 10, StatCollector.translateToLocal("openblocks.gui.item_outputs"))); + itemTab.addComponent(new GuiComponentLabel(24, 10, TranslationUtils.translateToLocal("openblocks.gui.item_outputs"))); itemTab.addComponent(sideSelector); tabs.addComponent(itemTab); } { - GuiComponentTab xpTab = new GuiComponentTab(StandardPalette.blue.getColor(), new ItemStack(Items.experience_bottle, 1), 100, 100); + GuiComponentTab xpTab = new GuiComponentTab(StandardPalette.blue.getColor(), new ItemStack(Items.EXPERIENCE_BOTTLE, 1), 100, 100); GuiComponentSideSelector sideSelector = new GuiComponentSideSelector(15, 15, 40.0, state, te, false); wireSideSelector(sideSelector, te.getReadableXpOutputs(), te.getWriteableXpOutputs()); xpTab.addComponent(sideSelector); - xpTab.addComponent(new GuiComponentLabel(24, 10, StatCollector.translateToLocal("openblocks.gui.xp_outputs"))); + xpTab.addComponent(new GuiComponentLabel(24, 10, TranslationUtils.translateToLocal("openblocks.gui.xp_outputs"))); tabs.addComponent(xpTab); } diff --git a/src/main/java/openblocks/client/gui/GuiXPBottler.java b/src/main/java/openblocks/client/gui/GuiXPBottler.java index d43c4017..11561618 100644 --- a/src/main/java/openblocks/client/gui/GuiXPBottler.java +++ b/src/main/java/openblocks/client/gui/GuiXPBottler.java @@ -1,17 +1,20 @@ package openblocks.client.gui; +import com.google.common.collect.ImmutableList; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import openblocks.common.container.ContainerXPBottler; import openblocks.common.tileentity.TileEntityXPBottler; import openblocks.common.tileentity.TileEntityXPBottler.AutoSlots; import openmods.gui.GuiConfigurableSlots; -import openmods.gui.component.*; +import openmods.gui.component.BaseComposite; +import openmods.gui.component.GuiComponentLabel; +import openmods.gui.component.GuiComponentProgress; +import openmods.gui.component.GuiComponentTab; +import openmods.gui.component.GuiComponentTankLevel; import openmods.gui.logic.ValueCopyAction; import openmods.utils.MiscUtils; - -import com.google.common.collect.ImmutableList; +import openmods.utils.TranslationUtils; public class GuiXPBottler extends GuiConfigurableSlots { @@ -40,11 +43,11 @@ public class GuiXPBottler extends GuiConfigurableSlots 0) { + paddedPageNumberBuilder.append('.'); + lineWidthBudget -= dotWidth; + } + + paddedPageNumberBuilder.append(' '); + paddedPageNumberBuilder.append(pageNumber); + + String paddedPageNumber = paddedPageNumberBuilder.toString(); + + final IMouseDownListener pageJumpListener = book.createBookmarkListener(pageIndex); + + { + final GuiComponentLabel label = new GuiComponentLabel(TOC_LINE_LEFT_MARGIN, tocLine(nextTocEntry), translatedLabel); + label.setListener(pageJumpListener); + addComponent(label); + } + + { + final int pos = TOC_LINE_LEFT_MARGIN + labelWidth + lineWidthBudget; + final GuiComponentLabel label = new GuiComponentLabel(pos, tocLine(nextTocEntry), paddedPageNumber); + label.setListener(pageJumpListener); + addComponent(label); + } + + nextTocEntry++; + } +} diff --git a/src/main/java/openblocks/client/model/ModelCartographer.java b/src/main/java/openblocks/client/model/ModelCartographer.java index 8dfe4355..1de143ec 100644 --- a/src/main/java/openblocks/client/model/ModelCartographer.java +++ b/src/main/java/openblocks/client/model/ModelCartographer.java @@ -4,7 +4,6 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraftforge.common.MinecraftForge; import openmods.renderer.DisplayListWrapper; - import org.lwjgl.opengl.GL11; public class ModelCartographer extends ModelBase { diff --git a/src/main/java/openblocks/client/model/ModelCraneBackpack.java b/src/main/java/openblocks/client/model/ModelCraneBackpack.java index 6d5cab42..c351cf47 100644 --- a/src/main/java/openblocks/client/model/ModelCraneBackpack.java +++ b/src/main/java/openblocks/client/model/ModelCraneBackpack.java @@ -9,8 +9,8 @@ import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.common.MinecraftForge; @@ -18,7 +18,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import openblocks.common.CraneRegistry; import openblocks.common.entity.EntityMagnet; import openblocks.common.item.ItemCraneBackpack; - import org.lwjgl.opengl.GL11; public class ModelCraneBackpack extends ModelBiped { @@ -87,7 +86,7 @@ public class ModelCraneBackpack extends ModelBiped { @SubscribeEvent public void renderLines(RenderPlayerEvent.Pre evt) { - final EntityPlayer player = evt.entityPlayer; + final EntityPlayer player = evt.getEntityPlayer(); if (!ItemCraneBackpack.isWearingCrane(player)) return; @@ -96,18 +95,19 @@ public class ModelCraneBackpack extends ModelBiped { if (magnet == null) return; // TODO 1.8.9 check values (maybe 0?) - double playerX = interpolatePos(player.posX, player.lastTickPosX, evt.partialRenderTick) + final float partialRenderTick = evt.getPartialRenderTick(); + double playerX = interpolatePos(player.posX, player.lastTickPosX, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerX; - double playerY = interpolatePos(player.posY, player.lastTickPosY, evt.partialRenderTick) + double playerY = interpolatePos(player.posY, player.lastTickPosY, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerY; - double playerZ = interpolatePos(player.posZ, player.lastTickPosZ, evt.partialRenderTick) + double playerZ = interpolatePos(player.posZ, player.lastTickPosZ, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerZ; // TODO 1.8.9 check eye height if (player instanceof EntityOtherPlayerMP) playerY += 1.62; - final float offset = interpolateAngle(player.renderYawOffset, player.prevRenderYawOffset, evt.partialRenderTick); - final float head = interpolateAngle(player.rotationYawHead, player.prevRotationYawHead, evt.partialRenderTick); + final float offset = interpolateAngle(player.renderYawOffset, player.prevRenderYawOffset, partialRenderTick); + final float head = interpolateAngle(player.rotationYawHead, player.prevRotationYawHead, partialRenderTick); double armX = playerX; double armY = playerY; @@ -128,9 +128,9 @@ public class ModelCraneBackpack extends ModelBiped { armX += armLength * MathHelper.cos(head); armZ += armLength * MathHelper.sin(head); - final double magnetX = interpolatePos(magnet.posX, magnet.lastTickPosX, evt.partialRenderTick) - TileEntityRendererDispatcher.staticPlayerX; - final double magnetY = interpolatePos(magnet.posY, magnet.lastTickPosY, evt.partialRenderTick) - TileEntityRendererDispatcher.staticPlayerY + magnet.height - 0.1; - final double magnetZ = interpolatePos(magnet.posZ, magnet.lastTickPosZ, evt.partialRenderTick) - TileEntityRendererDispatcher.staticPlayerZ; + final double magnetX = interpolatePos(magnet.posX, magnet.lastTickPosX, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerX; + final double magnetY = interpolatePos(magnet.posY, magnet.lastTickPosY, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerY + magnet.height - 0.1; + final double magnetZ = interpolatePos(magnet.posZ, magnet.lastTickPosZ, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerZ; GL11.glLineWidth(2); GlStateManager.disableTexture2D(); @@ -226,7 +226,7 @@ public class ModelCraneBackpack extends ModelBiped { if (!ItemCraneBackpack.isWearingCrane(player)) return; drawArm(evt, player); - drawLineFPP(player, evt.partialTicks); + drawLineFPP(player, evt.getPartialTicks()); } public void init() { diff --git a/src/main/java/openblocks/client/model/ModelLuggage.java b/src/main/java/openblocks/client/model/ModelLuggage.java index dcdd87b8..419807eb 100644 --- a/src/main/java/openblocks/client/model/ModelLuggage.java +++ b/src/main/java/openblocks/client/model/ModelLuggage.java @@ -3,7 +3,7 @@ package openblocks.client.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; public class ModelLuggage extends ModelBase { // fields diff --git a/src/main/java/openblocks/client/model/ModelMiniMe.java b/src/main/java/openblocks/client/model/ModelMiniMe.java index a5543fd1..b805e485 100644 --- a/src/main/java/openblocks/client/model/ModelMiniMe.java +++ b/src/main/java/openblocks/client/model/ModelMiniMe.java @@ -14,7 +14,7 @@ public class ModelMiniMe extends ModelBiped { public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity) { super.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); EntityMiniMe minime = (EntityMiniMe)entity; - if (minime.riddenByEntity != null) { + if (minime.isBeingRidden()) { this.bipedLeftArm.rotateAngleX = -3f; this.bipedRightArm.rotateAngleX = -3f; this.bipedLeftArm.rotateAngleZ = 0.3f; diff --git a/src/main/java/openblocks/client/model/ModelPaintMixer.java b/src/main/java/openblocks/client/model/ModelPaintMixer.java index 125adf66..6ec6dc2b 100644 --- a/src/main/java/openblocks/client/model/ModelPaintMixer.java +++ b/src/main/java/openblocks/client/model/ModelPaintMixer.java @@ -7,6 +7,7 @@ import openmods.renderer.ITileEntityModel; public class ModelPaintMixer extends ModelBase implements ITileEntityModel { + // fields ModelRenderer controls; ModelRenderer right; ModelRenderer left; @@ -15,8 +16,7 @@ public class ModelPaintMixer extends ModelBase implements ITileEntityModel -{ +public class ModelXPShower extends ModelBase implements ITileEntityModel { + ModelRenderer end; ModelRenderer main; diff --git a/src/main/java/openblocks/client/renderer/HeightMapRenderer.java b/src/main/java/openblocks/client/renderer/HeightMapRenderer.java index 6d58b333..dbe16151 100644 --- a/src/main/java/openblocks/client/renderer/HeightMapRenderer.java +++ b/src/main/java/openblocks/client/renderer/HeightMapRenderer.java @@ -1,25 +1,22 @@ package openblocks.client.renderer; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import java.util.List; import java.util.Map; - import net.minecraft.block.material.MapColor; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import openblocks.common.HeightMapData; import openmods.renderer.DynamicTextureAtlas; import openmods.renderer.DynamicTextureAtlas.AtlasCell; - import org.lwjgl.opengl.GL11; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - public class HeightMapRenderer { public static final HeightMapRenderer instance = new HeightMapRenderer(); @@ -76,7 +73,7 @@ public class HeightMapRenderer { // stupid singed bytes int height = layer.heightMap[index] & 0xFF; - int fullColor = MapColor.mapColorArray[color].colorValue; + int fullColor = MapColor.COLORS[color].colorValue; int[] plane = getPlane(levels, height); plane[index] = fullColor | (layer.alpha << 24); } @@ -119,7 +116,7 @@ public class HeightMapRenderer { GlStateManager.enableBlend(); final Tessellator tes = new Tessellator(4 * (3 + 2) * 4 * 2); - WorldRenderer wr = tes.getWorldRenderer(); + VertexBuffer wr = tes.getBuffer(); wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); for (PlaneData plane : planes) { diff --git a/src/main/java/openblocks/client/renderer/entity/EntityCartographerRenderer.java b/src/main/java/openblocks/client/renderer/entity/EntityCartographerRenderer.java index 62c4184c..d3054f86 100644 --- a/src/main/java/openblocks/client/renderer/entity/EntityCartographerRenderer.java +++ b/src/main/java/openblocks/client/renderer/entity/EntityCartographerRenderer.java @@ -1,7 +1,6 @@ package openblocks.client.renderer.entity; import java.util.Random; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; @@ -21,7 +20,6 @@ import openblocks.common.entity.EntityCartographer; import openblocks.common.entity.EntityCartographer.MapJobs; import openmods.renderer.DisplayListWrapper; import openmods.utils.render.RenderUtils; - import org.lwjgl.opengl.GL11; public class EntityCartographerRenderer extends Render { @@ -210,7 +208,7 @@ public class EntityCartographerRenderer extends Render { bindTexture(TEXTURE); MODEL.renderBase(cartographer.eyeYaw); - bindTexture(TextureMap.locationBlocksTexture); + bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); MODEL.renderEye(cartographer.eyeYaw, cartographer.eyePitch); cartographer.updateEye(); diff --git a/src/main/java/openblocks/client/renderer/entity/EntityHangGliderRenderer.java b/src/main/java/openblocks/client/renderer/entity/EntityHangGliderRenderer.java index bfbdf4a5..e3bc8d18 100644 --- a/src/main/java/openblocks/client/renderer/entity/EntityHangGliderRenderer.java +++ b/src/main/java/openblocks/client/renderer/entity/EntityHangGliderRenderer.java @@ -9,7 +9,6 @@ import net.minecraft.util.ResourceLocation; import openblocks.OpenBlocks; import openblocks.common.entity.EntityHangGlider; import openmods.renderer.DisplayListWrapper; - import org.lwjgl.opengl.GL11; public class EntityHangGliderRenderer extends Render { @@ -58,7 +57,7 @@ public class EntityHangGliderRenderer extends Render { final boolean isFpp = minecraft.gameSettings.thirdPersonView == 0; final boolean isDeployed = glider.isDeployed(); - if (isLocalPlayer && isFpp && isDeployed) return; + if (isLocalPlayer && isFpp && !isDeployed) return; final float rotation = interpolateRotation(glider.prevRotationYaw, glider.rotationYaw, f1); @@ -68,7 +67,7 @@ public class EntityHangGliderRenderer extends Render { GL11.glRotatef(180.0F - rotation, 0.0F, 1.0F, 0.0F); if (isLocalPlayer) { - if (isDeployed) { + if (!isDeployed) { // move up and closer to back GL11.glTranslated(0, -0.2, +0.3); } else { @@ -81,7 +80,7 @@ public class EntityHangGliderRenderer extends Render { } } } else { - if (isDeployed) { + if (!isDeployed) { // move up little bit (other player center is lower) GL11.glTranslated(0, +0.2, +0.3); } else { @@ -90,7 +89,7 @@ public class EntityHangGliderRenderer extends Render { } } - if (isDeployed) { + if (!isDeployed) { GL11.glRotatef(ONGROUND_ROTATION, 1, 0, 0); GL11.glScalef(0.4f, 1f, 0.4f); } diff --git a/src/main/java/openblocks/client/renderer/entity/EntityLuggageRenderer.java b/src/main/java/openblocks/client/renderer/entity/EntityLuggageRenderer.java old mode 100644 new mode 100755 index a12e6c7c..bdf1c4d7 --- a/src/main/java/openblocks/client/renderer/entity/EntityLuggageRenderer.java +++ b/src/main/java/openblocks/client/renderer/entity/EntityLuggageRenderer.java @@ -9,7 +9,6 @@ import net.minecraft.util.ResourceLocation; import openblocks.OpenBlocks; import openblocks.client.model.ModelLuggage; import openblocks.common.entity.EntityLuggage; - import org.lwjgl.opengl.GL11; public class EntityLuggageRenderer extends RenderLiving { @@ -20,15 +19,12 @@ public class EntityLuggageRenderer extends RenderLiving { private static final ResourceLocation textureSpecial = OpenBlocks.location("textures/models/luggage_special.png"); private static final ResourceLocation creeperEffect = new ResourceLocation("textures/entity/creeper/creeper_armor.png"); - private class LayerCharge implements LayerRenderer - { + private class LayerCharge implements LayerRenderer { // TODO 1.8.9 verify if it works @Override - public void doRenderLayer(EntityLuggage luggage, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) - { - if (luggage.isSpecial()) - { + public void doRenderLayer(EntityLuggage luggage, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) { + if (luggage.isSpecial()) { bindTexture(creeperEffect); GlStateManager.matrixMode(GL11.GL_TEXTURE); GlStateManager.loadIdentity(); diff --git a/src/main/java/openblocks/client/renderer/entity/EntityMagnetRenderer.java b/src/main/java/openblocks/client/renderer/entity/EntityMagnetRenderer.java index a01ad2ed..bec698c1 100644 --- a/src/main/java/openblocks/client/renderer/entity/EntityMagnetRenderer.java +++ b/src/main/java/openblocks/client/renderer/entity/EntityMagnetRenderer.java @@ -9,7 +9,6 @@ import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import openblocks.OpenBlocks; import openblocks.common.entity.EntityMagnet; - import org.lwjgl.opengl.GL11; public class EntityMagnetRenderer extends Render { diff --git a/src/main/java/openblocks/client/renderer/entity/EntitySelectionHandler.java b/src/main/java/openblocks/client/renderer/entity/EntitySelectionHandler.java index fc21fb11..e79e76cc 100644 --- a/src/main/java/openblocks/client/renderer/entity/EntitySelectionHandler.java +++ b/src/main/java/openblocks/client/renderer/entity/EntitySelectionHandler.java @@ -1,7 +1,7 @@ package openblocks.client.renderer.entity; +import com.google.common.collect.Maps; import java.util.Map; - import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderGlobal; import net.minecraft.entity.Entity; @@ -11,8 +11,6 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import com.google.common.collect.Maps; - public class EntitySelectionHandler { public interface ISelectAware {} @@ -43,7 +41,7 @@ public class EntitySelectionHandler { final Entity target = mc.objectMouseOver.entityHit; if (target instanceof ISelectAware) { ISelectionRenderer renderer = registry.get(mc.objectMouseOver.entityHit.getClass()); - if (renderer != null) renderer.render(target, mc.thePlayer, evt.context, evt.partialTicks); + if (renderer != null) renderer.render(target, mc.thePlayer, evt.getContext(), evt.getPartialTicks()); } } } diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntityAutoEnchantmentTableRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/TileEntityAutoEnchantmentTableRenderer.java index 973b0791..7f173d02 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntityAutoEnchantmentTableRenderer.java +++ b/src/main/java/openblocks/client/renderer/tileentity/TileEntityAutoEnchantmentTableRenderer.java @@ -4,10 +4,9 @@ import net.minecraft.client.model.ModelBook; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; import openblocks.common.tileentity.TileEntityAutoEnchantmentTable; - import org.lwjgl.opengl.GL11; public class TileEntityAutoEnchantmentTableRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntityCannonRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/TileEntityCannonRenderer.java index c6390270..8418088f 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntityCannonRenderer.java +++ b/src/main/java/openblocks/client/renderer/tileentity/TileEntityCannonRenderer.java @@ -5,13 +5,12 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import openblocks.OpenBlocks; import openblocks.client.model.ModelCannon; import openblocks.common.item.MetasGenericUnstackable; import openblocks.common.tileentity.TileEntityCannon; import openmods.OpenMods; - import org.lwjgl.opengl.GL11; public class TileEntityCannonRenderer extends TileEntitySpecialRenderer { @@ -40,7 +39,7 @@ public class TileEntityCannonRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntityFlagRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/TileEntityFlagRenderer.java index ae46a60c..a411e590 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntityFlagRenderer.java +++ b/src/main/java/openblocks/client/renderer/tileentity/TileEntityFlagRenderer.java @@ -2,7 +2,7 @@ package openblocks.client.renderer.tileentity; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.EnumFacing; @@ -12,7 +12,6 @@ import openblocks.common.block.BlockFlag; import openblocks.common.tileentity.TileEntityFlag; import openmods.colors.RGB; import openmods.renderer.DisplayListWrapper; - import org.lwjgl.opengl.GL11; public class TileEntityFlagRenderer extends TileEntitySpecialRenderer { @@ -23,7 +22,7 @@ public class TileEntityFlagRenderer extends TileEntitySpecialRenderer { @@ -94,7 +95,7 @@ public class TileEntityGoldenEggRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntityGuideRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/TileEntityGuideRenderer.java deleted file mode 100644 index 9774953d..00000000 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntityGuideRenderer.java +++ /dev/null @@ -1,45 +0,0 @@ -package openblocks.client.renderer.tileentity; - -import java.util.Collection; - -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.util.BlockPos; -import openblocks.common.tileentity.TileEntityGuide; -import openmods.utils.render.RenderUtils; - -import org.lwjgl.opengl.GL11; - -public class TileEntityGuideRenderer extends TileEntitySpecialRenderer { - - @Override - public void renderTileEntityAt(T guide, double x, double y, double z, float partialTicks, int destroyStage) { - GL11.glPushMatrix(); - GL11.glTranslated(x, y, z); - float scaleDelta = guide.getTimeSinceChange(); - renderShape(guide.getShape(), guide.getColor(), scaleDelta); - if (scaleDelta < 1.0) { - renderShape(guide.getPreviousShape(), guide.getColor(), 1.0f - scaleDelta); - } - GL11.glPopMatrix(); - } - - private void renderShape(Collection shape, int color, float scale) { - if (shape == null) return; - - RenderUtils.setColor(color); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - GlStateManager.disableLighting(); - - for (BlockPos coord : shape) - renderMarkerAt(coord, scale); - - GlStateManager.enableLighting(); - GlStateManager.disableBlend(); - } - - private void renderMarkerAt(BlockPos pos, float scale) { - // TODO 1.8.9 use actual models - } -} diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntityImaginaryRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/TileEntityImaginaryRenderer.java index 8e078928..d9101b90 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntityImaginaryRenderer.java +++ b/src/main/java/openblocks/client/renderer/tileentity/TileEntityImaginaryRenderer.java @@ -4,13 +4,12 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import openblocks.Config; -import openblocks.common.tileentity.*; +import openblocks.common.tileentity.TileEntityImaginary; import openblocks.common.tileentity.TileEntityImaginary.ICollisionData; import openblocks.common.tileentity.TileEntityImaginary.PanelData; import openblocks.common.tileentity.TileEntityImaginary.Property; import openblocks.common.tileentity.TileEntityImaginary.StairsData; import openmods.utils.render.RenderUtils; - import org.lwjgl.opengl.GL11; public class TileEntityImaginaryRenderer extends TileEntitySpecialRenderer { @@ -26,7 +25,7 @@ public class TileEntityImaginaryRenderer extends TileEntitySpecialRenderer { @@ -32,7 +31,7 @@ public class TileEntityPaintMixerRenderer extends TileEntitySpecialRenderer { private final static ResourceLocation texture = OpenBlocks.location("textures/models/projector.png"); - private static ModelProjector model = new ModelProjector(); + private static final float BLOCK_CENTRE_TRANSLATION = 0.5F; - public static void reload() { - model = new ModelProjector(); - } + private static ModelProjector model = new ModelProjector(); @Override public void renderTileEntityAt(TileEntityProjector projector, double x, double y, double z, float partialTickTime, int destroyProgess) { int pass = MinecraftForgeClient.getRenderPass(); GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y, z + 0.5); + GL11.glTranslated(x + BLOCK_CENTRE_TRANSLATION, y, z + BLOCK_CENTRE_TRANSLATION); GL11.glRotated(90 * projector.rotation(), 0, 1, 0); - GL11.glTranslated(-0.5, 0, -0.5); + + GL11.glTranslated(-BLOCK_CENTRE_TRANSLATION, 0, -BLOCK_CENTRE_TRANSLATION); GlStateManager.color(1, 1, 1); + int mapId = projector.mapId(); - if (pass <= 0) renderProjector(projector, partialTickTime, mapId >= 0); - else renderMap(projector, mapId); + if (pass <= 0) { + renderProjector(projector, partialTickTime, mapId >= 0); + } else { + renderMap(projector, mapId); + } GL11.glPopMatrix(); } @@ -53,8 +55,8 @@ public class TileEntityProjectorRenderer extends TileEntitySpecialRenderer { @@ -66,12 +65,12 @@ public class TileEntitySkyRenderer extends TileEntitySpecialRenderer= 0? new StencilSkyRenderer(1 << stencilBit) : StencilRendererHandler.DUMMY; } - private static void addVertex(WorldRenderer wr, double x, double y, double z) { + private static void addVertex(VertexBuffer wr, double x, double y, double z) { wr.pos(x, y, z).endVertex(); } private static void renderCube(Tessellator tes) { - final WorldRenderer wr = tes.getWorldRenderer(); + final VertexBuffer wr = tes.getBuffer(); wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); addVertex(wr, 0, 0, 0); diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntitySprinklerRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/TileEntitySprinklerRenderer.java index f33c2db5..0124beb5 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntitySprinklerRenderer.java +++ b/src/main/java/openblocks/client/renderer/tileentity/TileEntitySprinklerRenderer.java @@ -6,7 +6,6 @@ import openblocks.OpenBlocks; import openblocks.client.model.ModelSprinkler; import openblocks.common.tileentity.TileEntitySprinkler; import openmods.utils.BlockUtils; - import org.lwjgl.opengl.GL11; public class TileEntitySprinklerRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntityTankRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/TileEntityTankRenderer.java index 408ed052..d3883c8a 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntityTankRenderer.java +++ b/src/main/java/openblocks/client/renderer/tileentity/TileEntityTankRenderer.java @@ -2,7 +2,7 @@ package openblocks.client.renderer.tileentity; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -18,7 +18,6 @@ import openmods.renderer.TessellatorPool.WorldRendererUser; import openmods.utils.Diagonal; import openmods.utils.TextureUtils; import openmods.utils.render.RenderUtils; - import org.lwjgl.opengl.GL11; public class TileEntityTankRenderer extends TileEntitySpecialRenderer { @@ -28,8 +27,9 @@ public class TileEntityTankRenderer extends TileEntitySpecialRenderer 0 || ne > 0)) { addVertexWithUV(wr, 1, 0, 0, uMax, vMin); @@ -143,7 +143,7 @@ public class TileEntityTankRenderer extends TileEntitySpecialRenderer { @@ -56,22 +58,22 @@ public class TileEntityTrophyRenderer extends TileEntitySpecialRenderer quads) { + private static void renderQuads(VertexBuffer wr, List quads) { for (BakedQuad quad : quads) LightUtil.renderQuadColor(wr, quad, 0xFFFFFFFF); } diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntityVillageHighlighterRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/TileEntityVillageHighlighterRenderer.java index 21b76a19..451058e4 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntityVillageHighlighterRenderer.java +++ b/src/main/java/openblocks/client/renderer/tileentity/TileEntityVillageHighlighterRenderer.java @@ -2,18 +2,17 @@ package openblocks.client.renderer.tileentity; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.MathHelper; import openblocks.OpenBlocks; import openblocks.client.model.ModelVillage; import openblocks.common.tileentity.TileEntityVillageHighlighter; import openmods.sync.SyncableIntArray; import openmods.utils.BlockUtils; - import org.lwjgl.opengl.GL11; public class TileEntityVillageHighlighterRenderer extends TileEntitySpecialRenderer { @@ -31,7 +30,7 @@ public class TileEntityVillageHighlighterRenderer extends TileEntitySpecialRende GL11.glTranslatef((float)x + 0.5F, (float)y + 1.0f, (float)z + 0.5F); if (vh != null && vh.isPowered()) { Tessellator t = Tessellator.getInstance(); - WorldRenderer wr = t.getWorldRenderer(); + VertexBuffer wr = t.getBuffer(); SyncableIntArray villages = vh.getVillageData(); int[] data = villages.getValue(); @@ -93,11 +92,11 @@ public class TileEntityVillageHighlighterRenderer extends TileEntitySpecialRende GL11.glPopMatrix(); } - private static void addVertex(WorldRenderer wr, double x, double y, double z) { + private static void addVertex(VertexBuffer wr, double x, double y, double z) { wr.pos(x, y, z).endVertex(); } - public void drawBox(WorldRenderer wr, AxisAlignedBB bb) { + public void drawBox(VertexBuffer wr, AxisAlignedBB bb) { // bottom addVertex(wr, bb.minX, bb.minY, bb.minZ); addVertex(wr, bb.maxX, bb.minY, bb.minZ); diff --git a/src/main/java/openblocks/client/renderer/tileentity/guide/GuideAdvancedRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/guide/GuideAdvancedRenderer.java new file mode 100644 index 00000000..7b195b80 --- /dev/null +++ b/src/main/java/openblocks/client/renderer/tileentity/guide/GuideAdvancedRenderer.java @@ -0,0 +1,47 @@ +package openblocks.client.renderer.tileentity.guide; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.TextureMap; +import openblocks.common.tileentity.TileEntityGuide; +import openblocks.shapes.CoordShape; +import openmods.utils.TextureUtils; +import org.lwjgl.opengl.GL11; + +public class GuideAdvancedRenderer implements IGuideRenderer { + + private final MarkerRenderer mr; + + public GuideAdvancedRenderer(Runnable marker) { + this.mr = new MarkerRenderer(marker); + } + + @Override + public void renderShape(TileEntityGuide guide) { + float scaleDelta = guide.getTimeSinceChange(); + renderShape(guide.getShape(), guide.getColor(), scaleDelta); + if (scaleDelta < 1.0) renderShape(guide.getPreviousShape(), guide.getColor(), 1.0f - scaleDelta); + CoordShape toDelete = guide.getAndDeleteShape(); + if (toDelete != null && mr != null) mr.deleteShape(toDelete); + } + + private void renderShape(CoordShape shape, int color, float scale) { + if (shape == null) return; + + TextureUtils.bindTextureToClient(TextureMap.LOCATION_BLOCKS_TEXTURE); + + GlStateManager.enableBlend(); + + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GlStateManager.disableLighting(); + + mr.drawInstanced(shape, color, scale); + + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + } + + @Override + public void onTextureChange() { + mr.reset(); + } +} diff --git a/src/main/java/openblocks/client/renderer/tileentity/guide/GuideLegacyRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/guide/GuideLegacyRenderer.java new file mode 100644 index 00000000..dbe37f90 --- /dev/null +++ b/src/main/java/openblocks/client/renderer/tileentity/guide/GuideLegacyRenderer.java @@ -0,0 +1,64 @@ +package openblocks.client.renderer.tileentity.guide; + +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.math.BlockPos; +import openblocks.common.tileentity.TileEntityGuide; +import openblocks.shapes.CoordShape; +import openmods.renderer.DisplayListWrapper; +import openmods.utils.TextureUtils; +import org.lwjgl.opengl.GL11; + +public class GuideLegacyRenderer implements IGuideRenderer { + + private DisplayListWrapper wrapper; + + public GuideLegacyRenderer(final Runnable model) { + wrapper = new DisplayListWrapper() { + @Override + public void compile() { + // model.run(); + // Tessellator.getInstance().draw(); + // TODO 1.10 models TBD + } + }; + } + + @Override + public void onTextureChange() { + wrapper.reset(); + } + + @Override + public void renderShape(TileEntityGuide guide) { + float scaleDelta = guide.getTimeSinceChange(); + renderShape(guide.getShape(), guide.getColor(), scaleDelta); + if (scaleDelta < 1.0) { + renderShape(guide.getPreviousShape(), guide.getColor(), 1.0f - scaleDelta); + } + } + + private void renderShape(CoordShape shape, int color, float scale) { + if (shape == null) return; + + TextureUtils.bindTextureToClient(TextureMap.LOCATION_BLOCKS_TEXTURE); + // TODO 1.8 GlStateManager + GL11.glColor3ub((byte)(color >> 16), (byte)(color >> 8), (byte)(color >> 0)); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDisable(GL11.GL_LIGHTING); + + for (BlockPos coord : shape.getCoords()) + renderMarkerAt(coord.getX(), coord.getY(), coord.getZ(), scale); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + } + + private void renderMarkerAt(double x, double y, double z, float scale) { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5F, y, z + 0.5F); + GL11.glScalef(scale, scale, scale); + wrapper.render(); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/openblocks/client/renderer/tileentity/guide/GuideRendererSelector.java b/src/main/java/openblocks/client/renderer/tileentity/guide/GuideRendererSelector.java new file mode 100644 index 00000000..24d340c5 --- /dev/null +++ b/src/main/java/openblocks/client/renderer/tileentity/guide/GuideRendererSelector.java @@ -0,0 +1,46 @@ +package openblocks.client.renderer.tileentity.guide; + +import openblocks.Config; +import openmods.Log; +import openmods.renderer.shaders.ArraysHelper; +import openmods.renderer.shaders.BufferHelper; +import openmods.renderer.shaders.ShaderHelper; + +public class GuideRendererSelector { + + private static Runnable createMarkerRenderer() { + return new Runnable() { + @Override + public void run() { + // TODO 1.8.9 use actual models + // well, as long as array allows... + } + }; + } + + private static IGuideRenderer createRenderer() { + final Runnable marker = createMarkerRenderer(); + if (!ShaderHelper.isSupported() || !BufferHelper.isSupported() || !ArraysHelper.isSupported()) { + Log.debug("Advanced guide renderer not supported, falling back to legacy renderer."); + return new GuideLegacyRenderer(marker); // advanced renderer not supported :( + } else if (Config.useAdvancedRenderer == false) { + Log.debug("Advanced guide renderer disabled, falling back to legacy renderer."); + return new GuideLegacyRenderer(marker); + } else { + try { + return new GuideAdvancedRenderer(marker); // try to use the advanced renderer + } catch (Throwable e) { + Log.warn(e, "Error trying to create advanced renderer, falling back to legacy renderer"); + return new GuideLegacyRenderer(marker); // fall back to the old renderer. + } + } + } + + private static IGuideRenderer renderer; + + public IGuideRenderer getRenderer() { + if (renderer == null) renderer = createRenderer(); + return renderer; + } + +} diff --git a/src/main/java/openblocks/client/renderer/tileentity/guide/IGuideRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/guide/IGuideRenderer.java new file mode 100644 index 00000000..e67d8185 --- /dev/null +++ b/src/main/java/openblocks/client/renderer/tileentity/guide/IGuideRenderer.java @@ -0,0 +1,9 @@ +package openblocks.client.renderer.tileentity.guide; + +import openblocks.common.tileentity.TileEntityGuide; + +public interface IGuideRenderer { + void renderShape(TileEntityGuide guide); + + void onTextureChange(); +} diff --git a/src/main/java/openblocks/client/renderer/tileentity/guide/MarkerRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/guide/MarkerRenderer.java new file mode 100644 index 00000000..c7b4cc2e --- /dev/null +++ b/src/main/java/openblocks/client/renderer/tileentity/guide/MarkerRenderer.java @@ -0,0 +1,122 @@ +package openblocks.client.renderer.tileentity.guide; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.util.ResourceLocation; +import openblocks.shapes.CoordShape; +import openmods.renderer.shaders.ArraysHelper; +import openmods.renderer.shaders.BufferHelper; +import openmods.renderer.shaders.ShaderProgram; +import openmods.renderer.shaders.ShaderProgramBuilder; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL15; +import org.lwjgl.opengl.GL20; + +public class MarkerRenderer { + + private static final ResourceLocation vertexSource = new ResourceLocation("openblocks:shaders/shader.vert"); + private static final ResourceLocation fragmentSource = new ResourceLocation("openblocks:shaders/shader.frag"); + private final ShaderProgram shader; + + private static final int nativeBufferSize = 0x200000; + private final ByteBuffer byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4); + private final IntBuffer intBuffer = byteBuffer.asIntBuffer(); + + private final Runnable model; + + private boolean initialized; + private boolean hasTexture; + private boolean hasColor; + + private boolean shouldRefresh = true; + + private int vertexCount; + + private int vao; + private int vbo; + + public MarkerRenderer(Runnable model) { + this.model = model; + + final ShaderProgramBuilder shaderProgramBuilder = new ShaderProgramBuilder(); + shaderProgramBuilder.addShader(vertexSource, GL20.GL_VERTEX_SHADER); + shaderProgramBuilder.addShader(fragmentSource, GL20.GL_FRAGMENT_SHADER); + this.shader = shaderProgramBuilder.build(); + } + + public void reset() { + shouldRefresh = true; + } + + private void createModel() { + model.run(); + VertexBuffer.State state = Tessellator.getInstance().getBuffer().getVertexState(); + Tessellator.getInstance().draw(); // just discard the state this way. + + if (state.getRawBuffer().length > nativeBufferSize) throw new UnsupportedOperationException("Big buffers not supported!"); + + vertexCount = state.getVertexCount(); + + byteBuffer.position(0); + intBuffer.clear(); + intBuffer.put(state.getRawBuffer(), 0, vertexCount * 8); + byteBuffer.position(0); + byteBuffer.limit(vertexCount * 32); + + hasTexture = state.getVertexFormat().hasUvOffset(0); + hasColor = state.getVertexFormat().hasColor(); + } + + private void createVAO() { + if (initialized) { + createModel(); + + if (vao == 0) vao = ArraysHelper.methods().glGenVertexArrays(); + ArraysHelper.methods().glBindVertexArray(vao); + + if (vbo == 0) vbo = BufferHelper.methods().glGenBuffers(); + BufferHelper.methods().glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo); + BufferHelper.methods().glBufferData(GL15.GL_ARRAY_BUFFER, byteBuffer, GL15.GL_STATIC_DRAW); + + shader.attributePointer("aVertex", 3, GL11.GL_FLOAT, false, 32, 0); + shader.attributePointer("aTexCoord", 2, GL11.GL_FLOAT, false, 32, 12); + shader.attributePointer("aColor", 4, GL11.GL_UNSIGNED_BYTE, false, 32, 20); + + BufferHelper.methods().glBindBuffer(GL15.GL_ARRAY_BUFFER, 0); + + shader.uniform1f("uHasTexture", hasTexture? 1f : 0f); + shader.uniform1f("uHasColor", hasColor? 1f : 0f); + shader.uniform1i("uDefaultTexture", 0); + + ArraysHelper.methods().glBindVertexArray(0); + shouldRefresh = false; + } + } + + public void drawInstanced(CoordShape shape, int color, float scale) { + shader.bind(); + initialized = true; + if (shouldRefresh) createVAO(); + ArraysHelper.methods().glBindVertexArray(vao); + shape.bindVBO(); + shader.instanceAttributePointer("aPosition", 3, GL11.GL_INT, false, 0, 0); + BufferHelper.methods().glBindBuffer(GL15.GL_ARRAY_BUFFER, 0); + shader.uniform3f("uColor", ((color >> 16) & 0xFF) / 255f, ((color >> 8) & 0xFF) / 255f, (color & 0xFF) / 255f); + shader.uniform1f("uScale", scale); + ArraysHelper.methods().glDrawArraysInstanced(GL11.GL_QUADS, 0, vertexCount, shape.size()); + + ArraysHelper.methods().glBindVertexArray(0); + shader.release(); + } + + public void deleteShape(CoordShape shape) { + if (initialized) { + ArraysHelper.methods().glBindVertexArray(vao); + shape.destroy(); + ArraysHelper.methods().glBindVertexArray(0); + } + } +} diff --git a/src/main/java/openblocks/client/renderer/tileentity/TileEntityBuilderGuideRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/guide/TileEntityBuilderGuideRenderer.java similarity index 96% rename from src/main/java/openblocks/client/renderer/tileentity/TileEntityBuilderGuideRenderer.java rename to src/main/java/openblocks/client/renderer/tileentity/guide/TileEntityBuilderGuideRenderer.java index b197fbf2..f8e1118c 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/TileEntityBuilderGuideRenderer.java +++ b/src/main/java/openblocks/client/renderer/tileentity/guide/TileEntityBuilderGuideRenderer.java @@ -1,13 +1,12 @@ -package openblocks.client.renderer.tileentity; +package openblocks.client.renderer.tileentity.guide; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; import net.minecraftforge.client.MinecraftForgeClient; import openblocks.common.tileentity.TileEntityBuilderGuide; import openmods.renderer.DisplayListWrapper; import openmods.utils.render.RenderUtils; - import org.lwjgl.opengl.GL11; public class TileEntityBuilderGuideRenderer extends TileEntityGuideRenderer { diff --git a/src/main/java/openblocks/client/renderer/tileentity/guide/TileEntityGuideRenderer.java b/src/main/java/openblocks/client/renderer/tileentity/guide/TileEntityGuideRenderer.java new file mode 100644 index 00000000..1064cb4e --- /dev/null +++ b/src/main/java/openblocks/client/renderer/tileentity/guide/TileEntityGuideRenderer.java @@ -0,0 +1,31 @@ +package openblocks.client.renderer.tileentity.guide; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import openblocks.common.tileentity.TileEntityGuide; +import org.lwjgl.opengl.GL11; + +public class TileEntityGuideRenderer extends TileEntitySpecialRenderer { + + private final IGuideRenderer renderer; + + public TileEntityGuideRenderer() { + this.renderer = new GuideRendererSelector().getRenderer(); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onTextureChange(TextureStitchEvent evt) { + renderer.onTextureChange(); + } + + @Override + public void renderTileEntityAt(T tileentity, double x, double y, double z, float partialTicks, int destroyStage) { + GL11.glPushMatrix(); + GL11.glTranslated(x, y, z); + renderer.renderShape(tileentity); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/openblocks/client/renderer/tileentity/tank/DiagonalConnection.java b/src/main/java/openblocks/client/renderer/tileentity/tank/DiagonalConnection.java index 7584924b..40bfe0a4 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/tank/DiagonalConnection.java +++ b/src/main/java/openblocks/client/renderer/tileentity/tank/DiagonalConnection.java @@ -1,13 +1,14 @@ package openblocks.client.renderer.tileentity.tank; -import java.util.*; - -import net.minecraftforge.fluids.FluidStack; -import openblocks.common.tileentity.TileEntityTank; -import openmods.utils.Diagonal; - import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraftforge.fluids.FluidStack; +import openblocks.common.tileentity.TileEntityTank; +import openmods.utils.Diagonal; public class DiagonalConnection extends RenderConnection { diff --git a/src/main/java/openblocks/client/renderer/tileentity/tank/DoubledCoords.java b/src/main/java/openblocks/client/renderer/tileentity/tank/DoubledCoords.java index 7db6af04..7dbf1ee2 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/tank/DoubledCoords.java +++ b/src/main/java/openblocks/client/renderer/tileentity/tank/DoubledCoords.java @@ -1,7 +1,7 @@ package openblocks.client.renderer.tileentity.tank; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import openmods.utils.Diagonal; public class DoubledCoords { @@ -31,23 +31,23 @@ public class DoubledCoords { this(pos.getX(), pos.getY(), pos.getZ(), dir); } - public boolean check(int baseX, int baseY, int baseZ, EnumFacing dir) { + public boolean isSameAs(int baseX, int baseY, int baseZ, EnumFacing dir) { return (x == 2 * baseX + dir.getFrontOffsetX()) && (y == 2 * baseY + dir.getFrontOffsetY()) && (z == 2 * baseZ + dir.getFrontOffsetZ()); } - public boolean check(BlockPos pos, EnumFacing dir) { - return check(pos.getX(), pos.getY(), pos.getZ(), dir); + public boolean isSameAs(BlockPos pos, EnumFacing dir) { + return isSameAs(pos.getX(), pos.getY(), pos.getZ(), dir); } - public boolean check(int baseX, int baseY, int baseZ, Diagonal dir) { + public boolean isSameAs(int baseX, int baseY, int baseZ, Diagonal dir) { return (x == 2 * baseX + dir.offsetX) && (y == 2 * baseY + dir.offsetY) && (z == 2 * baseZ + dir.offsetZ); } - public boolean check(BlockPos pos, Diagonal dir) { - return check(pos.getX(), pos.getY(), pos.getZ(), dir); + public boolean isSameAs(BlockPos pos, Diagonal dir) { + return isSameAs(pos.getX(), pos.getY(), pos.getZ(), dir); } } \ No newline at end of file diff --git a/src/main/java/openblocks/client/renderer/tileentity/tank/NeighbourMap.java b/src/main/java/openblocks/client/renderer/tileentity/tank/NeighbourMap.java index 9c595e7f..fc7b1164 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/tank/NeighbourMap.java +++ b/src/main/java/openblocks/client/renderer/tileentity/tank/NeighbourMap.java @@ -1,7 +1,7 @@ package openblocks.client.renderer.tileentity.tank; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import openblocks.common.tileentity.TileEntityTank; diff --git a/src/main/java/openblocks/client/renderer/tileentity/tank/RenderConnection.java b/src/main/java/openblocks/client/renderer/tileentity/tank/RenderConnection.java index 058eb8b0..4d7a2ebf 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/tank/RenderConnection.java +++ b/src/main/java/openblocks/client/renderer/tileentity/tank/RenderConnection.java @@ -1,7 +1,7 @@ package openblocks.client.renderer.tileentity.tank; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import openmods.utils.Diagonal; public class RenderConnection { @@ -11,11 +11,19 @@ public class RenderConnection { this.coords = coords; } - public boolean check(BlockPos pos, EnumFacing dir) { - return coords.check(pos, dir); + public boolean isPositionEqualTo(int x, int y, int z, EnumFacing dir) { + return coords.isSameAs(x, y, z, dir); } - public boolean check(BlockPos pos, Diagonal dir) { - return coords.check(pos, dir); + public boolean isPositionEqualTo(BlockPos pos, EnumFacing dir) { + return coords.isSameAs(pos, dir); + } + + public boolean isPositionEqualTo(int x, int y, int z, Diagonal dir) { + return coords.isSameAs(x, y, z, dir); + } + + public boolean isPositionEqualTo(BlockPos pos, Diagonal dir) { + return coords.isSameAs(pos, dir); } } \ No newline at end of file diff --git a/src/main/java/openblocks/client/renderer/tileentity/tank/TankRenderLogic.java b/src/main/java/openblocks/client/renderer/tileentity/tank/TankRenderLogic.java index f91fd692..8b598771 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/tank/TankRenderLogic.java +++ b/src/main/java/openblocks/client/renderer/tileentity/tank/TankRenderLogic.java @@ -1,44 +1,190 @@ package openblocks.client.renderer.tileentity.tank; +import com.google.common.collect.Maps; import java.util.Map; - import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import openblocks.common.tileentity.TileEntityTank; import openmods.liquids.GenericTank; import openmods.utils.Diagonal; -import com.google.common.collect.Maps; +public class TankRenderLogic { -public class TankRenderLogic implements ITankConnections, ITankRenderFluidData { + private static class TankConnections implements ITankConnections { + + private final GenericTank tank; + + private final Map diagonalConnections; + + private final Map horizontalConnections; + + private final VerticalConnection topConnection; + + private final VerticalConnection bottomConnection; + + public TankConnections(GenericTank tank, Map diagonalConnections, Map horizontalConnections, VerticalConnection topConnection, VerticalConnection bottomConnection) { + this.tank = tank; + this.diagonalConnections = diagonalConnections; + this.horizontalConnections = horizontalConnections; + this.topConnection = topConnection; + this.bottomConnection = bottomConnection; + } + + @Override + public VerticalConnection getTopConnection() { + return topConnection; + } + + @Override + public VerticalConnection getBottomConnection() { + return bottomConnection; + } + + @Override + public HorizontalConnection getHorizontalConnection(EnumFacing dir) { + return horizontalConnections.get(dir); + } + + @Override + public DiagonalConnection getDiagonalConnection(Diagonal dir) { + return diagonalConnections.get(dir); + } + + public void updateFluid(FluidStack fluidStack) { + for (Map.Entry e : diagonalConnections.entrySet()) + e.getValue().updateFluid(e.getKey().getOpposite(), fluidStack); + + for (Map.Entry e : horizontalConnections.entrySet()) + e.getValue().updateFluid(e.getKey().getOpposite(), fluidStack); + + topConnection.updateBottomFluid(fluidStack, tank.getSpace() == 0); + bottomConnection.updateTopFluid(fluidStack); + } + + private static boolean checkConsistency(RenderConnection connection, BlockPos pos, EnumFacing dir) { + return connection != null && connection.isPositionEqualTo(pos, dir); + } + + private static boolean checkConsistency(RenderConnection connection, BlockPos pos, Diagonal dir) { + return connection != null && connection.isPositionEqualTo(pos, dir); + } + + private boolean checkHorizontalConsistency(BlockPos pos, EnumFacing dir) { + return checkConsistency(horizontalConnections.get(dir), pos, dir); + } + + private boolean checkDiagonalConsistency(BlockPos pos, Diagonal dir) { + return checkConsistency(diagonalConnections.get(dir), pos, dir); + } + + public boolean checkConsistency(BlockPos pos) { + return checkConsistency(topConnection, pos, EnumFacing.UP) && + checkConsistency(bottomConnection, pos, EnumFacing.DOWN) && + checkHorizontalConsistency(pos, EnumFacing.NORTH) && + checkHorizontalConsistency(pos, EnumFacing.SOUTH) && + checkHorizontalConsistency(pos, EnumFacing.EAST) && + checkHorizontalConsistency(pos, EnumFacing.WEST) && + checkDiagonalConsistency(pos, Diagonal.NE) && + checkDiagonalConsistency(pos, Diagonal.NW) && + checkDiagonalConsistency(pos, Diagonal.SE) && + checkDiagonalConsistency(pos, Diagonal.SW); + } + + public void detach() { + for (Map.Entry e : diagonalConnections.entrySet()) + e.getValue().clearFluid(e.getKey().getOpposite()); + + for (Map.Entry e : horizontalConnections.entrySet()) + e.getValue().clearFluid(e.getKey().getOpposite()); + + if (topConnection != null) { + topConnection.clearBottomFluid(); + } + + if (bottomConnection != null) { + bottomConnection.clearTopFluid(); + } + } + + } + + private static class TankRenderFluidData implements ITankRenderFluidData { + + private final TankConnections connections; + + private final GenericTank tank; + + private final float phase; + + public TankRenderFluidData(TankConnections connections, GenericTank tank, float phase) { + this.connections = connections; + this.tank = tank; + this.phase = phase; + } + + private static boolean isConnected(GridConnection connection) { + return connection != null? connection.isConnected() : false; + } + + @Override + public boolean shouldRenderFluidWall(EnumFacing side) { + switch (side) { + case DOWN: + return !isConnected(connections.getBottomConnection()); + case UP: + return !isConnected(connections.getTopConnection()); + case EAST: + case WEST: + case NORTH: + case SOUTH: { + return !isConnected(connections.getHorizontalConnection(side)); + } + default: + return true; + } + } + + @Override + public boolean hasFluid() { + return tank.getFluidAmount() > 0; + } + + @Override + public FluidStack getFluid() { + return tank.getFluid(); + } + + @Override + public float getCenterFluidLevel(float time) { + final float raw = (float)tank.getFluidAmount() / tank.getCapacity(); + final float waving = TankRenderUtils.calculateWaveAmplitude(time, phase) + raw; + return TankRenderUtils.clampLevel(waving); + } + + @Override + public float getCornerFluidLevel(Diagonal corner, float time) { + final DiagonalConnection diagonal = connections.getDiagonalConnection(corner); + return diagonal != null? diagonal.getRenderHeight(corner.getOpposite(), time) : getCenterFluidLevel(time); + } + } + + private final GenericTank tank; private BlockPos pos; private World world; - private final GenericTank tank; + private TankConnections connections; - private final Map diagonalConnections = Maps.newEnumMap(Diagonal.class); - - private final Map horizontalConnections = Maps.newEnumMap(EnumFacing.class); - - private VerticalConnection topConnection; - - private VerticalConnection bottomConnection; - - private float phase; + private TankRenderFluidData renderData; public TankRenderLogic(GenericTank tank) { this.tank = tank; } - private static boolean isConnected(GridConnection connection) { - return connection != null? connection.isConnected() : false; - } - private DoubledCoords createCoords(EnumFacing dir) { return new DoubledCoords(pos, dir); } @@ -49,7 +195,7 @@ public class TankRenderLogic implements ITankConnections, ITankRenderFluidData { private ITankConnections getNeighbourTank(BlockPos pos) { TileEntity te = TankRenderUtils.getTileEntitySafe(world, pos); - return (te instanceof TileEntityTank)? ((TileEntityTank)te).getRenderConnectionsData() : null; + return (te instanceof TileEntityTank)? ((TileEntityTank)te).getTankConnections() : null; } private ITankConnections getNeighbourTank(EnumFacing dir) { @@ -75,25 +221,25 @@ public class TankRenderLogic implements ITankConnections, ITankRenderFluidData { return new DiagonalConnection(TankRenderUtils.calculatePhase(pos.getX(), pos.getY(), pos.getZ(), start), createCoords(start)); } - private void tryCornerConnection(ITankConnections tankCW, ITankConnections tankD, ITankConnections tankCCW, Diagonal dir) { + private void tryCornerConnection(Map diagonalConnections, ITankConnections tankCW, ITankConnections tankD, ITankConnections tankCCW, Diagonal dir) { final DiagonalConnection connection = selectDiagonalConnection(tankCW, tankD, tankCCW, dir); diagonalConnections.put(dir, connection); } - private void tryHorizontalConnection(ITankConnections neighbour, EnumFacing dir) { + private void tryHorizontalConnection(Map horizontalConnections, ITankConnections neighbour, EnumFacing dir) { final HorizontalConnection connection = (neighbour != null)? neighbour.getHorizontalConnection(dir.getOpposite()) : new HorizontalConnection(createCoords(dir)); horizontalConnections.put(dir, connection); } - private void tryBottomConnection(ITankConnections neighbour) { - bottomConnection = neighbour != null? neighbour.getTopConnection() : new VerticalConnection(createCoords(EnumFacing.DOWN)); + private VerticalConnection tryBottomConnection(ITankConnections neighbour) { + return neighbour != null? neighbour.getTopConnection() : new VerticalConnection(createCoords(EnumFacing.DOWN)); } - private void tryTopConnection(ITankConnections neighbour) { - topConnection = neighbour != null? neighbour.getBottomConnection() : new VerticalConnection(createCoords(EnumFacing.UP)); + private VerticalConnection tryTopConnection(ITankConnections neighbour) { + return neighbour != null? neighbour.getBottomConnection() : new VerticalConnection(createCoords(EnumFacing.UP)); } - public void updateConnections() { + private TankConnections updateConnections() { final ITankConnections tankN = getNeighbourTank(EnumFacing.NORTH); final ITankConnections tankS = getNeighbourTank(EnumFacing.SOUTH); final ITankConnections tankW = getNeighbourTank(EnumFacing.WEST); @@ -107,159 +253,63 @@ public class TankRenderLogic implements ITankConnections, ITankRenderFluidData { final ITankConnections tankT = getNeighbourTank(EnumFacing.UP); final ITankConnections tankB = getNeighbourTank(EnumFacing.DOWN); - tryTopConnection(tankT); - tryBottomConnection(tankB); + final VerticalConnection topConnection = tryTopConnection(tankT); + final VerticalConnection bottomConnection = tryBottomConnection(tankB); - tryHorizontalConnection(tankN, EnumFacing.NORTH); - tryHorizontalConnection(tankS, EnumFacing.SOUTH); - tryHorizontalConnection(tankW, EnumFacing.WEST); - tryHorizontalConnection(tankE, EnumFacing.EAST); + final Map diagonalConnections = Maps.newEnumMap(Diagonal.class); - tryCornerConnection(tankN, tankNW, tankW, Diagonal.NW); - tryCornerConnection(tankW, tankSW, tankS, Diagonal.SW); - tryCornerConnection(tankE, tankNE, tankN, Diagonal.NE); - tryCornerConnection(tankS, tankSE, tankE, Diagonal.SE); + final Map horizontalConnections = Maps.newEnumMap(EnumFacing.class); + + tryHorizontalConnection(horizontalConnections, tankN, EnumFacing.NORTH); + tryHorizontalConnection(horizontalConnections, tankS, EnumFacing.SOUTH); + tryHorizontalConnection(horizontalConnections, tankW, EnumFacing.WEST); + tryHorizontalConnection(horizontalConnections, tankE, EnumFacing.EAST); + + tryCornerConnection(diagonalConnections, tankN, tankNW, tankW, Diagonal.NW); + tryCornerConnection(diagonalConnections, tankW, tankSW, tankS, Diagonal.SW); + tryCornerConnection(diagonalConnections, tankE, tankNE, tankN, Diagonal.NE); + tryCornerConnection(diagonalConnections, tankS, tankSE, tankE, Diagonal.SE); + + return new TankConnections(tank, diagonalConnections, horizontalConnections, topConnection, bottomConnection); } public void initialize(World world, BlockPos pos) { - this.phase = TankRenderUtils.calculatePhase(pos.getX(), pos.getY(), pos.getZ()); - this.world = world; this.pos = pos; - updateConnections(); - } + if (this.connections != null) connections.detach(); - public void clearConnections() { - for (Map.Entry e : diagonalConnections.entrySet()) - e.getValue().clearFluid(e.getKey().getOpposite()); - - diagonalConnections.clear(); - - for (Map.Entry e : horizontalConnections.entrySet()) - e.getValue().clearFluid(e.getKey().getOpposite()); - - horizontalConnections.clear(); - - if (topConnection != null) { - topConnection.clearBottomFluid(); - topConnection = null; - } - - if (bottomConnection != null) { - bottomConnection.clearTopFluid(); - bottomConnection = null; + if (world == null) { + this.connections = null; + this.renderData = null; + } else { + float phase = TankRenderUtils.calculatePhase(pos.getX(), pos.getY(), pos.getZ()); + this.connections = updateConnections(); + this.renderData = new TankRenderFluidData(connections, tank, phase); } } - private boolean checkConnection(RenderConnection connection, EnumFacing dir) { - return connection == null || !connection.check(pos, dir); + public void validateConnections(World world, BlockPos pos) { + if (world != this.world || connections == null || !connections.checkConsistency(pos)) + initialize(world, pos); } - private boolean checkConnection(RenderConnection connection, Diagonal dir) { - return connection == null || !connection.check(pos, dir); + public void invalidateConnections() { + if (this.connections != null) connections.detach(); + this.connections = null; + this.renderData = null; } - private boolean checkHorizontalConnection(EnumFacing dir) { - return checkConnection(horizontalConnections.get(dir), dir); + public void updateFluid(FluidStack stack) { + if (connections != null) connections.updateFluid(stack); } - private boolean checkDiagonalConnection(Diagonal dir) { - return checkConnection(diagonalConnections.get(dir), dir); + public ITankRenderFluidData getTankRenderData() { + return renderData; } - private boolean checkConnections() { - return checkConnection(topConnection, EnumFacing.UP) || - checkConnection(bottomConnection, EnumFacing.DOWN) || - checkConnection(topConnection, EnumFacing.UP) || - checkHorizontalConnection(EnumFacing.NORTH) || - checkHorizontalConnection(EnumFacing.SOUTH) || - checkHorizontalConnection(EnumFacing.EAST) || - checkHorizontalConnection(EnumFacing.WEST) || - checkDiagonalConnection(Diagonal.NE) || - checkDiagonalConnection(Diagonal.NW) || - checkDiagonalConnection(Diagonal.SE) || - checkDiagonalConnection(Diagonal.SW); - - } - - public void validateConnections() { - if (checkConnections()) { - clearConnections(); - updateConnections(); - } - } - - public void updateFluid(FluidStack fluidStack) { - for (Map.Entry e : diagonalConnections.entrySet()) - e.getValue().updateFluid(e.getKey().getOpposite(), fluidStack); - - for (Map.Entry e : horizontalConnections.entrySet()) - e.getValue().updateFluid(e.getKey().getOpposite(), fluidStack); - - topConnection.updateBottomFluid(fluidStack, tank.getSpace() == 0); - bottomConnection.updateTopFluid(fluidStack); - } - - @Override - public boolean shouldRenderFluidWall(EnumFacing side) { - switch (side) { - case DOWN: - return !isConnected(bottomConnection); - case UP: - return !isConnected(topConnection); - case EAST: - case WEST: - case NORTH: - case SOUTH: { - return !isConnected(horizontalConnections.get(side)); - } - default: - return true; - } - } - - @Override - public boolean hasFluid() { - return tank.getFluidAmount() > 0; - } - - @Override - public FluidStack getFluid() { - return tank.getFluid(); - } - - @Override - public float getCenterFluidLevel(float time) { - final float raw = (float)tank.getFluidAmount() / tank.getCapacity(); - final float waving = TankRenderUtils.calculateWaveAmplitude(time, phase) + raw; - return TankRenderUtils.clampLevel(waving); - } - - @Override - public float getCornerFluidLevel(Diagonal corner, float time) { - final DiagonalConnection diagonal = diagonalConnections.get(corner); - return diagonal != null? diagonal.getRenderHeight(corner.getOpposite(), time) : getCenterFluidLevel(time); - } - - @Override - public VerticalConnection getTopConnection() { - return topConnection; - } - - @Override - public VerticalConnection getBottomConnection() { - return bottomConnection; - } - - @Override - public HorizontalConnection getHorizontalConnection(EnumFacing dir) { - return horizontalConnections.get(dir); - } - - @Override - public DiagonalConnection getDiagonalConnection(Diagonal dir) { - return diagonalConnections.get(dir); + public ITankConnections getTankConnections() { + return connections; } } diff --git a/src/main/java/openblocks/client/renderer/tileentity/tank/TankRenderUtils.java b/src/main/java/openblocks/client/renderer/tileentity/tank/TankRenderUtils.java index 884b8147..9e405b34 100644 --- a/src/main/java/openblocks/client/renderer/tileentity/tank/TankRenderUtils.java +++ b/src/main/java/openblocks/client/renderer/tileentity/tank/TankRenderUtils.java @@ -1,8 +1,8 @@ package openblocks.client.renderer.tileentity.tank; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk.EnumCreateEntityType; diff --git a/src/main/java/openblocks/common/BeepGenerator.java b/src/main/java/openblocks/common/BeepGenerator.java new file mode 100644 index 00000000..02cce980 --- /dev/null +++ b/src/main/java/openblocks/common/BeepGenerator.java @@ -0,0 +1,232 @@ +package openblocks.common; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.SourceDataLine; +import net.minecraft.client.Minecraft; +import net.minecraft.util.SoundCategory; +import openmods.Log; + +public class BeepGenerator { + + private static final int SAMPLE_RATE = 44100; + + private static final int SAMPLES_PER_BUFFER = SAMPLE_RATE / 8; + + private static final int BYTES_PER_SAMPLE = 2; + + private static final int BYTES_PER_BUFFER = BYTES_PER_SAMPLE * SAMPLES_PER_BUFFER; + + private static final double BUFFER_DURATION = (double)SAMPLES_PER_BUFFER / SAMPLE_RATE; + + private static final double FREQUENCY_MAX_CHANGE_PER_BUFFER_DURATION = 50.0; + + private final byte[] scratchBuffer = new byte[BYTES_PER_BUFFER]; + + private static final byte[] ZERO_BUFFER = new byte[BYTES_PER_BUFFER]; + + private short volume = 2560; + + private double wavePhase; + private int beepPhase; + + private double toneFrequency; + private double targetToneFrequency; + private double beepFrequency; + private int samplesPerBeep; + + private class WriterThread extends Thread { + + private final SourceDataLine line; + + private boolean running = true; + + public WriterThread(SourceDataLine line) { + this.line = line; + setDaemon(true); + setName("Beeper thread"); + } + + @Override + public void run() { + line.start(); + + try { + while (running) { + final int available = line.available(); + + if (available >= SAMPLES_PER_BUFFER) + writeSample(line); + + try { + Thread.sleep(100); // has to be lower than SAMPLES_PER_BUFFER / SAMPLE_RATE + } catch (InterruptedException e) { + running = false; + } + } + } finally { + running = false; + line.close(); + } + } + + public boolean isShuttingDown() { + return !running; + } + + public void shutdown() { + running = false; + } + } + + private WriterThread writerThread; + + public synchronized void start() { + wavePhase = 0; + beepPhase = 0; + + if (!isRunning()) { + final AudioFormat af = new AudioFormat(SAMPLE_RATE, 8 * BYTES_PER_SAMPLE, 1, true, true); + try { + SourceDataLine line = AudioSystem.getSourceDataLine(af); + line.open(af, SAMPLE_RATE); + writerThread = new WriterThread(line); + writerThread.start(); + } catch (LineUnavailableException e) { + Log.warn(e, "Failed to initialize beeper"); + if (writerThread != null) writerThread.shutdown(); + } + } + } + + public synchronized void stop() { + if (writerThread != null) writerThread.shutdown(); + setTargetToneFrequency(0d); + setBeepFrequency(0d); + } + + public synchronized boolean isRunning() { + return writerThread != null && writerThread.isAlive() && !writerThread.isShuttingDown(); + } + + private void writeSample(SourceDataLine line) { + final double lastToneFrequency; + + if (this.toneFrequency == 0d || this.targetToneFrequency == 0d) { + lastToneFrequency = this.targetToneFrequency; + this.toneFrequency = this.targetToneFrequency; + } else { + lastToneFrequency = this.toneFrequency; + final double delta = this.targetToneFrequency - this.toneFrequency; + this.toneFrequency += limit(delta, FREQUENCY_MAX_CHANGE_PER_BUFFER_DURATION); + } + + byte[] buffer = generateSamplesWithSweep(lastToneFrequency, this.toneFrequency); + line.write(buffer, 0, buffer.length); + } + + private static double limit(double value, double limit) { + if (value < 0) + return Math.max(value, -limit); + else + return Math.min(value, limit); + } + + private byte[] generateSamplesWithSweep(double f0, double f1) { + if (f0 == 0.0 && f1 == 0.0) + return ZERO_BUFFER; + + final float masterSoundLevel = Minecraft.getMinecraft().gameSettings.getSoundLevel(SoundCategory.MASTER); + + if (masterSoundLevel == 0) + return ZERO_BUFFER; + + final float amplitude = Math.max(volume * masterSoundLevel, 2); + + final double sweepDuration = BUFFER_DURATION; + + // see 'chirp' on wiki for explanation of constants + final double k = (f1 - f0) / sweepDuration; + + int sampleCount = 0; + + if (samplesPerBeep == 0) { + for (int i = 0; i < BYTES_PER_BUFFER; i += BYTES_PER_SAMPLE, sampleCount++) { + final short v = (short)calculateSample(amplitude, wavePhase, f0, k, sampleToRealTime(sampleCount)); + writeShortSample(scratchBuffer, i, v); + } + } else { + int beepSample = beepPhase; + for (int i = 0; i < BYTES_PER_BUFFER; i += BYTES_PER_SAMPLE, sampleCount++) { + if (beepSample < samplesPerBeep) { + final short v = (short)calculateSample(amplitude, wavePhase, f0, k, sampleToRealTime(sampleCount)); + writeShortSample(scratchBuffer, i, v); + } else { + scratchBuffer[i] = 0; + scratchBuffer[i + 1] = 0; + } + + if (beepSample++ >= 2 * samplesPerBeep) + beepSample = 0; + } + beepPhase = beepSample; + } + + wavePhase = phase(wavePhase, f0, k, sampleToRealTime(sampleCount)) % (2 * Math.PI); + return scratchBuffer; + + } + + private static void writeShortSample(byte[] buf, int i, final short v) { + buf[i] = (byte)(v >> 8); + buf[i + 1] = (byte)(v); + } + + private static double sampleToRealTime(int sampleCount) { + return (double)sampleCount / SAMPLE_RATE; + } + + private static double calculateSample(float amplitude, double phase0, double f0, double k, double t) { + return (short)(amplitude * Math.sin(phase(phase0, f0, k, t))); + } + + private static double phase(double phase0, double f0, double k, double t) { + return phase0 + 2.0 * Math.PI * (f0 + k / 2.0 * t) * t; + } + + public short getVolume() { + return volume; + } + + public void setVolume(short volume) { + this.volume = volume; + } + + public double getToneFrequency() { + return toneFrequency; + } + + public double getTargetToneFrequency() { + return this.targetToneFrequency; + } + + public void setTargetToneFrequency(double frequency) { + this.targetToneFrequency = frequency; + } + + public double getBeepFrequency() { + return beepFrequency; + } + + public void setBeepFrequency(double beepFrequency) { + this.beepFrequency = beepFrequency; + + if (beepFrequency == 0) { + samplesPerBeep = 0; + } else { + samplesPerBeep = (int)(SAMPLE_RATE / beepFrequency); + } + } + +} diff --git a/src/main/java/openblocks/common/CommandInventory.java b/src/main/java/openblocks/common/CommandInventory.java index 9ad5a6c6..623fb4fc 100644 --- a/src/main/java/openblocks/common/CommandInventory.java +++ b/src/main/java/openblocks/common/CommandInventory.java @@ -2,26 +2,28 @@ package openblocks.common; import static openmods.utils.CommandUtils.filterPrefixes; import static openmods.utils.CommandUtils.fiterPlayerNames; -import static openmods.utils.CommandUtils.getPlayer; +import com.google.common.collect.Lists; import java.io.File; import java.util.Collections; import java.util.List; - -import net.minecraft.command.*; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; import openblocks.api.InventoryEvent.SubInventory; import openblocks.common.PlayerInventoryStore.LoadedInventories; import openmods.Log; import openmods.utils.BlockUtils; import openmods.utils.InventoryUtils; -import com.google.common.collect.Lists; - public class CommandInventory implements ICommand { private static final String COMMAND_RESTORE = "restore"; @@ -59,7 +61,7 @@ public class CommandInventory implements ICommand { } @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { + public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { if (args.length < 1) throw new SyntaxErrorException(); String subCommand = args[0]; @@ -68,7 +70,7 @@ public class CommandInventory implements ICommand { if (args.length != 3) throw new SyntaxErrorException(); String playerName = args[1]; String id = args[2]; - EntityPlayerMP player = getPlayer(sender, playerName); + EntityPlayerMP player = CommandBase.getPlayer(server, sender, playerName); final boolean success; try { @@ -78,16 +80,16 @@ public class CommandInventory implements ICommand { throw new CommandException("openblocks.misc.cant_restore_player", playerName); } - if (success) sender.addChatMessage(new ChatComponentTranslation("openblocks.misc.restored_inventory", playerName)); + if (success) sender.addChatMessage(new TextComponentTranslation("openblocks.misc.restored_inventory", playerName)); else throw new CommandException("openblocks.misc.cant_restore_player", playerName); } else if (subCommand.equalsIgnoreCase(COMMAND_STORE)) { if (args.length != 2) throw new SyntaxErrorException(); String playerName = args[1]; - EntityPlayerMP player = getPlayer(sender, playerName); + EntityPlayerMP player = CommandBase.getPlayer(server, sender, playerName); try { File result = PlayerInventoryStore.instance.storePlayerInventory(player, "command"); - sender.addChatMessage(new ChatComponentTranslation( + sender.addChatMessage(new TextComponentTranslation( "openblocks.misc.stored_inventory", result.getAbsolutePath())); } catch (Exception e) { @@ -98,7 +100,7 @@ public class CommandInventory implements ICommand { if (args.length != 2 && args.length != 3 && args.length != 4) throw new SyntaxErrorException(); final String id = args[1]; - final String target = (args.length > 1)? args[2] : ID_MAIN_INVENTORY; + final String target = (args.length > 2)? args[2] : ID_MAIN_INVENTORY; LoadedInventories loadedInventories = loadInventories(sender, id); if (loadedInventories == null) throw new CommandException("openblocks.misc.cant_restore_inventory"); @@ -156,12 +158,12 @@ public class CommandInventory implements ICommand { } @Override - public boolean canCommandSenderUseCommand(ICommandSender sender) { + public boolean checkPermission(MinecraftServer server, ICommandSender sender) { return sender.canCommandSenderUseCommand(4, NAME); } @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 0) return null; if (args.length == 1) return filterPrefixes(args[0], SUB_COMMANDS); diff --git a/src/main/java/openblocks/common/CraneRegistry.java b/src/main/java/openblocks/common/CraneRegistry.java index 37d07d73..4c437757 100644 --- a/src/main/java/openblocks/common/CraneRegistry.java +++ b/src/main/java/openblocks/common/CraneRegistry.java @@ -1,13 +1,12 @@ package openblocks.common; +import com.google.common.collect.MapMaker; import java.util.Map; - import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import openblocks.common.entity.EntityMagnet; -import com.google.common.collect.MapMaker; - public class CraneRegistry { private static final double MIN_LENGTH = 0.25; private static final double MAX_LENGTH = 10; @@ -23,7 +22,7 @@ public class CraneRegistry { public double prevPosY; public double prevPosZ; - private Data(EntityPlayer player) { + private Data(EntityLivingBase player) { prevYaw = player.rotationYaw; prevPosX = player.posX; prevPosY = player.posY; @@ -36,11 +35,12 @@ public class CraneRegistry { } } - private Map itemData = new MapMaker().weakKeys().makeMap(); - private Map playersMagnets = new MapMaker().weakKeys().weakValues().makeMap(); + // TODO does it need two separate collections? + private Map itemData = new MapMaker().weakKeys().makeMap(); + private Map magnetOwners = new MapMaker().weakKeys().weakValues().makeMap(); - public void ensureMagnetExists(EntityPlayer player) { - EntityMagnet magnet = playersMagnets.get(player); + public void ensureMagnetExists(EntityLivingBase player) { + EntityMagnet magnet = magnetOwners.get(player); if (magnet == null || magnet.isDead) { createMagnetForPlayer(player); @@ -50,18 +50,18 @@ public class CraneRegistry { } } - private static EntityMagnet createMagnetForPlayer(EntityPlayer player) { + private static EntityMagnet createMagnetForPlayer(EntityLivingBase player) { EntityMagnet result = new EntityMagnet.PlayerBound(player.worldObj, player); player.worldObj.spawnEntityInWorld(result); return result; } - public EntityMagnet getMagnetForPlayer(EntityPlayer player) { - return playersMagnets.get(player); + public EntityMagnet getMagnetForPlayer(EntityLivingBase player) { + return magnetOwners.get(player); } public void bindMagnetToPlayer(Entity owner, EntityMagnet magnet) { - if (owner instanceof EntityPlayer) playersMagnets.put((EntityPlayer)owner, magnet); + if (owner instanceof EntityPlayer) magnetOwners.put((EntityPlayer)owner, magnet); } public static final double ARM_RADIUS = 2.0; @@ -70,7 +70,7 @@ public class CraneRegistry { private CraneRegistry() {} - public Data getData(EntityPlayer player, boolean canCreate) { + public Data getData(EntityLivingBase player, boolean canCreate) { Data result = itemData.get(player); if (result == null && canCreate) { @@ -81,7 +81,7 @@ public class CraneRegistry { return result; } - public double getCraneMagnetDistance(EntityPlayer player) { + public double getCraneMagnetDistance(EntityLivingBase player) { Data data = getData(player, false); return data != null? data.length : MIN_LENGTH; } diff --git a/src/main/java/openblocks/common/DonationUrlManager.java b/src/main/java/openblocks/common/DonationUrlManager.java index 8746a94f..98b31038 100644 --- a/src/main/java/openblocks/common/DonationUrlManager.java +++ b/src/main/java/openblocks/common/DonationUrlManager.java @@ -1,7 +1,6 @@ package openblocks.common; import java.util.HashMap; - import openmods.Mods; public class DonationUrlManager { diff --git a/src/main/java/openblocks/common/ElevatorActionHandler.java b/src/main/java/openblocks/common/ElevatorActionHandler.java index 4a6e7e6f..90dfbf9c 100644 --- a/src/main/java/openblocks/common/ElevatorActionHandler.java +++ b/src/main/java/openblocks/common/ElevatorActionHandler.java @@ -1,23 +1,28 @@ package openblocks.common; +import com.google.common.base.Preconditions; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3i; import net.minecraft.world.World; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.Config; +import openblocks.OpenBlocks; import openblocks.api.IElevatorBlock; import openblocks.api.IElevatorBlock.PlayerRotation; import openblocks.events.ElevatorActionEvent; import openmods.movement.PlayerMovementEvent; import openmods.utils.EnchantmentUtils; -import com.google.common.base.Preconditions; - public class ElevatorActionHandler { private static class SearchResult extends BlockPos { @@ -34,9 +39,7 @@ public class ElevatorActionHandler { if (!Config.irregularBlocksArePassable) return false; final IBlockState blockState = world.getBlockState(pos); - final Block block = blockState.getBlock(); - - final AxisAlignedBB aabb = block.getCollisionBoundingBox(world, pos, blockState); + final AxisAlignedBB aabb = blockState.getCollisionBoundingBox(world, pos); return aabb == null || aabb.getAverageEdgeLength() < 0.7; } @@ -78,7 +81,7 @@ public class ElevatorActionHandler { } if (!Config.elevatorIgnoreBlocks) { - ElevatorBlockRules.Action action = ElevatorBlockRules.instance.getActionForBlock(block); + ElevatorBlockRules.Action action = ElevatorBlockRules.instance.getActionForBlock(blockState); switch (action) { case ABORT: return null; @@ -105,7 +108,7 @@ public class ElevatorActionHandler { if (result.rotation != PlayerRotation.NONE) player.rotationYaw = getYaw(result.rotation); if (Config.elevatorCenter) player.setPositionAndUpdate(result.getX() + 0.5, result.getY() + 1.1, result.getZ() + 0.5); else player.setPositionAndUpdate(player.posX, result.getY() + 1.1, player.posZ); - world.playSoundAtEntity(player, "openblocks:elevator.activate", 1, 1); + world.playSound(null, player.getPosition(), OpenBlocks.Sounds.BLOCK_ELEVATOR_ACTIVATE, SoundCategory.BLOCKS, 1, 1); } } } @@ -147,7 +150,7 @@ public class ElevatorActionHandler { if (!(blockState.getBlock() instanceof IElevatorBlock)) return; if (evt.sender != null) { - if (evt.sender.ridingEntity != null) return; + if (evt.sender.isRiding()) return; switch (evt.type) { case JUMP: @@ -163,7 +166,7 @@ public class ElevatorActionHandler { @SubscribeEvent @SideOnly(Side.CLIENT) public void onPlayerMovement(PlayerMovementEvent evt) { - final EntityPlayer player = evt.entityPlayer; + final EntityPlayer player = evt.getEntityPlayer(); if (player == null) return; final World world = player.worldObj; @@ -175,7 +178,7 @@ public class ElevatorActionHandler { final BlockPos pos = new BlockPos(x, y, z); final Block block = world.getBlockState(pos).getBlock(); - if (block instanceof IElevatorBlock) new ElevatorActionEvent(world.provider.getDimensionId(), pos, evt.type).sendToServer(); + if (block instanceof IElevatorBlock) new ElevatorActionEvent(world.provider.getDimension(), pos, evt.type).sendToServer(); } } diff --git a/src/main/java/openblocks/common/ElevatorBlockRules.java b/src/main/java/openblocks/common/ElevatorBlockRules.java index 15cad881..b011540d 100644 --- a/src/main/java/openblocks/common/ElevatorBlockRules.java +++ b/src/main/java/openblocks/common/ElevatorBlockRules.java @@ -1,18 +1,18 @@ package openblocks.common; -import java.util.Locale; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.registry.GameRegistry; -import openblocks.Config; -import openmods.Log; -import openmods.config.properties.ConfigurationChange; - import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import java.util.Locale; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import openblocks.Config; +import openmods.Log; +import openmods.config.properties.ConfigurationChange; public class ElevatorBlockRules { @@ -63,9 +63,9 @@ public class ElevatorBlockRules { Preconditions.checkNotNull(action, "Unknown action: %s", actionName); - Block block = GameRegistry.findBlock(modId, blockName); + Block block = Block.REGISTRY.getObject(new ResourceLocation(modId, blockName)); - if (block != null) rules.put(block, action); + if (block != Blocks.AIR) rules.put(block, action); else Log.warn("Can't find block %s", entry); } @@ -74,16 +74,15 @@ public class ElevatorBlockRules { if (evt.check("dropblock", "specialBlockRules")) rules = null; } - private static boolean isPassable(Block block) { - return Config.elevatorIgnoreHalfBlocks && !block.isNormalCube(); + private static boolean isPassable(IBlockState state) { + return Config.elevatorIgnoreHalfBlocks && !state.isNormalCube(); } - public Action getActionForBlock(Block block) { - if (block == null) return Action.IGNORE; - Action action = getRules().get(block); + public Action getActionForBlock(IBlockState state) { + Action action = getRules().get(state.getBlock()); if (action != null) return action; - return isPassable(block)? Action.IGNORE : Action.INCREMENT; + return isPassable(state)? Action.IGNORE : Action.INCREMENT; } } diff --git a/src/main/java/openblocks/common/EntityEventHandler.java b/src/main/java/openblocks/common/EntityEventHandler.java index 9702ca0a..764ea61c 100644 --- a/src/main/java/openblocks/common/EntityEventHandler.java +++ b/src/main/java/openblocks/common/EntityEventHandler.java @@ -1,7 +1,7 @@ package openblocks.common; +import com.google.common.collect.Sets; import java.util.Set; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.player.EntityPlayer; @@ -16,8 +16,6 @@ import openmods.config.properties.ConfigurationChange; import openmods.utils.BlockUtils; import openmods.utils.PlayerUtils; -import com.google.common.collect.Sets; - public class EntityEventHandler { public static final String OPENBLOCKS_PERSIST_TAG = "OpenBlocks"; @@ -33,13 +31,13 @@ public class EntityEventHandler { Set unknownNames = Sets.newHashSet(); for (String name : Config.disableMobNames) { - Class cls = EntityList.stringToClassMapping.get(name); + Class cls = EntityList.NAME_TO_CLASS.get(name); if (cls != null) entityBlacklist.add(cls); else unknownNames.add(name); } // using Class.forName is unsafe - for (Class cls : EntityList.classToStringMapping.keySet()) { + for (Class cls : EntityList.CLASS_TO_NAME.keySet()) { if (unknownNames.isEmpty()) break; if (unknownNames.remove(cls.getName())) entityBlacklist.add(cls); } @@ -58,7 +56,7 @@ public class EntityEventHandler { @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event) { - final Entity entity = event.entity; + final Entity entity = event.getEntity(); if (entity != null) { Set> blacklist = getBlacklist(); if (blacklist.contains(entity.getClass())) { @@ -72,7 +70,7 @@ public class EntityEventHandler { * If the player hasn't been given a manual, we'll give him one! (or * throw it on the floor..) */ - if (Config.spamInfoBook && !event.world.isRemote && entity instanceof EntityPlayer) { + if (Config.spamInfoBook && !event.getWorld().isRemote && entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)entity; NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "OpenBlocks"); diff --git a/src/main/java/openblocks/common/GameRuleManager.java b/src/main/java/openblocks/common/GameRuleManager.java index 68d5e65b..db11708a 100644 --- a/src/main/java/openblocks/common/GameRuleManager.java +++ b/src/main/java/openblocks/common/GameRuleManager.java @@ -16,7 +16,7 @@ public class GameRuleManager { @SubscribeEvent public void onWorldLoad(WorldEvent.Load evt) { - final GameRules rules = evt.world.getGameRules(); + final GameRules rules = evt.getWorld().getGameRules(); addRule(rules, GameRule.SPAWN_GRAVES, "true"); } } diff --git a/src/main/java/openblocks/common/GuiOpenHandler.java b/src/main/java/openblocks/common/GuiOpenHandler.java deleted file mode 100644 index 6c1fd399..00000000 --- a/src/main/java/openblocks/common/GuiOpenHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -package openblocks.common; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import net.minecraftforge.fml.common.eventhandler.Event.Result; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import openblocks.OpenBlocks.Items; - -public class GuiOpenHandler { - - @SubscribeEvent - public void onGuiOpen(PlayerOpenContainerEvent event) { - // TODO: this shouldn't allow EVERYTHING. need to find a way - // to only allow ones that are actually valid. - // could be tricky, as Container doesn't know about - // Block/tile/location/anything - if (event.entityPlayer != null) { - ItemStack held = event.entityPlayer.getHeldItem(); - if (held != null && held.getItem() != null && held.getItem().equals(Items.cursor)) { - event.setResult(Result.ALLOW); - } - } - } -} diff --git a/src/main/java/openblocks/common/HeightMapData.java b/src/main/java/openblocks/common/HeightMapData.java index 6b8e14c0..eddab140 100644 --- a/src/main/java/openblocks/common/HeightMapData.java +++ b/src/main/java/openblocks/common/HeightMapData.java @@ -110,7 +110,7 @@ public class HeightMapData extends WorldSavedData { } @Override - public void writeToNBT(NBTTagCompound tag) { + public NBTTagCompound writeToNBT(NBTTagCompound tag) { tag.setInteger("Dimension", dimension); tag.setInteger("CenterX", centerX); @@ -124,6 +124,8 @@ public class HeightMapData extends WorldSavedData { result.appendTag(layerData); } tag.setTag("Layers", result); + + return tag; } public void readFromStream(PacketBuffer input) { diff --git a/src/main/java/openblocks/common/IVarioController.java b/src/main/java/openblocks/common/IVarioController.java new file mode 100644 index 00000000..f46a5b0a --- /dev/null +++ b/src/main/java/openblocks/common/IVarioController.java @@ -0,0 +1,34 @@ +package openblocks.common; + +public interface IVarioController { + + public static final IVarioController NULL = new IVarioController() { + + @Override + public void setFrequencies(double toneFrequency, double beepFrequency) {} + + @Override + public void release() {} + + @Override + public void kill() {} + + @Override + public void keepAlive() {} + + @Override + public boolean isValid() { + return false; + } + }; + + public void setFrequencies(double toneFrequency, double beepFrequency); + + public void keepAlive(); + + public void kill(); + + public boolean isValid(); + + public void release(); +} \ No newline at end of file diff --git a/src/main/java/openblocks/common/LuggageDropHandler.java b/src/main/java/openblocks/common/LuggageDropHandler.java index 2d5595dd..3bdd976d 100644 --- a/src/main/java/openblocks/common/LuggageDropHandler.java +++ b/src/main/java/openblocks/common/LuggageDropHandler.java @@ -20,7 +20,7 @@ public class LuggageDropHandler { @SubscribeEvent public void onItemDrop(EntityJoinWorldEvent evt) { - final Entity entity = evt.entity; + final Entity entity = evt.getEntity(); if (entity instanceof EntityItem && shouldPreventDespawn((EntityItem)entity)) { EntityUtils.setEntityInvulnerable(entity, true); } @@ -28,8 +28,8 @@ public class LuggageDropHandler { @SubscribeEvent public void onItemExpire(ItemExpireEvent evt) { - if (shouldPreventDespawn(evt.entityItem)) { - evt.extraLife += 0x12F58BF; + if (shouldPreventDespawn(evt.getEntityItem())) { + evt.setExtraLife(evt.getExtraLife() + 0x12F58BF); evt.setCanceled(true); } } diff --git a/src/main/java/openblocks/common/MagnetWhitelists.java b/src/main/java/openblocks/common/MagnetWhitelists.java index 6d9754d5..1fea1754 100644 --- a/src/main/java/openblocks/common/MagnetWhitelists.java +++ b/src/main/java/openblocks/common/MagnetWhitelists.java @@ -1,20 +1,37 @@ package openblocks.common; -import net.minecraft.block.*; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; import net.minecraft.block.BlockJukebox.TileEntityJukebox; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockStairs; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityBoat; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityMinecart; import net.minecraft.init.Blocks; -import net.minecraft.tileentity.*; -import net.minecraft.util.BlockPos; -import net.minecraft.util.Vec3i; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.tileentity.TileEntityNote; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3i; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.Event; -import openmods.utils.*; +import openmods.utils.ITester; +import openmods.utils.ObjectTester; import openmods.utils.ObjectTester.ClassNameTester; import openmods.utils.ObjectTester.ClassTester; @@ -22,13 +39,11 @@ public class MagnetWhitelists { public final static MagnetWhitelists instance = new MagnetWhitelists(); public static class BlockCoords extends BlockPos { - public final Block block; public final IBlockState blockState; public final World world; - BlockCoords(Block block, IBlockState blockState, World world, Vec3i pos) { + BlockCoords(IBlockState blockState, World world, Vec3i pos) { super(pos); - this.block = block; this.blockState = blockState; this.world = world; } @@ -84,7 +99,7 @@ public class MagnetWhitelists { return new ITester() { @Override public ITester.Result test(BlockCoords o) { - return (o.block == template)? Result.ACCEPT : Result.CONTINUE; + return (o.blockState.getBlock() == template)? Result.ACCEPT : Result.CONTINUE; } }; } @@ -93,7 +108,7 @@ public class MagnetWhitelists { return new ITester() { @Override public ITester.Result test(BlockCoords o) { - return (cls.isInstance(o.block))? Result.ACCEPT : Result.CONTINUE; + return (cls.isInstance(o.blockState.getBlock()))? Result.ACCEPT : Result.CONTINUE; } }; } @@ -107,7 +122,7 @@ public class MagnetWhitelists { blockWhitelist.addTester(new ITester() { @Override public Result test(BlockCoords o) { - float hardness = o.block.getBlockHardness(o.world, o); + float hardness = o.blockState.getBlockHardness(o.world, o); return (hardness < 0)? Result.REJECT : Result.CONTINUE; } }); @@ -115,7 +130,7 @@ public class MagnetWhitelists { blockWhitelist.addTester(new ITester() { @Override public openmods.utils.ITester.Result test(BlockCoords o) { - return o.block.getRenderType() == 0? Result.ACCEPT : Result.CONTINUE; + return o.blockState.getRenderType() == EnumBlockRenderType.MODEL? Result.ACCEPT : Result.CONTINUE; } }); @@ -123,7 +138,7 @@ public class MagnetWhitelists { blockWhitelist.addTester(createBlockClassTester(BlockStairs.class)); blockWhitelist.addTester(createBlockClassTester(BlockFence.class)); blockWhitelist.addTester(createBlockClassTester(BlockFenceGate.class)); - blockWhitelist.addTester(createBlockIdentityTester(Blocks.cactus)); + blockWhitelist.addTester(createBlockIdentityTester(Blocks.CACTUS)); MinecraftForge.EVENT_BUS.post(new BlockRegisterEvent(blockWhitelist)); tileEntityWhitelist @@ -144,13 +159,13 @@ public class MagnetWhitelists { final IBlockState blockState = world.getBlockState(pos); final Block block = blockState.getBlock(); - if (block.isAir(world, pos)) return false; + if (blockState.getBlock().isAir(blockState, world, pos)) return false; if (block instanceof BlockContainer) { TileEntity te = world.getTileEntity(pos); return (te != null)? tileEntityWhitelist.check(te) : false; } - return blockWhitelist.check(new BlockCoords(block, blockState, world, pos)); + return blockWhitelist.check(new BlockCoords(blockState, world, pos)); } } diff --git a/src/main/java/openblocks/common/MapDataBuilder.java b/src/main/java/openblocks/common/MapDataBuilder.java index 4fb8fb78..e024c382 100644 --- a/src/main/java/openblocks/common/MapDataBuilder.java +++ b/src/main/java/openblocks/common/MapDataBuilder.java @@ -1,14 +1,20 @@ package openblocks.common; -import java.util.*; - +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import com.google.common.collect.Queues; +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.Map; +import java.util.PriorityQueue; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; @@ -17,11 +23,6 @@ import openblocks.common.item.ItemEmptyMap; import openblocks.common.item.ItemHeightMap; import openmods.utils.BitSet; -import com.google.common.base.Preconditions; -import com.google.common.collect.Maps; -import com.google.common.collect.Queues; -import com.google.common.collect.Sets; - public class MapDataBuilder { private static final int LAYER_TERRAIN = 0; private static final int LAYER_LIQUIDS = 1; @@ -41,9 +42,9 @@ public class MapDataBuilder { final IBlockState blockState = chunk.getBlockState(pos); final Block block = blockState.getBlock(); - if (block.isAir(world, pos)) return null; + if (block.isAir(blockState, world, pos)) return null; - if (block.getMapColor(blockState) == MapColor.airColor) return null; + if (blockState.getMapColor() == MapColor.AIR) return null; if (MapDataManager.instance.isBlockTransparent(block)) return null; @@ -52,11 +53,11 @@ public class MapDataBuilder { public void average(World world, Chunk chunk, int startX, int startZ, int size) { double groundHeightSum = 0; - int[] groundColors = new int[MapColor.mapColorArray.length]; + int[] groundColors = new int[MapColor.COLORS.length]; double liquidHeightSum = 0; int liquidCount = 0; - int[] liquidColors = new int[MapColor.mapColorArray.length]; + int[] liquidColors = new int[MapColor.COLORS.length]; for (int x = startX; x < startX + size; x++) for (int z = startZ; z < startZ + size; z++) { @@ -70,7 +71,7 @@ public class MapDataBuilder { final BlockPos pos = new BlockPos(x, y, z); IBlockState blockState = getValidBlock(world, chunk, pos); - if (blockState.getBlock().getMaterial().isLiquid()) { + if (blockState.getMaterial().isLiquid()) { if (blockLiquid == null) { blockLiquid = blockState; heightLiquid = pos; @@ -84,13 +85,13 @@ public class MapDataBuilder { if (blockSolid != null && heightSolid != null) { groundHeightSum += heightSolid.getY(); - MapColor color = blockSolid.getBlock().getMapColor(blockSolid); + MapColor color = blockSolid.getMapColor(); groundColors[color.colorIndex]++; } if (blockLiquid != null && heightLiquid != null) { liquidHeightSum += heightLiquid.getY(); - MapColor color = blockLiquid.getBlock().getMapColor(blockLiquid); + MapColor color = blockLiquid.getMapColor(); liquidColors[color.colorIndex]++; liquidCount++; } @@ -120,13 +121,13 @@ public class MapDataBuilder { } public class ChunkJob { - public final ChunkCoordIntPair chunk; + public final ChunkPos chunk; public final int pixelsPerChunk; public final int mapMinX; public final int mapMinY; public final int bitNum; - private ChunkJob(ChunkCoordIntPair chunk, int pixelsPerChunk, int mapMinX, int mapMinY, int bitNum) { + private ChunkJob(ChunkPos chunk, int pixelsPerChunk, int mapMinX, int mapMinY, int bitNum) { this.chunk = chunk; this.pixelsPerChunk = pixelsPerChunk; this.mapMinX = mapMinX; @@ -175,7 +176,7 @@ public class MapDataBuilder { this.data = MapDataManager.getMapData(world, mapId); data.centerX = ((x >> 4) << 4); data.centerZ = ((z >> 4) << 4); - data.dimension = world.provider.getDimensionId(); + data.dimension = world.provider.getDimension(); if (data.layers == null || data.layers.length != LAYER_COUNT) data.layers = new HeightMapData.LayerData[LAYER_COUNT]; @@ -200,7 +201,7 @@ public class MapDataBuilder { public Set createJobs(BitSet finishedChunks) { Preconditions.checkState(data != null, "Invalid usage, load map first"); - Map result = Maps.newHashMap(); + Map result = Maps.newHashMap(); final int blocksPerPixel = (1 << data.scale); final int pixelsPerChunk = 16 / blocksPerPixel; final int chunksPerSide = 64 / pixelsPerChunk; @@ -211,7 +212,7 @@ public class MapDataBuilder { int bitNum = 0; for (int mapX = 0, chunkX = middleChunkX - chunksPerSide / 2; chunkX < middleChunkX + chunksPerSide / 2; mapX += pixelsPerChunk, chunkX++) for (int mapY = 0, chunkZ = middleChunkZ - chunksPerSide / 2; chunkZ < middleChunkZ + chunksPerSide / 2; mapY += pixelsPerChunk, chunkZ++) { - ChunkCoordIntPair chunk = new ChunkCoordIntPair(chunkX, chunkZ); + ChunkPos chunk = new ChunkPos(chunkX, chunkZ); if (!finishedChunks.testBit(bitNum)) { result.put(chunk, new ChunkJob(chunk, pixelsPerChunk, mapX, mapY, bitNum)); } @@ -242,7 +243,7 @@ public class MapDataBuilder { PriorityQueue distances = Queues.newPriorityQueue(); for (ChunkJob job : jobs) { - ChunkCoordIntPair chunk = job.chunk; + ChunkPos chunk = job.chunk; double dx = chunk.getCenterXPos() - x; double dz = chunk.getCenterZPosition() - z; distances.add(new JobDistance(dx * dx + dz * dz, job)); @@ -252,10 +253,11 @@ public class MapDataBuilder { while (!distances.isEmpty()) { JobDistance dist = distances.poll(); ChunkJob job = dist.job; - ChunkCoordIntPair chunkCoord = job.chunk; + ChunkPos chunkCoord = job.chunk; - if (provider.chunkExists(chunkCoord.chunkXPos, chunkCoord.chunkZPos)) { - Chunk chunk = provider.provideChunk(chunkCoord.chunkXPos, chunkCoord.chunkZPos); + // TODO verify, if does not load + Chunk chunk = provider.getLoadedChunk(chunkCoord.chunkXPos, chunkCoord.chunkZPos); + if (chunk != null && !chunk.isEmpty()) { job.mapChunk(world, chunk); return job; } diff --git a/src/main/java/openblocks/common/MapDataManager.java b/src/main/java/openblocks/common/MapDataManager.java index 1f14ea1c..7a30ad8a 100644 --- a/src/main/java/openblocks/common/MapDataManager.java +++ b/src/main/java/openblocks/common/MapDataManager.java @@ -1,21 +1,21 @@ package openblocks.common; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; import gnu.trove.procedure.TIntProcedure; import gnu.trove.set.TIntSet; import gnu.trove.set.hash.TIntHashSet; - import java.util.List; import java.util.Map; import java.util.Set; - import net.minecraft.block.Block; -import net.minecraft.init.Blocks; import net.minecraft.network.PacketBuffer; import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.registry.GameRegistry; import openblocks.Config; import openmods.Log; import openmods.Mods; @@ -24,11 +24,6 @@ import openmods.network.event.EventDirection; import openmods.network.event.NetworkEvent; import openmods.network.event.NetworkEventMeta; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - public class MapDataManager { public abstract static class MapIdRequest extends NetworkEvent { @@ -203,15 +198,11 @@ public class MapDataManager { blockBlacklist = Sets.newIdentityHashSet(); for (String entry : Config.mapBlacklist) { try { - String[] parts = entry.split(":"); - Preconditions.checkState(parts.length == 2); - String modId = parts[0]; - String blockName = parts[1]; - - Block block = GameRegistry.findBlock(modId, blockName); - - if (block != Blocks.air) blockBlacklist.add(block); - else Log.warn("Can't find block %s", entry); + final ResourceLocation loc = new ResourceLocation(entry); + if (Block.REGISTRY.containsKey(loc)) { + Block block = Block.REGISTRY.getObject(loc); + blockBlacklist.add(block); + } else Log.warn("Can't find block %s", loc); } catch (Throwable t) { Log.warn(t, "Invalid entry in map blacklist: %s", entry); } diff --git a/src/main/java/openblocks/common/PedometerHandler.java b/src/main/java/openblocks/common/PedometerHandler.java index e1268767..629b148d 100644 --- a/src/main/java/openblocks/common/PedometerHandler.java +++ b/src/main/java/openblocks/common/PedometerHandler.java @@ -1,28 +1,37 @@ package openblocks.common; +import java.util.concurrent.Callable; +import javax.annotation.Nullable; import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.Vec3; +import net.minecraft.nbt.NBTBase; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -import net.minecraftforge.common.IExtendedEntityProperties; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import openblocks.OpenBlocks; import openmods.OpenMods; public class PedometerHandler { - private static final String PROPERTY_PEDOMETER = "Pedometer"; - - public static class PedometerState implements IExtendedEntityProperties { + public static class PedometerState { private double totalDistance; private long startTicks; - private Vec3 startPos; + private Vec3d startPos; - private Vec3 prevTickPos; + private Vec3d prevTickPos; private long prevTickTime; - private Vec3 lastCheckPos; + private Vec3d lastCheckPos; private long lastCheckTime; @@ -30,12 +39,6 @@ public class PedometerHandler { private boolean isRunning; - @Override - public void saveNBTData(NBTTagCompound compound) {} - - @Override - public void loadNBTData(NBTTagCompound compound) {} - public void reset() { isRunning = false; totalDistance = 0; @@ -48,7 +51,6 @@ public class PedometerHandler { prevTickTime = 0; } - @Override public void init(Entity entity, World world) { lastCheckPos = prevTickPos = startPos = entity.getPositionVector(); lastCheckTime = prevTickTime = startTicks = OpenMods.proxy.getTicks(world); @@ -56,8 +58,8 @@ public class PedometerHandler { } public void update(Entity entity) { - Vec3 currentPosition = entity.getPositionVector(); - Vec3 deltaSinceLastUpdate = currentPosition.subtract(prevTickPos); + Vec3d currentPosition = entity.getPositionVector(); + Vec3d deltaSinceLastUpdate = currentPosition.subtract(prevTickPos); prevTickPos = currentPosition; long currentTime = OpenMods.proxy.getTicks(entity.worldObj); @@ -68,7 +70,7 @@ public class PedometerHandler { double currentSpeed = ticksSinceLastUpdate != 0? distanceSinceLastTick / ticksSinceLastUpdate : 0; totalDistance += distanceSinceLastTick; - Vec3 deltaFromStart = currentPosition.subtract(startPos); + Vec3d deltaFromStart = currentPosition.subtract(startPos); long ticksFromStart = currentTime - startTicks; double distanceFromStart = deltaFromStart.lengthVector(); @@ -93,7 +95,7 @@ public class PedometerHandler { } public static class PedometerData { - public final Vec3 startingPoint; + public final Vec3d startingPoint; public final long totalTime; public final double totalDistance; public final double straightLineDistance; @@ -102,7 +104,7 @@ public class PedometerHandler { public final double currentSpeed; - private PedometerData(Vec3 startingPoint, + private PedometerData(Vec3d startingPoint, long totalTime, double totalDistance, double straightLineDistance, @@ -134,29 +136,61 @@ public class PedometerHandler { } } + private static final ResourceLocation CAPABILITY_KEY = OpenBlocks.location("pedometerState"); + + @CapabilityInject(PedometerState.class) + private static final Capability PEDOMETER_CAPABILITY = null; + + private static class CapabilityInjector { + + @SubscribeEvent + public void attachCapability(AttachCapabilitiesEvent evt) { + evt.addCapability(CAPABILITY_KEY, new ICapabilityProvider() { + + private PedometerState state; + + @Override + public boolean hasCapability(Capability capability, @Nullable EnumFacing facing) { + return capability == PEDOMETER_CAPABILITY; + } + + @Override + @SuppressWarnings("unchecked") + public T getCapability(Capability capability, @Nullable EnumFacing facing) { + if (capability == PEDOMETER_CAPABILITY) { + if (state == null) + state = new PedometerState(); + + return (T)state; + } + + return null; + } + }); + } + } + + public static void registerCapability() { + CapabilityManager.INSTANCE.register(PedometerState.class, new Capability.IStorage() { + @Override + public NBTBase writeNBT(Capability capability, PedometerState instance, EnumFacing side) { + return null; + } + + @Override + public void readNBT(Capability capability, PedometerState instance, EnumFacing side, NBTBase nbt) {} + + }, new Callable() { + @Override + public PedometerState call() throws Exception { + return new PedometerState(); + } + }); + + MinecraftForge.EVENT_BUS.register(new CapabilityInjector()); + } + public static PedometerState getProperty(Entity entity) { - IExtendedEntityProperties property = entity.getExtendedProperties(PROPERTY_PEDOMETER); - - PedometerState state; - if (property instanceof PedometerState) { - state = (PedometerState)property; - } else { - state = new PedometerState(); - entity.registerExtendedProperties(PROPERTY_PEDOMETER, state); - } - return state; - } - - public static void reset(Entity entity) { - PedometerState state = getProperty(entity); - state.reset(); - } - - public static void updatePedometerData(Entity entity) { - IExtendedEntityProperties property = entity.getExtendedProperties(PROPERTY_PEDOMETER); - if (property instanceof PedometerState) { - PedometerState state = (PedometerState)property; - if (state.isRunning) state.update(entity); - } + return entity.getCapability(PEDOMETER_CAPABILITY, EnumFacing.UP); } } diff --git a/src/main/java/openblocks/common/PlayerDeathHandler.java b/src/main/java/openblocks/common/PlayerDeathHandler.java index 842bc168..b0834609 100644 --- a/src/main/java/openblocks/common/PlayerDeathHandler.java +++ b/src/main/java/openblocks/common/PlayerDeathHandler.java @@ -1,24 +1,40 @@ package openblocks.common; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; import java.io.File; import java.lang.ref.WeakReference; -import java.util.*; - +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.GameRules; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.fml.common.eventhandler.*; +import net.minecraftforge.fml.common.eventhandler.ASMEventHandler; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.IEventListener; +import net.minecraftforge.fml.common.eventhandler.ListenerList; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.ReflectionHelper; import openblocks.Config; import openblocks.OpenBlocks; @@ -32,13 +48,8 @@ import openmods.inventory.GenericInventory; import openmods.inventory.legacy.ItemDistribution; import openmods.utils.NbtUtils; import openmods.world.DelayedActionTickHandler; - import org.apache.logging.log4j.Level; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import com.mojang.authlib.GameProfile; - public class PlayerDeathHandler { private static final Comparator SEARCH_COMPARATOR = new Comparator() { @@ -100,30 +111,31 @@ public class PlayerDeathHandler { if (!world.isBlockLoaded(pos)) return false; if (!world.isBlockModifiable(player, pos)) return false; - Block block = world.getBlockState(pos).getBlock(); + IBlockState block = world.getBlockState(pos); return checkBlock(world, pos, block); } - public abstract boolean checkBlock(World world, BlockPos pos, Block block); + public abstract boolean checkBlock(World world, BlockPos pos, IBlockState state); } private static final GravePlacementChecker POLITE = new GravePlacementChecker() { @Override - public boolean checkBlock(World world, BlockPos pos, Block block) { - return (block.isAir(world, pos) || block.isReplaceable(world, pos)); + public boolean checkBlock(World world, BlockPos pos, IBlockState state) { + final Block block = state.getBlock(); + return (block.isAir(state, world, pos) || block.isReplaceable(world, pos)); } }; private static final GravePlacementChecker BRUTAL = new GravePlacementChecker() { @Override - public boolean checkBlock(World world, BlockPos pos, Block block) { - return block.getBlockHardness(world, pos) >= 0 && world.getTileEntity(pos) == null; + public boolean checkBlock(World world, BlockPos pos, IBlockState state) { + return state.getBlockHardness(world, pos) >= 0 && world.getTileEntity(pos) == null; } }; private static class GraveCallable implements Runnable { - private final IChatComponent cause; + private final ITextComponent cause; private final GameProfile stiffId; @@ -143,18 +155,18 @@ public class PlayerDeathHandler { this.exPlayer = new WeakReference(exPlayer); this.stiffId = exPlayer.getGameProfile(); - final IChatComponent day = formatDate(world); - final IChatComponent deathCause = exPlayer.getCombatTracker().getDeathMessage(); - this.cause = new ChatComponentTranslation("openblocks.misc.grave_msg", deathCause, day); + final ITextComponent day = formatDate(world); + final ITextComponent deathCause = exPlayer.getCombatTracker().getDeathMessage(); + this.cause = new TextComponentTranslation("openblocks.misc.grave_msg", deathCause, day); this.loot = ImmutableList.copyOf(loot); } - private static IChatComponent formatDate(World world) { + private static ITextComponent formatDate(World world) { final long time = world.getTotalWorldTime(); final String day = String.format("%.1f", time / 24000.0); - final IChatComponent dayComponent = new ChatComponentText(day); - dayComponent.getChatStyle().setColor(EnumChatFormatting.WHITE).setBold(true); + final ITextComponent dayComponent = new TextComponentString(day); + dayComponent.getStyle().setColor(TextFormatting.WHITE).setBold(true); return dayComponent; } @@ -165,7 +177,7 @@ public class PlayerDeathHandler { meta.setBoolean("Placed", placed); } - private boolean tryPlaceGrave(World world, final BlockPos gravePos, String gravestoneText, IChatComponent deathMessage) { + private boolean tryPlaceGrave(World world, final BlockPos gravePos, String gravestoneText, ITextComponent deathMessage) { world.setBlockState(gravePos, OpenBlocks.Blocks.grave.getDefaultState()); TileEntity tile = world.getTileEntity(gravePos); if (tile == null || !(tile instanceof TileEntityGrave)) { @@ -223,7 +235,7 @@ public class PlayerDeathHandler { final BlockPos under = evt.location.down(); if (Config.graveBase && canSpawnBase(world, player, under)) { - world.setBlockState(under, Blocks.dirt.getDefaultState()); + world.setBlockState(under, Blocks.DIRT.getDefaultState()); } return tryPlaceGrave(world, evt.location, evt.gravestoneText, evt.clickText); @@ -236,13 +248,14 @@ public class PlayerDeathHandler { } private BlockPos findLocation(World world, EntityPlayer player, GravePlacementChecker checker) { - BlockPos searchPos = playerPos; - if (Config.voidGraves && searchPos.getY() == 0) searchPos = searchPos.up(); - + final int limitedPosY = Math.min(Math.max(playerPos.getY(), Config.minGraveY), Config.maxGraveY); + BlockPos searchPos = new BlockPos(playerPos.getX(), limitedPosY, playerPos.getZ()); final int searchSize = Config.graveSpawnRange / 2; for (BlockPos c : getSearchOrder(searchSize)) { final BlockPos tryPos = searchPos.add(c); + final int y = tryPos.getY(); + if (y > Config.maxGraveY || y < Config.minGraveY) continue; if (checker.canPlace(world, player, tryPos)) return tryPos; } @@ -307,12 +320,12 @@ public class PlayerDeathHandler { @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) public void onPlayerDrops(PlayerDropsEvent event) { - World world = event.entityPlayer.worldObj; + World world = event.getEntityPlayer().worldObj; if (world.isRemote) return; if (Config.debugGraves) dumpDebugInfo(event); - final EntityPlayer player = event.entityPlayer; + final EntityPlayer player = event.getEntityPlayer(); if (OpenBlocks.Blocks.grave == null) { Log.log(debugLevel(), "OpenBlocks graves disabled, not placing (player '%s')", player); @@ -329,7 +342,7 @@ public class PlayerDeathHandler { return; } - final List drops = event.drops; + final List drops = event.getDrops(); if (drops.isEmpty()) { Log.log(debugLevel(), "No drops from player '%s', grave will not be spawned'", player); return; @@ -351,9 +364,8 @@ public class PlayerDeathHandler { return; } - drops.clear(); - final List graveLoot = Lists.newArrayList(); + drops.clear(); // will be rebuilt based from event for (GraveDropsEvent.ItemAction entry : dropsEvent.drops) { switch (entry.action) { @@ -375,15 +387,50 @@ public class PlayerDeathHandler { return; } - Log.log(debugLevel(), "Scheduling grave placement for player '%s':'%s' with %d item(s)", player, player.getGameProfile(), graveLoot.size()); + if (!tryConsumeGrave(player, Iterables.concat(graveLoot, drops))) { + Log.log(debugLevel(), "No grave in drops for player '%s', grave will not be spawned'", player); + return; + } + + Log.log(debugLevel(), "Scheduling grave placement for player '%s':'%s' with %d item(s) stored and %d item(s) dropped", + player, player.getGameProfile(), graveLoot.size(), drops.size()); + DelayedActionTickHandler.INSTANCE.addTickCallback(world, new GraveCallable(world, player, graveLoot)); } + // TODO: candidate for scripting + private static boolean tryConsumeGrave(EntityPlayer player, Iterable graveLoot) { + if (!Config.requiresGraveInInv || player.capabilities.isCreativeMode) return true; + + final Item graveItem = Item.getItemFromBlock(OpenBlocks.Blocks.grave); + if (graveItem == null) return true; + + final Iterator lootIter = graveLoot.iterator(); + while (lootIter.hasNext()) { + final EntityItem drop = lootIter.next(); + final ItemStack itemStack = drop.getEntityItem(); + if (itemStack != null && + itemStack.getItem() == graveItem && + itemStack.stackSize > 0) { + + if (--itemStack.stackSize <= 0) { + lootIter.remove(); + } else { + drop.setEntityItemStack(itemStack); + } + + return true; + } + } + + return false; + } + private static void dumpDebugInfo(PlayerDropsEvent event) { - Log.info("Trying to spawn grave for player '%s':'%s'", event.entityPlayer, event.entityPlayer.getGameProfile()); + Log.info("Trying to spawn grave for player '%s':'%s'", event.getEntityPlayer(), event.getEntityPlayer().getGameProfile()); int i = 0; - for (EntityItem e : event.drops) + for (EntityItem e : event.getDrops()) Log.info("\tGrave drop %d: %s -> %s", i++, e.getClass(), e.getEntityItem()); final ListenerList listeners = event.getListenerList(); diff --git a/src/main/java/openblocks/common/PlayerInventoryStore.java b/src/main/java/openblocks/common/PlayerInventoryStore.java index 19dba817..d6c0190c 100644 --- a/src/main/java/openblocks/common/PlayerInventoryStore.java +++ b/src/main/java/openblocks/common/PlayerInventoryStore.java @@ -1,6 +1,15 @@ package openblocks.common; -import java.io.*; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; @@ -8,7 +17,7 @@ import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; - +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -30,13 +39,8 @@ import openblocks.api.InventoryEvent.SubInventory; import openmods.Log; import openmods.inventory.GenericInventory; import openmods.utils.NbtUtils; - import org.apache.commons.lang3.StringUtils; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.mojang.authlib.GameProfile; - public class PlayerInventoryStore { public static final String TAG_PLAYER_UUID = "PlayerUUID"; @@ -165,14 +169,17 @@ public class PlayerInventoryStore { stream.close(); } } catch (IOException e) { - Log.warn("Failed to dump data for player %s, file %s", name, dumpFile.getAbsoluteFile()); + Log.warn(e, "Failed to dump data for player %s, file %s", name, dumpFile.getAbsoluteFile()); } return dumpFile; } private static IInventory loadInventory(NBTTagCompound rootTag) { - if (!rootTag.hasKey(TAG_INVENTORY, Constants.NBT.TAG_COMPOUND)) return null; + if (!rootTag.hasKey(TAG_INVENTORY, Constants.NBT.TAG_COMPOUND)) { + Log.debug("No main inventory found"); + return null; + } NBTTagCompound invTag = rootTag.getCompoundTag(TAG_INVENTORY); GenericInventory result = new GenericInventory("tmp", false, 0); @@ -219,7 +226,7 @@ public class PlayerInventoryStore { stream.close(); } } catch (IOException e) { - Log.warn("Failed to read data from file %s", file.getAbsoluteFile()); + Log.warn(e, "Failed to read data from file %s", file.getAbsoluteFile()); return null; } } @@ -268,7 +275,8 @@ public class PlayerInventoryStore { } public boolean restoreInventory(EntityPlayer player, String fileId) { - LoadedInventories inventories = loadInventories(player.worldObj, fileId); + final LoadedInventories inventories = loadInventories(player.worldObj, fileId); + if (inventories == null) return false; final IInventory main = inventories.mainInventory; if (main != null) { @@ -279,7 +287,7 @@ public class PlayerInventoryStore { for (int i = 0; i < sourceInventorySize; i++) { final ItemStack stack = main.getStackInSlot(i); if (i < targetInventorySize) current.setInventorySlotContents(i, stack); - else player.dropPlayerItemWithRandomChoice(stack, false); + else player.dropItem(stack, false, false); } } @@ -293,16 +301,19 @@ public class PlayerInventoryStore { @SubscribeEvent(priority = EventPriority.HIGH) public void onPlayerDeath(LivingDeathEvent event) { - if (Config.dumpStiffsStuff && (event.entity instanceof EntityPlayerMP) && !(event.entity instanceof FakePlayer)) { - EntityPlayer player = (EntityPlayer)event.entity; - final String playerName = player.getName(); - try { + if (Config.dumpStiffsStuff) { + final Entity rottingMeat = event.getEntity(); + if ((rottingMeat instanceof EntityPlayerMP) && !(rottingMeat instanceof FakePlayer)) { + EntityPlayer player = (EntityPlayer)rottingMeat; + final String playerName = player.getName(); + try { - File file = storePlayerInventory(player, "death"); - Log.info("Storing post-mortem inventory into %s. It can be restored with command '/ob_inventory restore %s %s'", - file.getAbsolutePath(), playerName, stripFilename(file.getName())); - } catch (Exception e) { - Log.severe(e, "Failed to store inventory for player %s", playerName); + File file = storePlayerInventory(player, "death"); + Log.info("Storing post-mortem inventory into %s. It can be restored with command '/ob_inventory restore %s %s'", + file.getAbsolutePath(), playerName, stripFilename(file.getName())); + } catch (Exception e) { + Log.severe(e, "Failed to store inventory for player %s", playerName); + } } } } diff --git a/src/main/java/openblocks/common/RadioVillagerTradeManager.java b/src/main/java/openblocks/common/RadioVillagerTradeManager.java new file mode 100644 index 00000000..c773f12d --- /dev/null +++ b/src/main/java/openblocks/common/RadioVillagerTradeManager.java @@ -0,0 +1,48 @@ +package openblocks.common; + +import java.util.Random; +import net.minecraft.entity.passive.EntityVillager.ITradeList; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import net.minecraftforge.oredict.OreDictionary; +import openblocks.Config; + +@Deprecated +// TODO align to new mechanics +public class RadioVillagerTradeManager implements ITradeList { + + private static ItemStack randomItemAmount(Random random, Item item, int min, int max) { + int amount = random.nextInt(max - min) + min; + return new ItemStack(item, amount); + } + + private static ItemStack randomEmeralds(Random random, int min, int max) { + return randomItemAmount(random, Items.EMERALD, min, max); + } + + @Override + public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random) { + if (Config.radioVillagerRecords) { + for (ItemStack record : OreDictionary.getOres("record")) + if (random.nextFloat() < 0.01) recipeList.add( + new MerchantRecipe( + randomEmeralds(random, 7, 15), + record)); + } + + if (random.nextFloat() > 0.5) recipeList.add( + new MerchantRecipe( + randomEmeralds(random, 1, 2), + new ItemStack(Blocks.NOTEBLOCK))); + + if (random.nextFloat() > 0.25 || recipeList.isEmpty()) recipeList.add( + new MerchantRecipe( + randomEmeralds(random, 3, 7), + new ItemStack(Blocks.JUKEBOX))); + } + +} diff --git a/src/main/java/openblocks/common/ServerProxy.java b/src/main/java/openblocks/common/ServerProxy.java index de6575ab..8b6801e1 100644 --- a/src/main/java/openblocks/common/ServerProxy.java +++ b/src/main/java/openblocks/common/ServerProxy.java @@ -1,6 +1,6 @@ package openblocks.common; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import openblocks.IOpenBlocksProxy; @@ -20,6 +20,11 @@ public class ServerProxy implements IOpenBlocksProxy { public void registerRenderInformation() {} @Override - public void spawnLiquidSpray(World worldObj, FluidStack fluid, double x, double y, double z, float scale, float gravity, Vec3 velocity) {} + public void spawnLiquidSpray(World worldObj, FluidStack fluid, double x, double y, double z, float scale, float gravity, Vec3d velocity) {} + + @Override + public int getParticleSettings() { + return 3; // really no particles + } } diff --git a/src/main/java/openblocks/common/TrophyHandler.java b/src/main/java/openblocks/common/TrophyHandler.java index cd69ca0c..5e067558 100644 --- a/src/main/java/openblocks/common/TrophyHandler.java +++ b/src/main/java/openblocks/common/TrophyHandler.java @@ -1,8 +1,11 @@ package openblocks.common; +import com.google.common.base.Strings; +import com.google.common.base.Supplier; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; import java.util.Map; import java.util.Random; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; @@ -10,8 +13,9 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -19,20 +23,49 @@ import openblocks.Config; import openblocks.OpenBlocks; import openblocks.common.item.ItemTrophyBlock; import openblocks.common.tileentity.TileEntityTrophy; -import openblocks.trophy.*; +import openblocks.trophy.BlazeBehavior; +import openblocks.trophy.CaveSpiderBehavior; +import openblocks.trophy.CreeperBehavior; +import openblocks.trophy.EndermanBehavior; +import openblocks.trophy.GuardianBehavior; +import openblocks.trophy.ITrophyBehavior; +import openblocks.trophy.ItemDropBehavior; +import openblocks.trophy.MooshroomBehavior; +import openblocks.trophy.SkeletonBehavior; +import openblocks.trophy.SnowmanBehavior; +import openblocks.trophy.SquidBehavior; +import openblocks.trophy.WitchBehavior; import openmods.Log; +import openmods.calc.Environment; +import openmods.calc.ExprType; +import openmods.calc.SingleExprEvaluator; +import openmods.calc.SingleExprEvaluator.EnvironmentConfigurator; +import openmods.calc.types.fp.DoubleCalculatorFactory; +import openmods.config.properties.ConfigurationChange; import openmods.reflection.ReflectionHelper; -import com.google.common.base.Strings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; - public class TrophyHandler { - private static final Random DROP_RAND = new Random(); - private static final Map ENTITY_CACHE = Maps.newHashMap(); + private final Random fallbackDropChance = new Random(); + + private final SingleExprEvaluator dropChangeCalculator = SingleExprEvaluator.create(DoubleCalculatorFactory.createDefault()); + + { + updateDropChanceFormula(); + } + + @SubscribeEvent + public void onConfigChange(ConfigurationChange.Post evt) { + if (evt.check("trophy", "trophyDropChanceFormula")) + updateDropChanceFormula(); + } + + private void updateDropChanceFormula() { + dropChangeCalculator.setExpr(ExprType.INFIX, Config.trophyDropChanceFormula); + } + public static Entity getEntityFromCache(Trophy trophy) { Entity entity = ENTITY_CACHE.get(trophy); if (entity == null) { @@ -59,11 +92,11 @@ public class TrophyHandler { public enum Trophy { Wolf(), - Chicken(new ItemDropBehavior(10000, new ItemStack(Items.egg), "mob.chicken.plop")), - Cow(new ItemDropBehavior(20000, new ItemStack(Items.leather))), + Chicken(new ItemDropBehavior(10000, new ItemStack(Items.EGG), SoundEvents.ENTITY_CHICKEN_EGG)), + Cow(new ItemDropBehavior(20000, new ItemStack(Items.LEATHER))), Creeper(new CreeperBehavior()), Skeleton(new SkeletonBehavior()), - PigZombie(new ItemDropBehavior(20000, new ItemStack(Items.gold_nugget))), + PigZombie(new ItemDropBehavior(20000, new ItemStack(Items.GOLD_NUGGET))), Bat(1.0, -0.3), Zombie(), Witch(0.35, new WitchBehavior()), @@ -104,11 +137,12 @@ public class TrophyHandler { MushroomCow(new MooshroomBehavior()), VillagerGolem(0.3), SnowMan(new SnowmanBehavior()), - Pig(new ItemDropBehavior(20000, new ItemStack(Items.porkchop))), + Pig(new ItemDropBehavior(20000, new ItemStack(Items.PORKCHOP))), Endermite(), Guardian(new GuardianBehavior()), - Rabbit(new ItemDropBehavior(20000, new ItemStack(Items.carrot))); + Rabbit(new ItemDropBehavior(20000, new ItemStack(Items.CARROT))); // Skipped: Horse (needs world in ctor), Wither (renders boss bar) + // TODO bear, shulker private double scale = 0.4; private double verticalOffset = 0.0; @@ -201,19 +235,42 @@ public class TrophyHandler { } @SubscribeEvent - public void onLivingDrops(LivingDropsEvent event) { - if (event.recentlyHit && DROP_RAND.nextDouble() < Config.trophyDropChance * event.lootingLevel) { - final Entity entity = event.entity; - String entityName = EntityList.getEntityString(entity); - if (!Strings.isNullOrEmpty(entityName)) { - Trophy mobTrophy = Trophy.TYPES.get(entityName); - if (mobTrophy != null) { - EntityItem drop = new EntityItem(entity.worldObj, entity.posX, entity.posY, entity.posZ, mobTrophy.getItemStack()); - drop.setDefaultPickupDelay(); - event.drops.add(drop); + public void onLivingDrops(final LivingDropsEvent event) { + final Entity entity = event.getEntity(); + if (event.isRecentlyHit() && canDrop(entity)) { + final Double result = dropChangeCalculator.evaluate( + new EnvironmentConfigurator() { + @Override + public void accept(Environment env) { + env.setGlobalSymbol("looting", Double.valueOf(event.getLootingLevel())); + env.setGlobalSymbol("chance", Config.trophyDropChance); + } + }, new Supplier() { + @Override + public Double get() { + final double bias = fallbackDropChance.nextDouble() / 4; + final double selection = fallbackDropChance.nextDouble(); + return (event.getLootingLevel() + bias) * Config.trophyDropChance - selection; + } + }); + + if (result > 0) { + final String entityName = EntityList.getEntityString(entity); + if (!Strings.isNullOrEmpty(entityName)) { + Trophy mobTrophy = Trophy.TYPES.get(entityName); + if (mobTrophy != null) { + EntityItem drop = new EntityItem(entity.worldObj, entity.posX, entity.posY, entity.posZ, mobTrophy.getItemStack()); + drop.setDefaultPickupDelay(); + event.getDrops().add(drop); + } } } } } + private static boolean canDrop(Entity entity) { + final World world = entity.worldObj; + return world != null && world.getGameRules().getBoolean("doMobLoot"); + } + } diff --git a/src/main/java/openblocks/common/Vario.java b/src/main/java/openblocks/common/Vario.java new file mode 100644 index 00000000..c3c3afb2 --- /dev/null +++ b/src/main/java/openblocks/common/Vario.java @@ -0,0 +1,157 @@ +package openblocks.common; + +public class Vario { + + private static final int WATCHDOG_PERIOD = 1000 / 20; // nominal game tick + + private static final int WATCHDOG_TIMEOUT_TICKS = 10; + + private static final int VOL_MIN = 2; + private static final int VOL_MAX = 20; + + public static final Vario instance = new Vario(); + + private int varioVolume = 8; + + private boolean isEnabled; + + private IVarioController activeController = IVarioController.NULL; + + private WatchdogThread watchdogThread; + + private final BeepGenerator beeper = new BeepGenerator(); + + { + setVolume(varioVolume); + } + + private class Controller implements IVarioController { + + private boolean isValid = true; + + @Override + public void setFrequencies(double toneFrequency, double beepFrequency) { + if (isValid) { + beeper.setTargetToneFrequency(toneFrequency); + beeper.setBeepFrequency(beepFrequency); + } + } + + @Override + public synchronized void keepAlive() { + if (isValid) + resetWatchdog(); + } + + @Override + public synchronized void kill() { + if (isValid) + if (watchdogThread != null) watchdogThread.shutdown(); + } + + @Override + public boolean isValid() { + return isValid; + } + + @Override + public void release() { + isValid = false; + } + } + + private class WatchdogThread extends Thread { + + private boolean isAlive = true; + private int watchdogMissedTicks; + + public WatchdogThread() { + setName("Vario watchdog"); + setDaemon(true); + } + + @Override + public void run() { + try { + while (isAlive && isEnabled) { + if (watchdogMissedTicks++ > WATCHDOG_TIMEOUT_TICKS) { + isAlive = false; + break; + } + + if (!beeper.isRunning()) beeper.start(); + + try { + Thread.sleep(WATCHDOG_PERIOD); + } catch (InterruptedException e) { + isAlive = false; + break; + } + } + } finally { + beeper.stop(); + isAlive = false; + } + } + + public boolean isShuttingDown() { + return !isAlive || !isEnabled; + } + + public void shutdown() { + isAlive = false; + } + + public void ping() { + watchdogMissedTicks = 0; + } + } + + public void incVolume() { + varioVolume = Math.min((varioVolume + 2), VOL_MAX); + setVolume(varioVolume); + } + + public void decVolume() { + varioVolume = Math.max((varioVolume - 2), VOL_MIN); + setVolume(varioVolume); + } + + private void setVolume(int volume) { + beeper.setVolume((short)(varioVolume << 8)); + } + + public void enable() { + isEnabled = true; + } + + public void disable() { + isEnabled = false; + } + + public boolean isEnabled() { + return isEnabled; + } + + public void toggle() { + isEnabled = !isEnabled; + } + + public IVarioController acquire() { + if (activeController.isValid()) + activeController.release(); + + return (activeController = new Controller()); + } + + private void resetWatchdog() { + if (isEnabled) { + if (watchdogThread == null || !watchdogThread.isAlive() || watchdogThread.isShuttingDown()) { + watchdogThread = new WatchdogThread(); + watchdogThread.start(); + } else if (watchdogThread != null) { + watchdogThread.ping(); + } + } + } +} diff --git a/src/main/java/openblocks/common/block/BlockAutoAnvil.java b/src/main/java/openblocks/common/block/BlockAutoAnvil.java index 9d11af47..b64ffa2f 100644 --- a/src/main/java/openblocks/common/block/BlockAutoAnvil.java +++ b/src/main/java/openblocks/common/block/BlockAutoAnvil.java @@ -1,8 +1,11 @@ package openblocks.common.block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.util.BlockPos; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import openmods.block.OpenBlock; import openmods.infobook.BookDocumentation; @@ -11,12 +14,12 @@ import openmods.infobook.BookDocumentation; public class BlockAutoAnvil extends OpenBlock.TwoDirections { public BlockAutoAnvil() { - super(Material.anvil); - setStepSound(soundTypeAnvil); + super(Material.ANVIL); + setSoundType(SoundType.ANVIL); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @@ -27,7 +30,7 @@ public class BlockAutoAnvil extends OpenBlock.TwoDirections { // TODO 1.8.9 too trivial to live @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } } diff --git a/src/main/java/openblocks/common/block/BlockAutoEnchantmentTable.java b/src/main/java/openblocks/common/block/BlockAutoEnchantmentTable.java index d7f33987..0f05a1c0 100644 --- a/src/main/java/openblocks/common/block/BlockAutoEnchantmentTable.java +++ b/src/main/java/openblocks/common/block/BlockAutoEnchantmentTable.java @@ -1,13 +1,12 @@ package openblocks.common.block; import java.util.Random; - import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -19,19 +18,30 @@ import openmods.infobook.BookDocumentation; public class BlockAutoEnchantmentTable extends OpenBlock { public BlockAutoEnchantmentTable() { - super(Material.rock); - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + super(Material.ROCK); + } + + protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { + return false; + } + + @Override + public boolean isBlockSolid(IBlockAccess world, BlockPos pos, EnumFacing side) { return false; } @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand) { - super.randomDisplayTick(world, pos, state, rand); + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + super.randomDisplayTick(state, world, pos, rand); for (int x = -2; x <= 2; ++x) { for (int z = -2; z <= 2; ++z) { @@ -41,9 +51,16 @@ public class BlockAutoEnchantmentTable extends OpenBlock { for (int y = 0; y <= 1; ++y) { final BlockPos blockpos = pos.add(x, y, z); - if (world.getBlockState(blockpos).getBlock() == Blocks.bookshelf) { - if (!world.isAirBlock(pos.add(x / 2, 0, z / 2))) break; - world.spawnParticle(EnumParticleTypes.ENCHANTMENT_TABLE, pos.getX() + 0.5D, pos.getY() + 2.0D, pos.getZ() + 0.5D, x + rand.nextFloat() - 0.5D, y - rand.nextFloat() - 1.0F, z + rand.nextFloat() - 0.5D, new int[0]); + if (net.minecraftforge.common.ForgeHooks.getEnchantPower(world, blockpos) > 0) { + if (world.isAirBlock(pos.add(x / 2, 0, z / 2))) { + world.spawnParticle(EnumParticleTypes.ENCHANTMENT_TABLE, + pos.getX() + 0.5D, + pos.getY() + 2.0D, + pos.getZ() + 0.5D, + x + rand.nextFloat() - 0.5D, + y - rand.nextFloat() - 1.0F, + z + rand.nextFloat() - 0.5D); + } } } } @@ -51,9 +68,4 @@ public class BlockAutoEnchantmentTable extends OpenBlock { } } - @Override - public boolean isBlockSolid(IBlockAccess world, BlockPos pos, EnumFacing side) { - return false; - } - } diff --git a/src/main/java/openblocks/common/block/BlockBearTrap.java b/src/main/java/openblocks/common/block/BlockBearTrap.java index 81c8c728..8b72e91a 100644 --- a/src/main/java/openblocks/common/block/BlockBearTrap.java +++ b/src/main/java/openblocks/common/block/BlockBearTrap.java @@ -1,9 +1,13 @@ package openblocks.common.block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityBearTrap; import openmods.block.OpenBlock; @@ -13,43 +17,49 @@ import openmods.infobook.BookDocumentation; public class BlockBearTrap extends OpenBlock.TwoDirections { public BlockBearTrap() { - super(Material.rock); - setBlockBounds(0.1f, 0, 0.1f, 0.9f, 0.4f, 0.9f); + super(Material.ROCK); + } + + protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.1, 0.0, 0.1, 0.9, 0.4, 0.9); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } @Override - public int getRenderType() { - return 2; // TESR only + public boolean isOpaqueCube(IBlockState state) { + return false; } @Override - public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity) { + public boolean isBlockSolid(IBlockAccess world, BlockPos pos, EnumFacing side) { + return false; + } + + @Override + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; + } + + @Override + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) { TileEntityBearTrap te = getTileEntity(world, pos, TileEntityBearTrap.class); if (te != null) te.onEntityCollided(entity); } - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean isFullCube() { - return false; - } - @Override public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side) { return isOnTopOfSolidBlock(world, pos, side); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, BlockPos pos) { + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { TileEntityBearTrap tile = getTileEntity(world, pos, TileEntityBearTrap.class); return tile != null? tile.getComparatorLevel() : 0; } diff --git a/src/main/java/openblocks/common/block/BlockBigButton.java b/src/main/java/openblocks/common/block/BlockBigButton.java index bcff9b34..ffbe5292 100644 --- a/src/main/java/openblocks/common/block/BlockBigButton.java +++ b/src/main/java/openblocks/common/block/BlockBigButton.java @@ -2,9 +2,9 @@ package openblocks.common.block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityBigButton; @@ -16,18 +16,21 @@ import openmods.infobook.BookDocumentation; @BookDocumentation public class BlockBigButton extends OpenBlock.SixDirections { + private static final AxisAlignedBB ACTIVE_AABB = new AxisAlignedBB(0.0625, 0.0625, 0, 0.9375, 0.9375, 0.0625); + private static final AxisAlignedBB INACTIVE_AABB = new AxisAlignedBB(0.0625, 0.0625, 0, 0.9375, 0.9375, 0.125); + public BlockBigButton() { - super(Material.circuits); + super(Material.CIRCUITS); setPlacementMode(BlockPlacementMode.SURFACE); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isFullBlock() { + public boolean isFullBlock(IBlockState state) { return false; } @@ -43,38 +46,29 @@ public class BlockBigButton extends OpenBlock.SixDirections { } @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos) { + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { // TODO 1.8.9 Move pressed state to block state - TileEntityBigButton tile = getTileEntity(world, pos, TileEntityBigButton.class); + TileEntityBigButton tile = getTileEntity(source, pos, TileEntityBigButton.class); - if (tile == null) { return; } + boolean pressed = tile != null && tile.isButtonActive(); + final Orientation orientation = getOrientation(state); - boolean pressed = tile.isButtonActive(); - final Orientation orientation = tile.getOrientation(); - - final AxisAlignedBB aabb = new AxisAlignedBB(0.0625, 0.0625, 0, 0.9375, 0.9375, pressed? 0.0625 : 0.125); - final AxisAlignedBB rotatedAabb = BlockSpaceTransform.instance.mapBlockToWorld(orientation, aabb); - setBlockBounds(rotatedAabb); + return BlockSpaceTransform.instance.mapBlockToWorld(orientation, pressed? ACTIVE_AABB : INACTIVE_AABB); } @Override - public void setBlockBoundsForItemRender() { - setBlockBounds(0.0625f, 0.0625f, 0.4f, 0.9375f, 0.9375f, 0.525f); - } - - @Override - public boolean canProvidePower() { + public boolean canProvidePower(IBlockState state) { return true; } @Override - public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) { + public int getWeakPower(IBlockState blockState, IBlockAccess world, BlockPos pos, EnumFacing side) { TileEntityBigButton te = getTileEntity(world, pos, TileEntityBigButton.class); return te != null && te.isButtonActive()? 15 : 0; } @Override - public int getStrongPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) { + public int getStrongPower(IBlockState blockState, IBlockAccess world, BlockPos pos, EnumFacing side) { EnumFacing direction = side.getOpposite(); TileEntityBigButton button = getTileEntity(world, pos, TileEntityBigButton.class); return (button != null && direction == button.getOrientation().north() && button.isButtonActive())? 15 : 0; diff --git a/src/main/java/openblocks/common/block/BlockBlockBreaker.java b/src/main/java/openblocks/common/block/BlockBlockBreaker.java index 1e669c2e..7cc6dd9d 100644 --- a/src/main/java/openblocks/common/block/BlockBlockBreaker.java +++ b/src/main/java/openblocks/common/block/BlockBlockBreaker.java @@ -8,7 +8,7 @@ import openmods.infobook.BookDocumentation; public class BlockBlockBreaker extends OpenBlock.SixDirections { public BlockBlockBreaker() { - super(Material.rock); + super(Material.ROCK); setPlacementMode(BlockPlacementMode.ENTITY_ANGLE); } diff --git a/src/main/java/openblocks/common/block/BlockBlockPlacer.java b/src/main/java/openblocks/common/block/BlockBlockPlacer.java index 9874fb75..4621c788 100644 --- a/src/main/java/openblocks/common/block/BlockBlockPlacer.java +++ b/src/main/java/openblocks/common/block/BlockBlockPlacer.java @@ -8,7 +8,7 @@ import openmods.infobook.BookDocumentation; public class BlockBlockPlacer extends OpenBlock.SixDirections { public BlockBlockPlacer() { - super(Material.rock); + super(Material.ROCK); } } diff --git a/src/main/java/openblocks/common/block/BlockBuilderGuide.java b/src/main/java/openblocks/common/block/BlockBuilderGuide.java index 427560a8..5736db6f 100644 --- a/src/main/java/openblocks/common/block/BlockBuilderGuide.java +++ b/src/main/java/openblocks/common/block/BlockBuilderGuide.java @@ -1,15 +1,14 @@ package openblocks.common.block; import java.util.Random; - import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.Particle; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -22,13 +21,16 @@ public class BlockBuilderGuide extends BlockGuide { @Override protected boolean areButtonsActive(EntityPlayer player) { - final ItemStack heldItem = player.getHeldItem(); + // TODO 1.10 verify, if it's correct item + final ItemStack heldItem = player.getHeldItemMainhand(); return heldItem == null || !(heldItem.getItem() instanceof ItemBlock); } @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random random) { + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + super.randomDisplayTick(state, world, pos, rand); + final float x = pos.getX() + 0.5f; final float y = pos.getY() + 0.7f; final float z = pos.getZ() + 0.5f; @@ -40,7 +42,7 @@ public class BlockBuilderGuide extends BlockGuide { private static void spawnGreenFlameParticle(float x, float y, float z, EnumParticleTypes particleType) { final Minecraft mc = Minecraft.getMinecraft(); if (mc.gameSettings.particleSetting == 0) { - final EntityFX flame = mc.effectRenderer.spawnEffectParticle(particleType.getParticleID(), x, y, z, 0.0D, 0.0D, 0.0D); + final Particle flame = mc.effectRenderer.spawnEffectParticle(particleType.getParticleID(), x, y, z, 0.0D, 0.0D, 0.0D); if (flame != null) flame.setRBGColorF(0, 1, 1); } } diff --git a/src/main/java/openblocks/common/block/BlockCannon.java b/src/main/java/openblocks/common/block/BlockCannon.java index 6a838f8c..47753e2b 100644 --- a/src/main/java/openblocks/common/block/BlockCannon.java +++ b/src/main/java/openblocks/common/block/BlockCannon.java @@ -2,32 +2,40 @@ package openblocks.common.block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openmods.block.OpenBlock; public class BlockCannon extends OpenBlock { public BlockCannon() { - super(Material.rock); - setBlockBounds(0.3f, 0, 0.3f, 0.6f, 0.7f, 0.7f); + super(Material.ROCK); + } + + protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0.0, 0.3, 0.6, 0.7, 0.7); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state) { - return null; + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return NULL_AABB; } @Override diff --git a/src/main/java/openblocks/common/block/BlockCanvas.java b/src/main/java/openblocks/common/block/BlockCanvas.java index 6426f64e..227dbf4b 100644 --- a/src/main/java/openblocks/common/block/BlockCanvas.java +++ b/src/main/java/openblocks/common/block/BlockCanvas.java @@ -5,8 +5,8 @@ import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumDyeColor; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.OpenBlocks; import openblocks.api.IPaintableBlock; @@ -21,7 +21,7 @@ public class BlockCanvas extends OpenBlock implements IPaintableBlock { // TODO 1.8.9 everything public BlockCanvas() { - this(Material.sponge); + this(Material.SPONGE); } public BlockCanvas(Material material) { @@ -33,7 +33,7 @@ public class BlockCanvas extends OpenBlock implements IPaintableBlock { final Block block = state.getBlock(); final int meta = block.getMetaFromState(state); - final Block toReplace = (block.getMaterial() == Material.glass)? OpenBlocks.Blocks.canvasGlass : OpenBlocks.Blocks.canvas; + final Block toReplace = (state.getMaterial() == Material.GLASS)? OpenBlocks.Blocks.canvasGlass : OpenBlocks.Blocks.canvas; world.setBlockState(pos, toReplace.getDefaultState()); final TileEntityCanvas tile = getTileEntity(world, pos, TileEntityCanvas.class); diff --git a/src/main/java/openblocks/common/block/BlockCanvasGlass.java b/src/main/java/openblocks/common/block/BlockCanvasGlass.java index 53ca3093..3ff9903b 100644 --- a/src/main/java/openblocks/common/block/BlockCanvasGlass.java +++ b/src/main/java/openblocks/common/block/BlockCanvasGlass.java @@ -1,8 +1,9 @@ package openblocks.common.block; import java.util.List; - +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -10,17 +11,17 @@ import net.minecraft.item.ItemStack; public class BlockCanvasGlass extends BlockCanvas { public BlockCanvasGlass() { - super(Material.glass); - setStepSound(soundTypeGlass); + super(Material.GLASS); + setSoundType(SoundType.GLASS); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isFullBlock() { + public boolean isFullBlock(IBlockState state) { return false; } diff --git a/src/main/java/openblocks/common/block/BlockDonationStation.java b/src/main/java/openblocks/common/block/BlockDonationStation.java index 7c24468b..461d98a3 100644 --- a/src/main/java/openblocks/common/block/BlockDonationStation.java +++ b/src/main/java/openblocks/common/block/BlockDonationStation.java @@ -1,23 +1,34 @@ package openblocks.common.block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import openmods.block.OpenBlock; public class BlockDonationStation extends OpenBlock.FourDirections { public BlockDonationStation() { - super(Material.rock); - setBlockBounds(0.2f, 0.25f, 0.2f, 0.8f, 0.85f, 0.8f); + super(Material.ROCK); + } + + protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.2, 0.25, 0.2, 0.8, 0.85, 0.8); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } // TODO 1.8.9 almost forgot about you @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } } diff --git a/src/main/java/openblocks/common/block/BlockDrawingTable.java b/src/main/java/openblocks/common/block/BlockDrawingTable.java index 6d0979ba..b7ef62ad 100644 --- a/src/main/java/openblocks/common/block/BlockDrawingTable.java +++ b/src/main/java/openblocks/common/block/BlockDrawingTable.java @@ -8,7 +8,7 @@ import openmods.infobook.BookDocumentation; public class BlockDrawingTable extends OpenBlock.FourDirections { public BlockDrawingTable() { - super(Material.wood); + super(Material.WOOD); } } diff --git a/src/main/java/openblocks/common/block/BlockElevator.java b/src/main/java/openblocks/common/block/BlockElevator.java index 69e13d63..5e6ab21e 100644 --- a/src/main/java/openblocks/common/block/BlockElevator.java +++ b/src/main/java/openblocks/common/block/BlockElevator.java @@ -1,21 +1,20 @@ package openblocks.common.block; import java.util.Set; - +import javax.annotation.Nullable; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.api.IElevatorBlock; import openmods.block.OpenBlock; import openmods.colors.ColorMeta; @@ -28,7 +27,7 @@ public class BlockElevator extends OpenBlock implements IElevatorBlock { public static final PropertyEnum COLOR = PropertyEnum.create("color", ColorMeta.class); public BlockElevator() { - super(Material.rock); + super(Material.ROCK); } @Override @@ -42,15 +41,11 @@ public class BlockElevator extends OpenBlock implements IElevatorBlock { } @Override - protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { getPropertyOrientation(), COLOR }); + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { getPropertyOrientation(), COLOR }); } - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(IBlockState state) { - return state.getValue(COLOR).rgb; - } + // TODO 1.10 Don't forget those things have colors! @Override public boolean recolorBlock(World world, BlockPos pos, EnumFacing side, EnumDyeColor colour) { @@ -78,10 +73,9 @@ public class BlockElevator extends OpenBlock implements IElevatorBlock { } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { - ItemStack stack = player.getHeldItem(); - if (stack != null) { - Set metas = ColorMeta.fromStack(stack); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { + if (heldItem != null) { + Set metas = ColorMeta.fromStack(heldItem); if (!metas.isEmpty()) { final ColorMeta meta = CollectionUtils.getRandom(metas); return world.setBlockState(pos, state.withProperty(COLOR, meta)); diff --git a/src/main/java/openblocks/common/block/BlockElevatorRotating.java b/src/main/java/openblocks/common/block/BlockElevatorRotating.java index 416d4dd1..dcd3724e 100644 --- a/src/main/java/openblocks/common/block/BlockElevatorRotating.java +++ b/src/main/java/openblocks/common/block/BlockElevatorRotating.java @@ -3,11 +3,11 @@ package openblocks.common.block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.api.IElevatorBlock; @@ -21,13 +21,13 @@ public class BlockElevatorRotating extends OpenBlock.FourDirections implements I public static final PropertyEnum COLOR = PropertyEnum.create("color", ColorMeta.class); public BlockElevatorRotating() { - super(Material.rock); + super(Material.ROCK); setDefaultState(getDefaultState().withProperty(COLOR, ColorMeta.WHITE)); } @Override - protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { getPropertyOrientation(), COLOR }); + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { getPropertyOrientation(), COLOR }); } private static ColorMeta getColorMeta(IBlockAccess world, BlockPos pos) { diff --git a/src/main/java/openblocks/common/block/BlockFan.java b/src/main/java/openblocks/common/block/BlockFan.java index 88f5754e..0a72b92e 100644 --- a/src/main/java/openblocks/common/block/BlockFan.java +++ b/src/main/java/openblocks/common/block/BlockFan.java @@ -1,8 +1,12 @@ package openblocks.common.block; import net.minecraft.block.material.Material; -import net.minecraft.util.BlockPos; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openmods.block.OpenBlock; import openmods.infobook.BookDocumentation; @@ -11,18 +15,24 @@ import openmods.infobook.BookDocumentation; public class BlockFan extends OpenBlock { public BlockFan() { - super(Material.circuits); - setBlockBounds(0.2f, 0, 0.2f, 0.8f, 1.0f, 0.8f); + super(Material.CIRCUITS); + } + + protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.2, 0.0, 0.2, 0.8, 1.0, 0.8); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } // TODO 1.8.9 You know what @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } diff --git a/src/main/java/openblocks/common/block/BlockFlag.java b/src/main/java/openblocks/common/block/BlockFlag.java index cc9d2f3b..73776ba1 100644 --- a/src/main/java/openblocks/common/block/BlockFlag.java +++ b/src/main/java/openblocks/common/block/BlockFlag.java @@ -4,9 +4,10 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockFence; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityFlag; @@ -36,20 +37,20 @@ public class BlockFlag extends OpenBlock.SixDirections { }; public BlockFlag() { - super(Material.circuits); - setupDimensionsFromCenter(0.5f, 0f, 0.5f, 1 / 16f, 1f, 1 / 16f); + super(Material.CIRCUITS); + setPlacementMode(BlockPlacementMode.SURFACE); setInventoryRenderOrientation(Orientation.XN_YN); } // TODO 1.8.9 Ehhh @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @@ -59,23 +60,32 @@ public class BlockFlag extends OpenBlock.SixDirections { } @Override - public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state) { - return null; + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return NULL_AABB; } + private static final AxisAlignedBB MIDDLE_AABB = new AxisAlignedBB(0.5 - (1.0 / 16.0), 0.0, 0.5 - (1.0 / 16.0), 0.5 + (1.0 / 16.0), 0.0 + 1.0, 0.5 + (1.0 / 16.0)); + private static final AxisAlignedBB NS_AABB = new AxisAlignedBB(0.5 - (1.0 / 16.0), 0.0, 0.5 - (5.0 / 16.0), 0.5 + (1.0 / 16.0), 0.0 + 1.0, 0.5 + (5.0 / 16.0)); + private static final AxisAlignedBB WE_AABB = new AxisAlignedBB(0.5 - (5.0 / 16.0), 0.0, 0.5 - (1.0 / 16.0), 0.5 + (5.0 / 16.0), 0.0 + 1.0, 0.5 + (1.0 / 16.0)); + @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos) { - TileEntityFlag flag = getTileEntity(world, pos, TileEntityFlag.class); + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + TileEntityFlag flag = getTileEntity(source, pos, TileEntityFlag.class); if (flag != null) { EnumFacing onSurface = flag.getOrientation().down(); - if (onSurface == EnumFacing.DOWN) { - setupDimensionsFromCenter(0.5f, 0f, 0.5f, 1 / 16f, 1f, 1 / 16f); - } else if (onSurface == EnumFacing.EAST || onSurface == EnumFacing.WEST) { - setupDimensionsFromCenter(0.5f, 0f, 0.5f, 5 / 16f, 1f, 1 / 16f); - } else { - setupDimensionsFromCenter(0.5f, 0f, 0.5f, 1 / 16f, 1f, 5 / 16f); + switch (onSurface) { + case EAST: + case WEST: + return WE_AABB; + case NORTH: + case SOUTH: + return NS_AABB; + default: + return MIDDLE_AABB; } } + + return MIDDLE_AABB; } @Override @@ -96,8 +106,8 @@ public class BlockFlag extends OpenBlock.SixDirections { } @Override - public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighbour) { - super.onNeighborBlockChange(world, pos, state, neighbour); + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + super.neighborChanged(state, world, pos, block); final Orientation orientation = getOrientation(state); if (!isNeighborBlockSolid(world, pos, orientation.down())) world.destroyBlock(pos, true); diff --git a/src/main/java/openblocks/common/block/BlockGoldenEgg.java b/src/main/java/openblocks/common/block/BlockGoldenEgg.java index 6efb2fad..fd91838f 100644 --- a/src/main/java/openblocks/common/block/BlockGoldenEgg.java +++ b/src/main/java/openblocks/common/block/BlockGoldenEgg.java @@ -1,21 +1,23 @@ package openblocks.common.block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumBlockRenderType; import openmods.block.OpenBlock; public class BlockGoldenEgg extends OpenBlock { public BlockGoldenEgg() { - super(Material.ground); + super(Material.GROUND); } @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } } diff --git a/src/main/java/openblocks/common/block/BlockGrave.java b/src/main/java/openblocks/common/block/BlockGrave.java index d29adc27..edbe09a9 100644 --- a/src/main/java/openblocks/common/block/BlockGrave.java +++ b/src/main/java/openblocks/common/block/BlockGrave.java @@ -1,37 +1,43 @@ package openblocks.common.block; import java.util.Random; - import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.Config; import openmods.Log; import openmods.block.OpenBlock; - import org.apache.logging.log4j.Level; public class BlockGrave extends OpenBlock.FourDirections { public BlockGrave() { - super(Material.ground); - setBlockBounds(0, 0, 0, 1f, 0.2f, 1f); + super(Material.GROUND); setResistance(2000.0F); } + protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 0.2, 1.0); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; + } + // TODO 1.8.9 model all the things @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @@ -46,7 +52,7 @@ public class BlockGrave extends OpenBlock.FourDirections { } @Override - public boolean canEntityDestroy(IBlockAccess world, BlockPos pos, Entity entity) { + public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) { return false; } @@ -57,19 +63,19 @@ public class BlockGrave extends OpenBlock.FourDirections { @Override public void breakBlock(World world, BlockPos pos, IBlockState state) { super.breakBlock(world, pos, state); - Log.log(debugLevel(), "Grave @ (%s) dimension = %d destroyed", pos, world.provider.getDimensionId()); + Log.log(debugLevel(), "Grave @ (%s) dimension = %d destroyed", pos, world.provider.getDimension()); } @Override - public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest) { - Log.log(debugLevel(), "Grave @ (%s) dimension = %d destroyed by player %s", pos, world.provider.getDimensionId(), player); - return super.removedByPlayer(world, pos, player, willHarvest); + public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) { + Log.log(debugLevel(), "Grave @ (%s) dimension = %d destroyed by player %s", pos, world.provider.getDimension(), player); + return super.removedByPlayer(state, world, pos, player, willHarvest); } @Override public void onBlockDestroyedByExplosion(World world, BlockPos pos, Explosion explosionIn) { super.onBlockDestroyedByExplosion(world, pos, explosionIn); - Log.log(debugLevel(), "Grave @ (%s) dimension = %d destroyed by explosion", pos, world.provider.getDimensionId()); + Log.log(debugLevel(), "Grave @ (%s) dimension = %d destroyed by explosion", pos, world.provider.getDimension()); } } diff --git a/src/main/java/openblocks/common/block/BlockGuide.java b/src/main/java/openblocks/common/block/BlockGuide.java index cdc8ee52..22a4d99d 100644 --- a/src/main/java/openblocks/common/block/BlockGuide.java +++ b/src/main/java/openblocks/common/block/BlockGuide.java @@ -3,14 +3,20 @@ package openblocks.common.block; import java.util.Map; import java.util.Map.Entry; import java.util.Random; - +import javax.annotation.Nullable; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; -import net.minecraft.util.*; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import net.minecraftforge.fml.relauncher.Side; @@ -19,7 +25,12 @@ import openblocks.common.tileentity.TileEntityGuide; import openmods.api.ISelectionAware; import openmods.block.BlockRotationMode; import openmods.block.OpenBlock; -import openmods.geometry.*; +import openmods.geometry.AabbUtils; +import openmods.geometry.BlockSpaceTransform; +import openmods.geometry.BlockTextureTransform; +import openmods.geometry.BoundingBoxMap; +import openmods.geometry.HalfAxis; +import openmods.geometry.Orientation; import openmods.infobook.BookDocumentation; @BookDocumentation(hasVideo = true) @@ -133,8 +144,8 @@ public class BlockGuide extends OpenBlock implements ISelectionAware { final BoundingBoxMap subBoxes = BoundingBoxMap.create(); - subBoxes.addBox(addButton(face, transform, 1, 7, 4, 7), createRotationManipulator(HalfAxis.NEG_Y)); - subBoxes.addBox(addButton(face, transform, 11, 7, 4, 7), createRotationManipulator(HalfAxis.POS_Y)); + subBoxes.addBox(addButton(face, transform, 1, 3, 4, 11), createRotationManipulator(HalfAxis.NEG_Y)); + subBoxes.addBox(addButton(face, transform, 11, 3, 4, 11), createRotationManipulator(HalfAxis.POS_Y)); subBoxes.addBox(addButton(face, transform, 5, 2, 6, 3), new IShapeManipulator() { @Override @@ -168,33 +179,34 @@ public class BlockGuide extends OpenBlock implements ISelectionAware { } public BlockGuide() { - super(Material.rock); + super(Material.ROCK); setLightLevel(0.6f); setPlacementMode(BlockPlacementMode.SURFACE); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isFullCube() { + public boolean isFullCube(IBlockState state) { return false; } @Override @SideOnly(Side.CLIENT) - public EnumWorldBlockLayer getBlockLayer() { - return EnumWorldBlockLayer.TRANSLUCENT; + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; } @Override - public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos pos) { - return selection != null? selection : super.getSelectedBoundingBox(world, pos); + @SuppressWarnings("deprecation") + public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) { + return selection != null? selection : super.getSelectedBoundingBox(state, world, pos); } - private Map.Entry findClickBox(Vec3 pos) { + private Map.Entry findClickBox(Vec3d pos) { final Entry> sideBox = buttons.findEntryContainingPoint(pos); if (sideBox != null) { final Entry subSideBox = sideBox.getValue().findEntryContainingPoint(pos); @@ -214,11 +226,11 @@ public class BlockGuide extends OpenBlock implements ISelectionAware { @Override public boolean onSelected(World world, BlockPos pos, DrawBlockHighlightEvent evt) { - if (areButtonsActive(evt.player)) { - final Vec3 hitVec = evt.target.hitVec; + if (areButtonsActive(evt.getPlayer())) { + final Vec3d hitVec = evt.getTarget().hitVec; final Orientation orientation = getOrientation(world, pos); - final Vec3 localHit = BlockSpaceTransform.instance.mapWorldToBlock(orientation, hitVec.xCoord - pos.getX(), hitVec.yCoord - pos.getY(), hitVec.zCoord - pos.getZ()); + final Vec3d localHit = BlockSpaceTransform.instance.mapWorldToBlock(orientation, hitVec.xCoord - pos.getX(), hitVec.yCoord - pos.getY(), hitVec.zCoord - pos.getZ()); final Entry clickBox = findClickBox(localHit); selection = clickBox != null? BlockSpaceTransform.instance.mapBlockToWorld(orientation, clickBox.getKey()).offset(pos.getX(), pos.getY(), pos.getZ()) : null; } else selection = null; @@ -227,7 +239,7 @@ public class BlockGuide extends OpenBlock implements ISelectionAware { } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (player instanceof EntityPlayerMP) { final TileEntityGuide guide = getTileEntity(world, pos, TileEntityGuide.class); @@ -236,12 +248,12 @@ public class BlockGuide extends OpenBlock implements ISelectionAware { if (areButtonsActive(playerMP)) { final Orientation orientation = getOrientation(world, pos); - final Vec3 localHit = BlockSpaceTransform.instance.mapWorldToBlock(orientation, hitX, hitY, hitZ); + final Vec3d localHit = BlockSpaceTransform.instance.mapWorldToBlock(orientation, hitX, hitY, hitZ); final Entry clickBox = findClickBox(localHit); if (clickBox != null) return clickBox.getValue().activate(guide, playerMP); } - final ItemStack heldStack = playerMP.getHeldItem(); + final ItemStack heldStack = playerMP.getHeldItemMainhand(); if (heldStack != null) { if (guide.onItemUse(playerMP, heldStack, side, hitX, hitY, hitZ)) return true; } @@ -253,7 +265,7 @@ public class BlockGuide extends OpenBlock implements ISelectionAware { @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random random) { + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { final float x = pos.getX() + 0.5f; final float y = pos.getY() + 0.7f; final float z = pos.getZ() + 0.5f; diff --git a/src/main/java/openblocks/common/block/BlockHeal.java b/src/main/java/openblocks/common/block/BlockHeal.java index ba78a806..fd8be303 100644 --- a/src/main/java/openblocks/common/block/BlockHeal.java +++ b/src/main/java/openblocks/common/block/BlockHeal.java @@ -6,7 +6,7 @@ import openmods.block.OpenBlock; public class BlockHeal extends OpenBlock { public BlockHeal() { - super(Material.rock); + super(Material.ROCK); } } diff --git a/src/main/java/openblocks/common/block/BlockImaginary.java b/src/main/java/openblocks/common/block/BlockImaginary.java index b220d8e3..b9aaac91 100644 --- a/src/main/java/openblocks/common/block/BlockImaginary.java +++ b/src/main/java/openblocks/common/block/BlockImaginary.java @@ -1,96 +1,93 @@ package openblocks.common.block; +import com.google.common.collect.Lists; import java.util.List; - +import javax.annotation.Nullable; +import net.minecraft.block.SoundType; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.util.*; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import openblocks.OpenBlocks.Sounds; import openblocks.common.tileentity.TileEntityImaginary; import openblocks.common.tileentity.TileEntityImaginary.Property; import openmods.block.OpenBlock; -import com.google.common.collect.Lists; - public class BlockImaginary extends OpenBlock { - private static final Material imaginaryMaterial = new Material(MapColor.airColor); + private static final AxisAlignedBB EMPTY_AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0); - public static final SoundType drawingSounds = new SoundType("cloth", 0.5f, 1.0f) { - @Override - public String getBreakSound() { - return "openblocks:crayon.place"; - } + private static final Material IMAGINARY = new Material(MapColor.AIR); - @Override - public String getPlaceSound() { - return "openblocks:crayon.place"; - } - }; + public static final SoundType NOISES_IN_YOUR_HEAD = new SoundType(0.5f, 1.0f, + Sounds.ITEM_CRAYON_PLACE, + Sounds.ITEM_CRAYON_PLACE, + Sounds.ITEM_CRAYON_PLACE, + Sounds.ITEM_CRAYON_PLACE, + Sounds.ITEM_CRAYON_PLACE); public BlockImaginary() { - super(imaginaryMaterial); + super(IMAGINARY); setHardness(0.3f); - stepSound = drawingSounds; + setSoundType(NOISES_IN_YOUR_HEAD); } @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos pos) { + public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) { if (world.isRemote) { TileEntityImaginary te = getTileEntity(world, pos, TileEntityImaginary.class); if (te != null && te.is(Property.SELECTABLE)) return te.getSelectionBox(); } - return new AxisAlignedBB(0, 0, 0, 0, 0, 0); + return EMPTY_AABB; } @Override - public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state) { - return null; + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return NULL_AABB; } @Override - public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB mask, List result, Entity entity) { + public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List collidingBoxes, @Nullable Entity entity) { TileEntityImaginary te = getTileEntity(world, pos, TileEntityImaginary.class); - if (te != null && te.is(Property.SOLID, entity)) te.addCollisions(mask, result); + if (te != null && te.is(Property.SOLID, entity)) te.addCollisions(entityBox, collidingBoxes); } @Override - public void setBlockBoundsBasedOnState(IBlockAccess access, BlockPos pos) { - TileEntityImaginary te = getTileEntity(access, pos, TileEntityImaginary.class); - if (te != null && te.is(Property.SELECTABLE)) { - AxisAlignedBB aabb = te.getBlockBounds(); - minX = aabb.minX; - minY = aabb.minY; - minZ = aabb.minZ; + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + TileEntityImaginary te = getTileEntity(source, pos, TileEntityImaginary.class); + if (te != null && te.is(Property.SELECTABLE)) + return te.getBlockBounds(); - maxX = aabb.maxX; - maxY = aabb.maxY; - maxZ = aabb.maxZ; - } + return EMPTY_AABB; } @Override - public MovingObjectPosition collisionRayTrace(World world, BlockPos pos, Vec3 start, Vec3 end) { + public RayTraceResult collisionRayTrace(IBlockState blockState, World world, BlockPos pos, Vec3d start, Vec3d end) { + // TODO verify if this is needed if (world.isRemote) { TileEntityImaginary te = getTileEntity(world, pos, TileEntityImaginary.class); if (te == null || !te.is(Property.SELECTABLE)) return null; } - return super.collisionRayTrace(world, pos, start, end); + return null; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } diff --git a/src/main/java/openblocks/common/block/BlockItemDropper.java b/src/main/java/openblocks/common/block/BlockItemDropper.java index 839f3c76..efa7fa9a 100644 --- a/src/main/java/openblocks/common/block/BlockItemDropper.java +++ b/src/main/java/openblocks/common/block/BlockItemDropper.java @@ -8,7 +8,7 @@ import openmods.infobook.BookDocumentation; public class BlockItemDropper extends OpenBlock { public BlockItemDropper() { - super(Material.rock); + super(Material.ROCK); } } diff --git a/src/main/java/openblocks/common/block/BlockLadder.java b/src/main/java/openblocks/common/block/BlockLadder.java index 1877036b..5a8930cc 100644 --- a/src/main/java/openblocks/common/block/BlockLadder.java +++ b/src/main/java/openblocks/common/block/BlockLadder.java @@ -1,85 +1,28 @@ package openblocks.common.block; import net.minecraft.block.BlockTrapDoor; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import openmods.infobook.BookDocumentation; @BookDocumentation(hasVideo = true) public class BlockLadder extends BlockTrapDoor { - public static boolean disableValidation = false; - public BlockLadder() { - super(Material.wood); + super(Material.WOOD); setHardness(3.0F); - setStepSound(soundTypeWood); - setBlockBounds(0f, 0f, 0f, 1.5f, 1f, 1.5f); + setSoundType(SoundType.WOOD); } - @Override - public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state) { - setBlockBoundsBasedOnState(world, pos); - return super.getCollisionBoundingBox(world, pos, state); - } + // TODO verify if it's still flushed @Override - @SideOnly(Side.CLIENT) - public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos pos) { - setBlockBoundsBasedOnState(world, pos); - return super.getSelectedBoundingBox(world, pos); - } - - @Override - public void setBounds(IBlockState state) { - float f = 0.125f; - final boolean isOpen = state.getValue(BlockTrapDoor.OPEN); - // TODO 1.8.9 verify - if (isOpen) { - switch (state.getValue(BlockTrapDoor.FACING)) { - case NORTH: - setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); - break; - - case SOUTH: - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); - break; - - case WEST: - setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - break; - - case EAST: - default: - setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); - break; - } - } else { - final DoorHalf half = state.getValue(BlockTrapDoor.HALF); - if (half == BlockTrapDoor.DoorHalf.TOP) setBlockBounds(0.0F, 1.0F - f, 0.0F, 1.0F, 1.0F, 1.0F); - else setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); - } - } - - @Override - public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { + public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return world.getBlockState(pos).getValue(BlockTrapDoor.OPEN); } - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public int getRenderType() { - return 0; - } } diff --git a/src/main/java/openblocks/common/block/BlockPaintCan.java b/src/main/java/openblocks/common/block/BlockPaintCan.java index c0702fb0..564d0827 100644 --- a/src/main/java/openblocks/common/block/BlockPaintCan.java +++ b/src/main/java/openblocks/common/block/BlockPaintCan.java @@ -1,19 +1,29 @@ package openblocks.common.block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import openmods.block.OpenBlock; public class BlockPaintCan extends OpenBlock.FourDirections { public BlockPaintCan() { - super(Material.rock); + super(Material.ROCK); setHardness(0); setPlacementMode(BlockPlacementMode.ENTITY_ANGLE); - setBlockBounds(0.25f, 0f, 0.25f, 0.7f, 0.6875f, 0.75f); + } + + protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.0, 0.25, 0.7, 0.6875, 0.75); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } diff --git a/src/main/java/openblocks/common/block/BlockPaintMixer.java b/src/main/java/openblocks/common/block/BlockPaintMixer.java index b7e66bc9..6b78f678 100644 --- a/src/main/java/openblocks/common/block/BlockPaintMixer.java +++ b/src/main/java/openblocks/common/block/BlockPaintMixer.java @@ -1,6 +1,11 @@ package openblocks.common.block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import openmods.block.OpenBlock; import openmods.infobook.BookDocumentation; @@ -8,18 +13,24 @@ import openmods.infobook.BookDocumentation; public class BlockPaintMixer extends OpenBlock.FourDirections { public BlockPaintMixer() { - super(Material.rock); - setBlockBounds(0.125f, 0f, 0.125f, 0.875f, 1f, 0.875f); + super(Material.ROCK); + } + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.125, 0.0, 0.125, 0.875, 1.0, 0.875); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } // TODO 1.8.9 got you now! @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } } diff --git a/src/main/java/openblocks/common/block/BlockPath.java b/src/main/java/openblocks/common/block/BlockPath.java index cabccb88..9cecd8c8 100644 --- a/src/main/java/openblocks/common/block/BlockPath.java +++ b/src/main/java/openblocks/common/block/BlockPath.java @@ -3,9 +3,10 @@ package openblocks.common.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openmods.block.OpenBlock; import openmods.infobook.BookDocumentation; @@ -14,18 +15,24 @@ import openmods.infobook.BookDocumentation; public class BlockPath extends OpenBlock { public BlockPath() { - super(Material.ground); - setBlockBounds(0, 0, 0, 1f, 0.1f, 1f); + super(Material.GROUND); + } + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 0.1, 1.0); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockPos, IBlockState state) { - return null; + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return NULL_AABB; } @Override @@ -34,7 +41,7 @@ public class BlockPath extends OpenBlock { } @Override - public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) { + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighbour) { if (!world.isRemote && !isNeighborBlockSolid(world, pos, EnumFacing.DOWN)) { world.destroyBlock(pos, true); } diff --git a/src/main/java/openblocks/common/block/BlockProjector.java b/src/main/java/openblocks/common/block/BlockProjector.java index a26b57dc..685f1169 100644 --- a/src/main/java/openblocks/common/block/BlockProjector.java +++ b/src/main/java/openblocks/common/block/BlockProjector.java @@ -1,27 +1,88 @@ package openblocks.common.block; import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import openblocks.Config; import openmods.block.OpenBlock; public class BlockProjector extends OpenBlock { + public static final int META_BIT_ACTIVE = 0; + + private static final float SLAB_HEIGHT = 0.5F; + + private static final int MIN_LIGHT_LEVEL = 0; + private static final int MAX_LIGHT_LEVEL = 15; + private static final String CONE_ICON = "openblocks:projector_cone" + (Config.renderHoloGrid? "_grid" : ""); + + public static final PropertyBool ACTIVE = PropertyBool.create("active"); + + private static final int MASK_ACTIVE = 1; + public BlockProjector() { - super(Material.iron); - setBlockBounds(0, 0, 0, 1, 0.5f, 1); + super(Material.IRON); + setDefaultState(getDefaultState().withProperty(ACTIVE, false)); } @Override - public boolean isOpaqueCube() { + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { getPropertyOrientation(), ACTIVE }); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState() + .withProperty(ACTIVE, (meta & MASK_ACTIVE) != 0); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(ACTIVE)? MASK_ACTIVE : 0; + } + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, SLAB_HEIGHT, 1.0); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; + } + + @Override + public int getLightValue(IBlockState state) { + if (state.getValue(ACTIVE)) + return Math.min(Math.max(MIN_LIGHT_LEVEL, Config.projectorLightLevelValue), MAX_LIGHT_LEVEL); + + return 0; + } + + @Override + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isBlockNormalCube() { + public boolean isBlockNormalCube(IBlockState state) { return false; } @Override - public boolean isFullBlock() { + public boolean isFullBlock(IBlockState state) { return false; } + + // TODO 1.10 figure rendering of this thing. Duh + @Override + @SideOnly(Side.CLIENT) + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; + } } diff --git a/src/main/java/openblocks/common/block/BlockRopeLadder.java b/src/main/java/openblocks/common/block/BlockRopeLadder.java index b8e2846d..a6966576 100644 --- a/src/main/java/openblocks/common/block/BlockRopeLadder.java +++ b/src/main/java/openblocks/common/block/BlockRopeLadder.java @@ -2,17 +2,19 @@ package openblocks.common.block; import java.util.List; import java.util.Random; - +import javax.annotation.Nullable; import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.Config; @@ -25,18 +27,15 @@ import openmods.utils.BlockManipulator; @BookDocumentation public class BlockRopeLadder extends OpenBlock.FourDirections { - public static final float RENDER_THICKNESS = 1.0f / 64.0f; - private static final float COLLISION_THICKNESS = 1.0f / 16.0f; - public BlockRopeLadder() { - super(Material.circuits); + super(Material.CIRCUITS); setHardness(0.4F); - setStepSound(soundTypeLadder); + setSoundType(SoundType.LADDER); setPlacementMode(BlockPlacementMode.SURFACE); } @Override - public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { + public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; } @@ -46,33 +45,30 @@ public class BlockRopeLadder extends OpenBlock.FourDirections { } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB mask, List result, Entity entity) { + @SuppressWarnings("deprecation") + public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List collidingBoxes, @Nullable Entity entity) { if (entity instanceof EntityLivingBase) { Orientation orientation = getOrientation(world, pos); EnumFacing playerRotation = ((EntityLivingBase)entity).getHorizontalFacing(); if (orientation.north() == playerRotation) { - super.addCollisionBoxesToList(world, pos, state, mask, result, entity); + super.addCollisionBoxToList(state, world, pos, entityBox, collidingBoxes, entity); } } else { - super.addCollisionBoxesToList(world, pos, state, mask, result, entity); + super.addCollisionBoxToList(state, world, pos, entityBox, collidingBoxes, entity); } } - @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos) { - getBlockBounds(world, pos, COLLISION_THICKNESS); - } + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, 1.0f / 16.0f); - private void getBlockBounds(IBlockAccess world, BlockPos pos, float thickness) { - final Orientation orientation = getOrientation(world, pos); - final AxisAlignedBB aabb = new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, thickness); - final AxisAlignedBB rotatedAabb = BlockSpaceTransform.instance.mapBlockToWorld(orientation, aabb); - setBlockBounds(rotatedAabb); + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + final Orientation orientation = getOrientation(source, pos); + return BlockSpaceTransform.instance.mapBlockToWorld(orientation, AABB); } @Override @@ -81,10 +77,11 @@ public class BlockRopeLadder extends OpenBlock.FourDirections { } @Override - public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighbour) { + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighbour) { final EnumFacing dir = getOrientation(state).north(); if (world.isAirBlock(pos.offset(dir))) { + // TODO 1.10 verify if it still drops if (world.getBlockState(pos.up()).getBlock() != this) world.setBlockToAir(pos); } } @@ -115,10 +112,10 @@ public class BlockRopeLadder extends OpenBlock.FourDirections { final BlockManipulator manipulator = new BlockManipulator(world, player, pos); // TODO 1.8.9 verify place direction - if (world.isAirBlock(placePos) && manipulator.place(state, orientation.north())) { + // TODO 1.10 verify handness + if (world.isAirBlock(placePos) && manipulator.place(state, orientation.north(), EnumHand.MAIN_HAND)) { if (!Config.infiniteLadder) stack.stackSize--; - } - else return; + } else return; placePos = placePos.down(); } diff --git a/src/main/java/openblocks/common/block/BlockScaffolding.java b/src/main/java/openblocks/common/block/BlockScaffolding.java index 8538f10a..64fac9fd 100644 --- a/src/main/java/openblocks/common/block/BlockScaffolding.java +++ b/src/main/java/openblocks/common/block/BlockScaffolding.java @@ -1,12 +1,11 @@ package openblocks.common.block; import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -18,13 +17,13 @@ import openmods.infobook.BookDocumentation; @BookDocumentation public class BlockScaffolding extends OpenBlock { public BlockScaffolding() { - super(Material.cloth); + super(Material.CLOTH); setTickRandomly(true); setHardness(0.1F); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @@ -37,14 +36,15 @@ public class BlockScaffolding extends OpenBlock { @Override @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess world, BlockPos pos, EnumFacing side) { + @SuppressWarnings("deprecation") + public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { // Code adapted from BlockBreakable - final IBlockState iblockstate = world.getBlockState(pos); + final IBlockState iblockstate = blockAccess.getBlockState(pos); final Block block = iblockstate.getBlock(); - if (world.getBlockState(pos.offset(side.getOpposite())) != iblockstate) return true; + if (blockAccess.getBlockState(pos.offset(side.getOpposite())) != iblockstate) return true; if (block == this) return false; - return super.shouldSideBeRendered(world, pos, side); + return super.shouldSideBeRendered(iblockstate, blockAccess, pos, side); } } diff --git a/src/main/java/openblocks/common/block/BlockSky.java b/src/main/java/openblocks/common/block/BlockSky.java index 2bdbca6d..c9ed3c07 100644 --- a/src/main/java/openblocks/common/block/BlockSky.java +++ b/src/main/java/openblocks/common/block/BlockSky.java @@ -1,20 +1,16 @@ package openblocks.common.block; import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import openmods.block.OpenBlock; import openmods.infobook.BookDocumentation; -import openmods.utils.render.RenderUtils; @BookDocumentation(customName = "sky.normal") public class BlockSky extends OpenBlock { @@ -33,13 +29,13 @@ public class BlockSky extends OpenBlock { } public BlockSky() { - super(Material.iron); + super(Material.IRON); setDefaultState(getDefaultState().withProperty(POWERED, false)); } @Override - protected BlockState createBlockState() { - return new BlockState(this, getPropertyOrientation(), INVERTED, POWERED); + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, getPropertyOrientation(), INVERTED, POWERED); } @Override @@ -57,15 +53,11 @@ public class BlockSky extends OpenBlock { return isPowered | isInverted; } - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() { - // randomness more or less intended - return RenderUtils.getFogColor().getColor(); - } + // TODO 1.10 rendering! + // return RenderUtils.getFogColor().getColor(); @Override - public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) { + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighbour) { if (!world.isRemote) { final boolean isPowered = world.isBlockIndirectlyGettingPowered(pos) > 0; final boolean isActive = state.getValue(POWERED); @@ -88,9 +80,9 @@ public class BlockSky extends OpenBlock { } @Override - public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos pos) { - final IBlockState state = world.getBlockState(pos); - return isActive(state)? EMPTY : super.getSelectedBoundingBox(world, pos); + @SuppressWarnings("deprecation") + public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) { + return isActive(state)? EMPTY : super.getSelectedBoundingBox(state, world, pos); } } diff --git a/src/main/java/openblocks/common/block/BlockSponge.java b/src/main/java/openblocks/common/block/BlockSponge.java index 20dc4be0..6dd24dbc 100644 --- a/src/main/java/openblocks/common/block/BlockSponge.java +++ b/src/main/java/openblocks/common/block/BlockSponge.java @@ -1,15 +1,15 @@ package openblocks.common.block; import java.util.Random; - import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.Config; import openmods.block.OpenBlock; @@ -22,14 +22,14 @@ public class BlockSponge extends OpenBlock { private static final Random RANDOM = new Random(); public BlockSponge() { - super(Material.sponge); - setStepSound(soundTypeCloth); + super(Material.SPONGE); + setSoundType(SoundType.CLOTH); setTickRandomly(true); setHarvestLevel("axe", 1); } @Override - public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) { + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighbour) { clearupLiquid(world, pos); } @@ -57,10 +57,10 @@ public class BlockSponge extends OpenBlock { for (int dy = -Config.spongeRange; dy <= Config.spongeRange; dy++) { for (int dz = -Config.spongeRange; dz <= Config.spongeRange; dz++) { final BlockPos workPos = pos.add(dx, dy, dz); - Block block = world.getBlockState(workPos).getBlock(); - Material material = block.getMaterial(); + final IBlockState state = world.getBlockState(workPos); + Material material = state.getMaterial(); if (material.isLiquid()) { - hitLava |= material == Material.lava; + hitLava |= material == Material.LAVA; world.setBlockToAir(pos); } } @@ -70,7 +70,7 @@ public class BlockSponge extends OpenBlock { } @Override - public boolean onBlockEventReceived(World world, BlockPos pos, IBlockState state, int eventId, int eventParam) { + public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) { if (world.isRemote) { for (int i = 0; i < 20; i++) { double px = pos.getX() + RANDOM.nextDouble() * 0.1; @@ -79,7 +79,7 @@ public class BlockSponge extends OpenBlock { world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, px, py, pz, 0.0D, 0.0D, 0.0D); } } else { - world.setBlockState(pos, Blocks.fire.getDefaultState()); + world.setBlockState(pos, Blocks.FIRE.getDefaultState()); } return true; } diff --git a/src/main/java/openblocks/common/block/BlockSprinkler.java b/src/main/java/openblocks/common/block/BlockSprinkler.java index 242f0faf..e7d639e1 100644 --- a/src/main/java/openblocks/common/block/BlockSprinkler.java +++ b/src/main/java/openblocks/common/block/BlockSprinkler.java @@ -2,10 +2,12 @@ package openblocks.common.block; import net.minecraft.block.BlockLiquid; import net.minecraft.block.material.Material; -import net.minecraft.block.state.BlockState; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntitySprinkler; @@ -17,37 +19,40 @@ import openmods.infobook.BookDocumentation; @BookDocumentation public class BlockSprinkler extends OpenBlock.TwoDirections { + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0.0, 0.0, 0.7, 0.3, 1.0); + public BlockSprinkler() { - super(Material.water); + super(Material.WATER); setDefaultState(getDefaultState().withProperty(BlockLiquid.LEVEL, 1)); } @Override - protected BlockState createBlockState() { + protected BlockStateContainer createBlockState() { // 1.8.9 Hack, crashes otherwise - return new BlockState(this, getPropertyOrientation(), BlockLiquid.LEVEL); + return new BlockStateContainer(this, getPropertyOrientation(), BlockLiquid.LEVEL); } // TODO 1.8.9 room for improvments? @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } + // TODO 1.10 orientation to block state? @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos) { - TileEntitySprinkler sprinkler = getTileEntity(world, pos, TileEntitySprinkler.class); + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + TileEntitySprinkler sprinkler = getTileEntity(source, pos, TileEntitySprinkler.class); if (sprinkler != null) { final Orientation orientation = sprinkler.getOrientation(); - final AxisAlignedBB aabb = new AxisAlignedBB(0.3, 0.0, 0.0, 0.7, 0.3, 1.0); - final AxisAlignedBB rotatedAabb = BlockSpaceTransform.instance.mapBlockToWorld(orientation, aabb); - setBlockBounds(rotatedAabb); + return BlockSpaceTransform.instance.mapBlockToWorld(orientation, AABB); } + + return AABB; } @Override @@ -57,7 +62,7 @@ public class BlockSprinkler extends OpenBlock.TwoDirections { } @Override - public boolean isReplaceable(World world, BlockPos pos) { + public boolean isReplaceable(IBlockAccess world, BlockPos pos) { return false; } } diff --git a/src/main/java/openblocks/common/block/BlockTank.java b/src/main/java/openblocks/common/block/BlockTank.java index 2bb91a65..c45a920e 100644 --- a/src/main/java/openblocks/common/block/BlockTank.java +++ b/src/main/java/openblocks/common/block/BlockTank.java @@ -1,16 +1,16 @@ package openblocks.common.block; import java.util.List; - import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; @@ -30,23 +30,24 @@ import openmods.utils.ItemUtils; public class BlockTank extends OpenBlock { public BlockTank() { - super(Material.rock); + super(Material.ROCK); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public int getLightValue(IBlockAccess world, BlockPos pos) { + public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) { if (!Config.tanksEmitLight) return 0; + TileEntityTank tile = getTileEntity(world, pos, TileEntityTank.class); return tile != null? tile.getFluidLightLevel() : 0; } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) { + public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { ItemStack result = new ItemStack(this); TileEntityTank tile = getTileEntity(world, pos, TileEntityTank.class); if (tile != null) { @@ -63,12 +64,12 @@ public class BlockTank extends OpenBlock { } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, BlockPos pos) { + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { TileEntityTank tile = getTileEntity(world, pos, TileEntityTank.class); double value = tile.getFluidRatio() * 15; if (value == 0) return 0; diff --git a/src/main/java/openblocks/common/block/BlockTarget.java b/src/main/java/openblocks/common/block/BlockTarget.java index 4be54d79..ec62b06d 100644 --- a/src/main/java/openblocks/common/block/BlockTarget.java +++ b/src/main/java/openblocks/common/block/BlockTarget.java @@ -4,7 +4,11 @@ import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.util.*; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityTarget; @@ -14,39 +18,39 @@ import openmods.geometry.Orientation; public class BlockTarget extends OpenBlock.FourDirections { + private static final AxisAlignedBB FOLDED_AABB = new AxisAlignedBB(0, 0, 0, 1.0f, 0.1f, 1.0f); + private static final AxisAlignedBB DEPLOYED_AABB = new AxisAlignedBB(0.0, 0.0, 0.9, 1.0, 1.0, 1.0); private int lastEntityHit = 0; public BlockTarget() { - super(Material.rock); + super(Material.ROCK); setLightLevel(0.3f); } // TODO 1.8.9 loooks like it @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity) { - + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) { if (!world.isRemote && entity != null && entity instanceof EntityArrow) { if (lastEntityHit != entity.getEntityId()) { lastEntityHit = entity.getEntityId(); return; } lastEntityHit = entity.getEntityId(); - onTargetHit(world, pos, new Vec3(entity.posX, entity.posY, entity.posZ)); + onTargetHit(world, pos, new Vec3d(entity.posX, entity.posY, entity.posZ)); } } - public void onTargetHit(World world, BlockPos pos, Vec3 entityPosition) { - + public void onTargetHit(World world, BlockPos pos, Vec3d entityPosition) { if (world.isRemote) return; final TileEntityTarget target = getTileEntity(world, pos, TileEntityTarget.class); @@ -67,7 +71,7 @@ public class BlockTarget extends OpenBlock.FourDirections { double centerY = pos.getY() + 0.55 + (opposite.getFrontOffsetY() * 0.45); double centerZ = pos.getZ() + 0.5 + (opposite.getFrontOffsetZ() * 0.5); - final Vec3 bullseye = new Vec3(centerX, centerY, centerZ); + final Vec3d bullseye = new Vec3d(centerX, centerY, centerZ); double distance = entityPosition.distanceTo(bullseye); @@ -76,32 +80,28 @@ public class BlockTarget extends OpenBlock.FourDirections { } @Override - public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) { - final TileEntityTarget tile = getTileEntity(world, pos, TileEntityTarget.class); + public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { + final TileEntityTarget tile = getTileEntity(blockAccess, pos, TileEntityTarget.class); return tile != null? tile.getStrength() : 0; } @Override - public int getStrongPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) { + public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { // TODO Side-aware? - return getWeakPower(world, pos, state, side); + return getWeakPower(blockState, blockAccess, pos, side); } @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos) { + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + final TileEntityTarget target = getTileEntity(source, pos, TileEntityTarget.class); - final TileEntityTarget target = getTileEntity(world, pos, TileEntityTarget.class); - - if (!target.isEnabled()) { - setBlockBounds(0, 0, 0, 1.0f, 0.1f, 1.0f); - return; + if (target.isEnabled()) { + final Orientation orientation = target.getOrientation(); + return BlockSpaceTransform.instance.mapBlockToWorld(orientation, DEPLOYED_AABB); + } else { + return FOLDED_AABB; } - final Orientation orientation = target.getOrientation(); - - final AxisAlignedBB aabb = new AxisAlignedBB(0.0, 0.0, 0.9, 1.0, 1.0, 1.0); - final AxisAlignedBB rotatedAabb = BlockSpaceTransform.instance.mapBlockToWorld(orientation, aabb); - setBlockBounds(rotatedAabb); } @Override diff --git a/src/main/java/openblocks/common/block/BlockTrophy.java b/src/main/java/openblocks/common/block/BlockTrophy.java index 6dd08aa6..336598b5 100644 --- a/src/main/java/openblocks/common/block/BlockTrophy.java +++ b/src/main/java/openblocks/common/block/BlockTrophy.java @@ -1,17 +1,27 @@ package openblocks.common.block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import openmods.block.OpenBlock; public class BlockTrophy extends OpenBlock.FourDirections { public BlockTrophy() { - super(Material.rock); - setBlockBounds(0.2f, 0, 0.2f, 0.8f, 0.2f, 0.8f); + super(Material.ROCK); + } + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.2, 0.0, 0.2, 0.8, 0.2, 0.8); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } diff --git a/src/main/java/openblocks/common/block/BlockVacuumHopper.java b/src/main/java/openblocks/common/block/BlockVacuumHopper.java index 95b98fba..26150f93 100644 --- a/src/main/java/openblocks/common/block/BlockVacuumHopper.java +++ b/src/main/java/openblocks/common/block/BlockVacuumHopper.java @@ -3,8 +3,10 @@ package openblocks.common.block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityVacuumHopper; import openmods.block.OpenBlock; @@ -13,24 +15,38 @@ import openmods.infobook.BookDocumentation; @BookDocumentation public class BlockVacuumHopper extends OpenBlock { + private static final AxisAlignedBB SELECTION_AABB = new AxisAlignedBB(0.3, 0.3, 0.3, 0.7, 0.7, 0.7); + private static final AxisAlignedBB COLLISION_AABB = new AxisAlignedBB(0.01, 0.01, 0.01, 0.99, 0.99, 0.99); + public BlockVacuumHopper() { - super(Material.rock); + super(Material.ROCK); + } + + private static final AxisAlignedBB STANDARD_AABB = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return STANDARD_AABB; + } + + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return COLLISION_AABB; + } + + @Override + public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) { + return SELECTION_AABB; } // TODO 1.8.9 hello states @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state) { - return new AxisAlignedBB(pos.getX() + 0.01, pos.getY() + 0.01, pos.getZ() + 0.01, - pos.getX() + 0.99, pos.getY() + 0.99, pos.getZ() + 0.99); - } - - @Override - public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity) { + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) { TileEntityVacuumHopper te = getTileEntity(world, pos, TileEntityVacuumHopper.class); if (te != null) { te.onEntityCollidedWithBlock(entity); @@ -38,14 +54,8 @@ public class BlockVacuumHopper extends OpenBlock { } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } - @Override - public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos pos) { - return new AxisAlignedBB(pos.getX() + 0.3, pos.getY() + 0.3, pos.getZ() + 0.3, - pos.getX() + 0.7, pos.getY() + 0.7, pos.getZ() + 0.7); - } - } diff --git a/src/main/java/openblocks/common/block/BlockVillageHighlighter.java b/src/main/java/openblocks/common/block/BlockVillageHighlighter.java index 0de8f60a..c0b0b981 100644 --- a/src/main/java/openblocks/common/block/BlockVillageHighlighter.java +++ b/src/main/java/openblocks/common/block/BlockVillageHighlighter.java @@ -2,8 +2,9 @@ package openblocks.common.block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import openblocks.common.tileentity.TileEntityVillageHighlighter; import openmods.block.OpenBlock; @@ -13,29 +14,29 @@ import openmods.infobook.BookDocumentation; public class BlockVillageHighlighter extends OpenBlock.FourDirections { public BlockVillageHighlighter() { - super(Material.rock); + super(Material.ROCK); } // TODO 1.8.9 you bet @Override - public int getRenderType() { - return 2; // TESR only + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) { - TileEntityVillageHighlighter tile = getTileEntity(world, pos, TileEntityVillageHighlighter.class); + public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { + TileEntityVillageHighlighter tile = getTileEntity(blockAccess, pos, TileEntityVillageHighlighter.class); return (tile != null)? tile.getSignalStrength() : 0; } @Override - public int getStrongPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) { + public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { // TODO Side-aware? - return getWeakPower(world, pos, state, side); + return getWeakPower(blockState, blockAccess, pos, side); } } diff --git a/src/main/java/openblocks/common/block/BlockXPBottler.java b/src/main/java/openblocks/common/block/BlockXPBottler.java index d75e7c81..625ce7ca 100644 --- a/src/main/java/openblocks/common/block/BlockXPBottler.java +++ b/src/main/java/openblocks/common/block/BlockXPBottler.java @@ -8,7 +8,7 @@ import openmods.infobook.BookDocumentation; public class BlockXPBottler extends OpenBlock.FourDirections { public BlockXPBottler() { - super(Material.rock); + super(Material.ROCK); } } diff --git a/src/main/java/openblocks/common/block/BlockXPDrain.java b/src/main/java/openblocks/common/block/BlockXPDrain.java index d8b384d7..03735433 100644 --- a/src/main/java/openblocks/common/block/BlockXPDrain.java +++ b/src/main/java/openblocks/common/block/BlockXPDrain.java @@ -1,6 +1,10 @@ package openblocks.common.block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import openmods.block.OpenBlock; import openmods.infobook.BookDocumentation; @@ -8,8 +12,14 @@ import openmods.infobook.BookDocumentation; public class BlockXPDrain extends OpenBlock.FourDirections { public BlockXPDrain() { - super(Material.glass); - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + super(Material.GLASS); + } + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 0.0625, 1.0); + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return AABB; } } diff --git a/src/main/java/openblocks/common/block/BlockXPShower.java b/src/main/java/openblocks/common/block/BlockXPShower.java index 44258134..e76346fd 100644 --- a/src/main/java/openblocks/common/block/BlockXPShower.java +++ b/src/main/java/openblocks/common/block/BlockXPShower.java @@ -1,8 +1,10 @@ package openblocks.common.block; import net.minecraft.block.material.Material; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import openmods.block.OpenBlock; import openmods.geometry.BlockSpaceTransform; @@ -12,31 +14,27 @@ import openmods.infobook.BookDocumentation; @BookDocumentation public class BlockXPShower extends OpenBlock.FourDirections { + private static final AxisAlignedBB AABB = new AxisAlignedBB(7.0 / 16.0, 7.0 / 16.0, 0.0 / 16.0, 9.0 / 16.0, 9.0 / 16.0, 9.0 / 16.0); + public BlockXPShower() { - super(Material.rock); + super(Material.ROCK); setPlacementMode(BlockPlacementMode.SURFACE); } // TODO 1.8.9 and you too... @Override - public int getRenderType() { - return 2; // TESR only - } - - private void setBoundsBasedOnOrientation(Orientation orientation) { - final AxisAlignedBB aabb = new AxisAlignedBB(7.0 / 16.0, 7.0 / 16.0, 0.0 / 16.0, 9.0 / 16.0, 9.0 / 16.0, 9.0 / 16.0); - final AxisAlignedBB rotatedAabb = BlockSpaceTransform.instance.mapBlockToWorld(orientation, aabb); - setBlockBounds(rotatedAabb); + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos) { - Orientation orientation = getOrientation(world, pos); - setBoundsBasedOnOrientation(orientation); + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + Orientation orientation = getOrientation(source, pos); + return BlockSpaceTransform.instance.mapBlockToWorld(orientation, AABB); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } } diff --git a/src/main/java/openblocks/common/container/ContainerDevNull.java b/src/main/java/openblocks/common/container/ContainerDevNull.java index 9c519f8d..c08adc2a 100644 --- a/src/main/java/openblocks/common/container/ContainerDevNull.java +++ b/src/main/java/openblocks/common/container/ContainerDevNull.java @@ -2,6 +2,7 @@ package openblocks.common.container; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ClickType; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -11,17 +12,20 @@ public class ContainerDevNull extends ContainerBase { private InventoryPlayer playerInventory; - public ContainerDevNull(IInventory playerInventory, IInventory ownerInventory) { + private final int protectedSlot; + + public ContainerDevNull(IInventory playerInventory, IInventory ownerInventory, int protectedSlot) { super(playerInventory, ownerInventory, null); this.playerInventory = (InventoryPlayer)playerInventory; + this.protectedSlot = protectedSlot; addInventoryGrid(80, 22, 1); addPlayerInventorySlots(55); } @Override - public ItemStack slotClick(int slotId, int key, int modifier, EntityPlayer player) { - if (modifier == 2 && key == player.inventory.currentItem) return null; - return super.slotClick(slotId, key, modifier, player); + public ItemStack slotClick(int slotId, int dragType, ClickType clickType, EntityPlayer player) { + if (slotId == protectedSlot) return null; // TODO 1.10 verify if it's proper solution + return super.slotClick(slotId, dragType, clickType, player); } @Override @@ -40,7 +44,7 @@ public class ContainerDevNull extends ContainerBase { addSlotToContainer(new Slot(playerInventory, slot, offsetX + slot * 18, offsetY + 58) { @Override public boolean canTakeStack(EntityPlayer par1EntityPlayer) { - return currentSlot != playerInventory.currentItem; + return currentSlot != protectedSlot; } }); diff --git a/src/main/java/openblocks/common/entity/EntityAssistant.java b/src/main/java/openblocks/common/entity/EntityAssistant.java index c6cd4b1f..c16f0da8 100644 --- a/src/main/java/openblocks/common/entity/EntityAssistant.java +++ b/src/main/java/openblocks/common/entity/EntityAssistant.java @@ -1,10 +1,9 @@ package openblocks.common.entity; import io.netty.buffer.ByteBuf; - import java.lang.ref.WeakReference; import java.util.UUID; - +import javax.annotation.Nullable; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -12,6 +11,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.PacketBuffer; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData; @@ -71,8 +71,7 @@ public abstract class EntityAssistant extends EntitySmoothMove implements IEntit if (owner != null) smoother.setTarget( owner.posX + ownerOffsetX, owner.posY + owner.getEyeHeight() + ownerOffsetY, - owner.posZ + ownerOffsetZ - ); + owner.posZ + ownerOffsetZ); } @@ -93,11 +92,8 @@ public abstract class EntityAssistant extends EntitySmoothMove implements IEntit public abstract ItemStack toItemStack(); @Override - public boolean interactFirst(EntityPlayer player) { - if (player instanceof EntityPlayerMP && player.isSneaking() && getDistanceToEntity(player) < 3) { - System.out.println("Interact: " + player); - return true; - } + public boolean processInitialInteract(EntityPlayer player, @Nullable ItemStack stack, EnumHand hand) { + if (player instanceof EntityPlayerMP && player.isSneaking() && getDistanceToEntity(player) < 3) { return true; } return false; } diff --git a/src/main/java/openblocks/common/entity/EntityCartographer.java b/src/main/java/openblocks/common/entity/EntityCartographer.java index f20b6de6..f90abfcf 100644 --- a/src/main/java/openblocks/common/entity/EntityCartographer.java +++ b/src/main/java/openblocks/common/entity/EntityCartographer.java @@ -1,15 +1,17 @@ package openblocks.common.entity; +import com.google.common.collect.ImmutableSet; import java.util.Random; import java.util.Set; - +import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.PacketBuffer; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -22,12 +24,16 @@ import openblocks.common.item.ItemEmptyMap; import openblocks.common.item.ItemHeightMap; import openmods.Log; import openmods.api.VisibleForDocumentation; -import openmods.sync.*; +import openmods.sync.ISyncMapProvider; +import openmods.sync.SyncMap; +import openmods.sync.SyncMapEntity; +import openmods.sync.SyncObjectScanner; +import openmods.sync.SyncableBoolean; +import openmods.sync.SyncableInt; +import openmods.sync.SyncableObjectBase; import openmods.utils.BitSet; import openmods.utils.ItemUtils; -import com.google.common.collect.ImmutableSet; - @VisibleForDocumentation public class EntityCartographer extends EntityAssistant implements ISelectAware, ISyncMapProvider { @@ -90,8 +96,7 @@ public class EntityCartographer extends EntityAssistant implements ISelectAware, MapDataBuilder builder = new MapDataBuilder(mapId); builder.loadMap(world); - builder.resizeIfNeeded(bits); // better to lost progress than to - // break world + builder.resizeIfNeeded(bits); // better to lost progress than to break world size = builder.size(); jobs = builder.createJobs(bits); @@ -176,7 +181,7 @@ public class EntityCartographer extends EntityAssistant implements ISelectAware, super.onUpdate(); if (!worldObj.isRemote) { - if (worldObj.provider.getDimensionId() == mappingDimension && isMapping.get() && countdownToAction-- <= 0) { + if (worldObj.provider.getDimension() == mappingDimension && isMapping.get() && countdownToAction-- <= 0) { jobs.runJob(worldObj, (int)posX, (int)posZ); countdownToAction = MAP_JOB_DELAY; } @@ -231,11 +236,10 @@ public class EntityCartographer extends EntityAssistant implements ISelectAware, } @Override - public boolean interactFirst(EntityPlayer player) { + public boolean processInitialInteract(EntityPlayer player, @Nullable ItemStack holding, EnumHand hand) { if (player instanceof EntityPlayerMP && player.isSneaking() && getDistanceToEntity(player) < 3) { - ItemStack holding = player.getHeldItem(); if (holding == null && mapItem != null) { - player.setCurrentItemOrArmor(0, mapItem); + player.setHeldItem(hand, mapItem); mapItem = null; isMapping.toggle(); jobs.stopMapping(); @@ -244,10 +248,10 @@ public class EntityCartographer extends EntityAssistant implements ISelectAware, if (itemType instanceof ItemHeightMap || itemType instanceof ItemEmptyMap) { ItemStack inserted = holding.splitStack(1); - if (holding.stackSize <= 0) player.setCurrentItemOrArmor(0, null); + if (holding.stackSize <= 0) player.setHeldItem(hand, null); mapItem = inserted; - mappingDimension = worldObj.provider.getDimensionId(); + mappingDimension = worldObj.provider.getDimension(); isMapping.toggle(); mapItem = MapDataBuilder.upgradeToMap(worldObj, mapItem); int mapId = mapItem.getItemDamage(); diff --git a/src/main/java/openblocks/common/entity/EntityGoldenEye.java b/src/main/java/openblocks/common/entity/EntityGoldenEye.java index e3424a39..ce4d0152 100644 --- a/src/main/java/openblocks/common/entity/EntityGoldenEye.java +++ b/src/main/java/openblocks/common/entity/EntityGoldenEye.java @@ -4,8 +4,8 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/openblocks/common/entity/EntityHangGlider.java b/src/main/java/openblocks/common/entity/EntityHangGlider.java index 2552eb7d..01401470 100644 --- a/src/main/java/openblocks/common/entity/EntityHangGlider.java +++ b/src/main/java/openblocks/common/entity/EntityHangGlider.java @@ -1,28 +1,58 @@ package openblocks.common.entity; +import com.google.common.collect.MapMaker; import io.netty.buffer.ByteBuf; - +import java.util.Calendar; import java.util.Map; - +import java.util.Random; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraft.world.gen.NoiseGeneratorPerlin; import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import openblocks.Config; +import openblocks.common.IVarioController; +import openblocks.common.Vario; import openblocks.common.item.ItemHangGlider; import openmods.Log; - -import com.google.common.collect.MapMaker; +import openmods.OpenMods; public class EntityHangGlider extends Entity implements IEntityAdditionalSpawnData { - private static final int PROPERTY_DEPLOYED = 17; + + public static final int THERMAL_HEIGTH_MIN = 70; + public static final int THERMAL_HEIGTH_OPT = 110; + public static final int THERMAL_HEIGTH_MAX = 136; + public static final int THERMAL_STRONG_BONUS_HEIGTH = 100; + + public static final double VSPEED_NORMAL = -0.052; + public static final double VSPEED_FAST = -0.176; + public static final double VSPEED_MIN = -0.32; + public static final double VSPEED_MAX = 0.4; + + private static final int TICKS_PER_VARIO_UPDATE = 4; + + public static final int FREQ_MIN = 300; + public static final int FREQ_AVG = 600; + public static final int FREQ_MAX = 2000; + + public static final int BEEP_RATE_AVG = 4; + public static final int BEEP_RATE_MAX = 24; + + private static final DataParameter PROPERTY_DEPLOYED = EntityDataManager. createKey(EntityHangGlider.class, DataSerializers.BOOLEAN); private static Map gliderMap = new MapMaker().weakKeys().weakValues().makeMap(); + private IVarioController varioControl = IVarioController.NULL; + public static boolean isEntityHoldingGlider(Entity player) { EntityHangGlider glider = gliderMap.get(player); return glider != null; @@ -30,15 +60,15 @@ public class EntityHangGlider extends Entity implements IEntityAdditionalSpawnDa public static boolean isGliderDeployed(Entity player) { EntityHangGlider glider = gliderMap.get(player); - return glider == null || glider.isDeployed(); + return glider != null && glider.isDeployed(); } private static boolean isGliderValid(EntityPlayer player, EntityHangGlider glider) { if (player == null || player.isDead || glider == null || glider.isDead) return false; - ItemStack held = player.getHeldItem(); + ItemStack held = player.getHeldItemMainhand(); if (held == null || !(held.getItem() instanceof ItemHangGlider)) return false; - if (player.worldObj.provider.getDimensionId() != glider.worldObj.provider.getDimensionId()) return false; + if (player.worldObj.provider.getDimension() != glider.worldObj.provider.getDimension()) return false; return true; } @@ -53,9 +83,14 @@ public class EntityHangGlider extends Entity implements IEntityAdditionalSpawnDa } private EntityPlayer player; + private NoiseGeneratorPerlin noiseGen; + private int ticksSinceLastVarioUpdate = 0; + private double verticalMotionSinceLastVarioUpdate = 0; + private double lastMotionY = 0; public EntityHangGlider(World world) { super(world); + this.noiseGen = new NoiseGeneratorPerlin(new Random(world.getCurrentDate().get(Calendar.DAY_OF_YEAR)), 2); } public EntityHangGlider(World world, EntityPlayer player) { @@ -72,6 +107,10 @@ public class EntityHangGlider extends Entity implements IEntityAdditionalSpawnDa if (e instanceof EntityPlayer) { player = (EntityPlayer)e; gliderMap.put(player, this); + + if (OpenMods.proxy.isClientPlayer(player)) + varioControl = Vario.instance.acquire(); + } else { setDead(); } @@ -89,11 +128,11 @@ public class EntityHangGlider extends Entity implements IEntityAdditionalSpawnDa @Override protected void entityInit() { - this.dataWatcher.addObject(PROPERTY_DEPLOYED, (byte)1); + this.dataManager.register(PROPERTY_DEPLOYED, true); } public boolean isDeployed() { - return this.dataWatcher.getWatchableObjectByte(PROPERTY_DEPLOYED) == 1; + return this.dataManager.get(PROPERTY_DEPLOYED); } @Override @@ -107,44 +146,111 @@ public class EntityHangGlider extends Entity implements IEntityAdditionalSpawnDa return; } - boolean isDeployed = player.onGround || player.isInWater(); + varioControl.keepAlive(); + + boolean isDeployed = !player.onGround && !player.isInWater() && !player.isPlayerSleeping(); if (!worldObj.isRemote) { - this.dataWatcher.updateObject(PROPERTY_DEPLOYED, (byte)(isDeployed? 1 : 0)); + this.dataManager.set(PROPERTY_DEPLOYED, isDeployed); fixPositions(player, false); } - if (!isDeployed && player.motionY < 0) { - final double horizontalSpeed; - final double verticalSpeed; + if (isDeployed) { + if (player.motionY < lastMotionY) { - if (player.isSneaking()) { - horizontalSpeed = 0.1; - verticalSpeed = 0.7; - } else { - horizontalSpeed = 0.03; - verticalSpeed = 0.4; + final double noise = Config.hanggliderEnableThermal? getNoise() : 0; + + final double vspeed = (noise >= 0? VSPEED_MAX : -VSPEED_MIN); + + final double horizontalSpeed; + final double verticalSpeed; + if (player.isSneaking()) { + horizontalSpeed = 0.1; + verticalSpeed = Math.max((VSPEED_FAST + noise * vspeed), VSPEED_MIN); + } else { + horizontalSpeed = 0.03; + verticalSpeed = Math.max((VSPEED_NORMAL + noise * vspeed), VSPEED_MIN); + } + + player.motionY = verticalSpeed; + motionY = verticalSpeed; + lastMotionY = verticalSpeed; + + if (varioControl.isValid()) { + ticksSinceLastVarioUpdate++; + verticalMotionSinceLastVarioUpdate += verticalSpeed; // * 1 tick, for unit freaks + if (ticksSinceLastVarioUpdate > TICKS_PER_VARIO_UPDATE) { + updateVario(verticalMotionSinceLastVarioUpdate / TICKS_PER_VARIO_UPDATE); + ticksSinceLastVarioUpdate = 0; + verticalMotionSinceLastVarioUpdate = 0; + } + } + + double x = Math.cos(Math.toRadians(player.rotationYawHead + 90)) * horizontalSpeed; + double z = Math.sin(Math.toRadians(player.rotationYawHead + 90)) * horizontalSpeed; + player.motionX += x; + player.motionZ += z; + player.fallDistance = 0f; // Don't like getting hurt :( -- Mikee, probably + } + } else { + if (varioControl.isValid()) { + varioControl.setFrequencies(0, 0); + ticksSinceLastVarioUpdate = 0; + verticalMotionSinceLastVarioUpdate = 0; } - - player.motionY *= verticalSpeed; - motionY *= verticalSpeed; - double x = Math.cos(Math.toRadians(player.rotationYawHead + 90)) * horizontalSpeed; - double z = Math.sin(Math.toRadians(player.rotationYawHead + 90)) * horizontalSpeed; - player.motionX += x; - player.motionZ += z; - player.fallDistance = 0f; /* Don't like getting hurt :( */ } } + private void updateVario(double vspeed) { + if (vspeed <= 0) { + vspeed = Math.max(VSPEED_MIN, vspeed); + double freq = (vspeed - VSPEED_MIN) / Math.abs(VSPEED_MIN) * (FREQ_AVG - FREQ_MIN) + FREQ_MIN; + varioControl.setFrequencies(freq, 0); + } else { + vspeed = Math.min(VSPEED_MAX, vspeed); + double freq = vspeed / Math.abs(VSPEED_MAX) * (FREQ_MAX - FREQ_AVG) + FREQ_AVG; + double beepfreq = vspeed / Math.abs(VSPEED_MAX) * (BEEP_RATE_MAX - BEEP_RATE_AVG) + BEEP_RATE_AVG; + varioControl.setFrequencies(freq, beepfreq); + } + } + public EntityPlayer getPlayer() { return player; } + public double getNoise() { + double noise = noiseGen.getValue(player.posX / 20f, player.posZ / 20f) / 4d; + final boolean strong = (noise > 0.7? true : false); + final int bonus = (strong? THERMAL_STRONG_BONUS_HEIGTH : 0); + final BlockPos pos = player.getPosition(); + final float biomeRain = worldObj.getBiomeForCoordsBody(pos).getRainfall(); + + noise *= Math.min((Math.max((player.posY - THERMAL_HEIGTH_MIN), 0d) / (THERMAL_HEIGTH_OPT - THERMAL_HEIGTH_MIN)), 1d); + noise *= Math.min((Math.max((THERMAL_HEIGTH_MAX + bonus - player.posY), 0d) / (THERMAL_HEIGTH_MAX - THERMAL_HEIGTH_OPT + bonus / 4)), 1d); + + int worldTime = (int)(worldObj.getWorldTime() % 24000); + noise *= Math.min((worldTime / 1000d), 1); + noise *= Math.min((Math.max((12000 - worldTime), 0) / 1000d), 1); + + if (player.dimension != 0) + noise = 0; + else if (worldObj.isRaining() && !strong) + noise = (biomeRain > 0? -0.5 : 0); + return noise; + } + @Override public void setDead() { super.setDead(); gliderMap.remove(player); + + if (varioControl.isValid()) { + varioControl.kill(); + varioControl.release(); + ticksSinceLastVarioUpdate = 0; + verticalMotionSinceLastVarioUpdate = 0; + } } private void fixPositions(EntityPlayer thePlayer, boolean localPlayer) { diff --git a/src/main/java/openblocks/common/entity/EntityItemProjectile.java b/src/main/java/openblocks/common/entity/EntityItemProjectile.java index fc2b6f43..42a6e56c 100644 --- a/src/main/java/openblocks/common/entity/EntityItemProjectile.java +++ b/src/main/java/openblocks/common/entity/EntityItemProjectile.java @@ -2,9 +2,10 @@ package openblocks.common.entity; import net.minecraft.block.material.Material; import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; /** @@ -28,14 +29,6 @@ public class EntityItemProjectile extends EntityItem { @Override public void onUpdate() { - final ItemStack stack = getDataWatcher().getWatchableObjectItemStack(10); - if (stack == null) - { - setDead(); - return; - } - if (stack.getItem() != null && stack.getItem().onEntityItemUpdate(this)) return; - // TODO 1.8.9 verify final double x = posX; final double y = posY; @@ -48,7 +41,7 @@ public class EntityItemProjectile extends EntityItem { // let vanilla run super.onUpdate(); if (!isDead) return; - // and then overwrite + // and then overwrite position calculations this.posX = x; this.posY = y; @@ -67,14 +60,12 @@ public class EntityItemProjectile extends EntityItem { boolean hasMoved = (int)this.prevPosX != (int)this.posX || (int)this.prevPosY != (int)this.posY || (int)this.prevPosZ != (int)this.posZ; - if (hasMoved || this.ticksExisted % 25 == 0) - { - if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() == Material.lava) - { + if (hasMoved || this.ticksExisted % 25 == 0) { + if (this.worldObj.getBlockState(new BlockPos(this)).getMaterial() == Material.LAVA) { this.motionY = 0.20000000298023224D; this.motionX = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F; this.motionZ = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F; - playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + playSound(SoundEvents.ENTITY_GENERIC_BURN, 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); } } @@ -82,8 +73,7 @@ public class EntityItemProjectile extends EntityItem { float f = 1F; // Keep ground friction - if (this.onGround) - { + if (this.onGround) { f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.98F; } diff --git a/src/main/java/openblocks/common/entity/EntityLuggage.java b/src/main/java/openblocks/common/entity/EntityLuggage.java index 07bc35ca..4600c354 100644 --- a/src/main/java/openblocks/common/entity/EntityLuggage.java +++ b/src/main/java/openblocks/common/entity/EntityLuggage.java @@ -1,6 +1,8 @@ package openblocks.common.entity; +import com.google.common.base.Strings; import io.netty.buffer.ByteBuf; +import javax.annotation.Nullable; import net.minecraft.block.Block; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.ai.EntityAIFollowOwner; @@ -8,12 +10,21 @@ import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemNameTag; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.pathfinding.PathNavigate; import net.minecraft.pathfinding.PathNavigateGround; -import net.minecraft.util.*; +import net.minecraft.pathfinding.PathNodeType; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData; @@ -24,12 +35,10 @@ import openmods.api.VisibleForDocumentation; import openmods.inventory.GenericInventory; import openmods.inventory.legacy.ItemDistribution; -import com.google.common.base.Strings; - @VisibleForDocumentation public class EntityLuggage extends EntityTameable implements IEntityAdditionalSpawnData { - private static final int INV_SIZE_WATCH = 18; + private static final DataParameter PROPERTY_INV_SIZE = EntityDataManager. createKey(EntityLuggage.class, DataSerializers.VARINT); private static final int SIZE_SPECIAL = 54; @@ -63,16 +72,16 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp setMoveForward(0); setTamed(true); enablePersistence(); + setPathPriority(PathNodeType.WATER, -1.0F); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIFollowOwner(this, getAIMoveSpeed(), 10.0F, 2.0F)); this.tasks.addTask(3, new EntityAICollectItem(this)); - this.dataWatcher.addObject(INV_SIZE_WATCH, Integer.valueOf(inventory.getSizeInventory())); + getDataManager().register(PROPERTY_INV_SIZE, inventory.getSizeInventory()); } @Override protected PathNavigate getNewNavigator(World worldIn) { final PathNavigateGround navigator = new PathNavigateGround(this, worldIn); - navigator.setAvoidsWater(true); navigator.setCanSwim(true); return navigator; } @@ -82,9 +91,7 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp special = true; GenericInventory inventory = createInventory(SIZE_SPECIAL); inventory.copyFrom(this.inventory); - if (this.dataWatcher != null) { - this.dataWatcher.updateObject(INV_SIZE_WATCH, inventory.getSizeInventory()); - } + getDataManager().set(PROPERTY_INV_SIZE, inventory.getSizeInventory()); this.inventory = inventory; } @@ -97,7 +104,7 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp public void onLivingUpdate() { super.onLivingUpdate(); if (worldObj.isRemote) { - int inventorySize = dataWatcher.getWatchableObjectInt(18); + int inventorySize = getDataManager().get(PROPERTY_INV_SIZE); if (inventory.getSizeInventory() != inventorySize) { inventory = createInventory(inventorySize); } @@ -110,7 +117,7 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp } @Override - public ItemStack getPickedResult(MovingObjectPosition target) { + public ItemStack getPickedResult(RayTraceResult target) { return convertToItem(); } @@ -120,9 +127,8 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp } @Override - public boolean interact(EntityPlayer player) { + public boolean processInteract(EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem) { if (!isDead) { - final ItemStack heldItem = player.getHeldItem(); if (heldItem != null && heldItem.getItem() instanceof ItemNameTag) return false; if (worldObj.isRemote) { @@ -131,10 +137,10 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp if (player.isSneaking()) { ItemStack luggageItem = convertToItem(); if (player.inventory.addItemStackToInventory(luggageItem)) setDead(); - playSound("random.pop", 0.5f, worldObj.rand.nextFloat() * 0.1f + 0.9f); + playSound(SoundEvents.ENTITY_ITEM_PICKUP, 0.5f, worldObj.rand.nextFloat() * 0.1f + 0.9f); } else { - playSound("random.chestopen", 0.5f, worldObj.rand.nextFloat() * 0.1f + 0.9f); + playSound(SoundEvents.BLOCK_CHEST_OPEN, 0.5f, worldObj.rand.nextFloat() * 0.1f + 0.9f); player.openGui(OpenBlocks.instance, OpenBlocksGuiHandler.GuiId.luggage.ordinal(), player.worldObj, getEntityId(), 0, 0); } } @@ -142,6 +148,11 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp return true; } + @Override + public boolean canBeLeashedTo(EntityPlayer player) { + return false; + } + protected void spawnPickupParticles() { final double py = this.posY + this.height; for (int i = 0; i < 50; i++) { @@ -172,7 +183,7 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp inventory.readFromNBT(tag); if (inventory.getSizeInventory() > SIZE_NORMAL) setSpecial(); - NBTTagCompound tagCopy = (NBTTagCompound)tag.copy(); + NBTTagCompound tagCopy = tag.copy(); tagCopy.removeTag(GenericInventory.TAG_SIZE); tagCopy.removeTag(GenericInventory.TAG_ITEMS); this.itemTag = tagCopy.hasNoTags()? null : tagCopy; @@ -187,7 +198,7 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp @Override protected void playStepSound(BlockPos pos, Block blockIn) { - playSound("openblocks:luggage.walk", 0.3F, 0.7F + (worldObj.rand.nextFloat() * 0.5f)); + playSound(OpenBlocks.Sounds.ENTITY_LUGGAGE_WALK, 0.3F, 0.7F + (worldObj.rand.nextFloat() * 0.5f)); } public void storeItemTag(NBTTagCompound itemTag) { @@ -220,6 +231,11 @@ public class EntityLuggage extends EntityTameable implements IEntityAdditionalSp return true; } + @Override + public void setHealth(float health) { + // NO-OP + } + @Override protected boolean canDespawn() { return false; diff --git a/src/main/java/openblocks/common/entity/EntityMagnet.java b/src/main/java/openblocks/common/entity/EntityMagnet.java index 5a7a4a57..845014ee 100644 --- a/src/main/java/openblocks/common/entity/EntityMagnet.java +++ b/src/main/java/openblocks/common/entity/EntityMagnet.java @@ -1,32 +1,33 @@ package openblocks.common.entity; +import com.google.common.base.Predicate; import io.netty.buffer.ByteBuf; - import java.lang.ref.WeakReference; import java.util.Iterator; import java.util.List; import java.util.Random; - import javax.annotation.Nullable; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.*; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.Config; import openblocks.api.IMagnetAware; import openblocks.common.CraneRegistry; import openblocks.common.MagnetWhitelists; import openblocks.common.item.ItemCraneBackpack; -import openmods.entity.*; +import openmods.entity.DelayedEntityLoadManager; +import openmods.entity.EntityBlock; import openmods.entity.EntityBlock.EntityFactory; - -import com.google.common.base.Predicate; +import openmods.entity.IEntityLoadListener; public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalSpawnData { @@ -42,52 +43,49 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS } public interface IEntityBlockFactory { - public EntityBlock create(EntityPlayer player); + public EntityBlock create(EntityLivingBase player); } public interface IOwner { public boolean isValid(EntityMagnet magnet); - public Vec3 getTarget(); + public Vec3d getTarget(); public EntityBlock createByPlayer(IEntityBlockFactory factory); } private static class EntityPlayerTarget implements IOwner { - private WeakReference owner; + private WeakReference owner; - public EntityPlayerTarget(EntityPlayer owner) { - this.owner = new WeakReference(owner); + public EntityPlayerTarget(EntityLivingBase owner) { + this.owner = new WeakReference(owner); } @Override public boolean isValid(EntityMagnet magnet) { - EntityPlayer player = owner.get(); + EntityLivingBase player = owner.get(); if (player == null || player.isDead) return false; if (magnet.worldObj != player.worldObj) return false; return ItemCraneBackpack.isWearingCrane(player); } @Override - public Vec3 getTarget() { - EntityPlayer player = owner.get(); + public Vec3d getTarget() { + EntityLivingBase player = owner.get(); if (player == null) return null; - double posX = player.posX + CraneRegistry.ARM_RADIUS - * MathHelper.cos((player.rotationYaw + 90) * (float)Math.PI / 180); - double posZ = player.posZ - + CraneRegistry.ARM_RADIUS - * MathHelper.sin((player.rotationYaw + 90) * (float)Math.PI / 180); + double posX = player.posX + CraneRegistry.ARM_RADIUS * MathHelper.cos((player.rotationYaw + 90) * (float)Math.PI / 180); + double posZ = player.posZ + CraneRegistry.ARM_RADIUS * MathHelper.sin((player.rotationYaw + 90) * (float)Math.PI / 180); double posY = player.posY + player.height - CraneRegistry.instance.getCraneMagnetDistance(player); - return new Vec3(posX, posY, posZ); + return new Vec3d(posX, posY, posZ); } @Override public EntityBlock createByPlayer(IEntityBlockFactory factory) { - EntityPlayer player = owner.get(); + EntityLivingBase player = owner.get(); if (player == null) return null; return factory.create(player); @@ -102,7 +100,7 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS owner = new WeakReference(null); } - public PlayerBound(World world, EntityPlayer owner) { + public PlayerBound(World world, EntityLivingBase owner) { super(world, new EntityPlayerTarget(owner), false); this.owner = new WeakReference(owner); CraneRegistry.instance.bindMagnetToPlayer(owner, this); @@ -155,7 +153,7 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS this(world); this.owner = owner; this.isMagic = isMagic; - Vec3 initialTarget = owner.getTarget(); + Vec3d initialTarget = owner.getTarget(); setPosition(initialTarget.xCoord, initialTarget.yCoord, initialTarget.zCoord); } @@ -200,7 +198,7 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS setDead(); return; } else if (owner != null) { - final Vec3 target = owner.getTarget().addVector(0, -height, 0); + final Vec3d target = owner.getTarget().addVector(0, -height, 0); smoother.setTarget(target); } } @@ -211,64 +209,53 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS isAboveTarget = !detectEntityTargets().isEmpty(); - if (isMagic && worldObj.isRemote && RANDOM.nextDouble() < 0.2) worldObj.spawnParticle(EnumParticleTypes.PORTAL, posX - + RANDOM.nextDouble() * 0.1, posY - RANDOM.nextDouble() * 0.2, posZ - + RANDOM.nextDouble() * 0.1, RANDOM.nextGaussian(), -Math.abs(RANDOM.nextGaussian()), RANDOM.nextGaussian()); + if (isMagic && worldObj.isRemote && RANDOM.nextDouble() < 0.2) worldObj.spawnParticle(EnumParticleTypes.PORTAL, + posX + RANDOM.nextDouble() * 0.1, + posY - RANDOM.nextDouble() * 0.2, posZ + RANDOM.nextDouble() * 0.1, + RANDOM.nextGaussian(), + -Math.abs(RANDOM.nextGaussian()), + RANDOM.nextGaussian()); } protected void fixSize() { - if (riddenByEntity != null) { - float width = Math.max(MAGNET_WIDTH, riddenByEntity.width); - float height = MAGNET_HEIGHT + riddenByEntity.height; + // TODO 1.10 verify + final List passengers = getPassengers(); + if (!passengers.isEmpty()) { + Entity passenger = passengers.get(0); + float width = Math.max(MAGNET_WIDTH, passenger.width); + float height = MAGNET_HEIGHT + passenger.height; setSize(width, height); } else { setSize(MAGNET_WIDTH, MAGNET_HEIGHT); } } - @Override - public void setPosition(double x, double y, double z) { - if (smoother != null) smoother.setTarget(x, y, z); - - super.setPosition(x, y, z); - } - - @Override - public void setPositionAndRotation(double x, double y, double z, float yaw, float pitch) { - smoother.setTarget(x, y, z); - super.setPositionAndRotation(x, y, z, yaw, pitch); - } - - @Override - @SideOnly(Side.CLIENT) - public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean something) { - smoother.setTarget(x, y, z); - super.setRotation(yaw, pitch); - } - @Override public double getMountedYOffset() { - if (riddenByEntity == null) return 0; + final List passengers = getPassengers(); + if (passengers.isEmpty()) return 0; - return getMountedYOffset(riddenByEntity); + return getMountedYOffset(passengers.get(0)); } private static double getMountedYOffset(Entity rider) { - if (rider instanceof EntityPlayer) return 0.5f; + if (rider instanceof EntityPlayer) return 0.5f; // TODO 1.10 verify if it's still a problem return 0; } public boolean toggleMagnet() { - if (riddenByEntity != null) { - final Entity tmp = riddenByEntity; + final List passengers = getPassengers(); + if (!passengers.isEmpty()) { + final Entity passenger = passengers.get(0); - if (tmp instanceof IMagnetAware - && !((IMagnetAware)tmp).canRelease()) return false; + if (passenger instanceof IMagnetAware // TODO 1.10 there seems to be Forge event for that? + && !((IMagnetAware)passenger).canRelease()) + return false; // default unmount position is above entity and it // looks strange, so we hack around that - double tmpPosY = tmp.posY; - tmp.mountEntity(null); - tmp.setPosition(tmp.posX, tmpPosY, tmp.posZ); + double tmpPosY = passenger.posY; + removePassengers(); + passenger.setPosition(passenger.posX, tmpPosY, passenger.posZ); return true; } else if (!worldObj.isRemote) { Entity target = null; @@ -278,7 +265,7 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS if (target == null && Config.canMagnetPickBlocks) target = createBlockEntity(); if (target != null) { - target.mountEntity(this); + target.startRiding(this); return true; } } @@ -316,7 +303,7 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS if (MagnetWhitelists.instance.testBlock(worldObj, pos)) { result = owner.createByPlayer(new IEntityBlockFactory() { @Override - public EntityBlock create(EntityPlayer player) { + public EntityBlock create(EntityLivingBase player) { return EntityBlock.create(player, worldObj, pos, new EntityFactory() { @Override public EntityBlock create(World world) { @@ -355,7 +342,7 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS } public boolean isLocked() { - return riddenByEntity != null; + return isBeingRidden(); } public boolean isValid() { diff --git a/src/main/java/openblocks/common/entity/EntityMiniMe.java b/src/main/java/openblocks/common/entity/EntityMiniMe.java index 2bcfd5d2..ee2f8322 100644 --- a/src/main/java/openblocks/common/entity/EntityMiniMe.java +++ b/src/main/java/openblocks/common/entity/EntityMiniMe.java @@ -1,24 +1,29 @@ package openblocks.common.entity; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; import io.netty.buffer.ByteBuf; - import java.util.Map; import java.util.UUID; - import net.minecraft.client.Minecraft; import net.minecraft.client.resources.DefaultPlayerSkin; import net.minecraft.client.resources.SkinManager; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.*; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTUtil; import net.minecraft.network.PacketBuffer; import net.minecraft.pathfinding.PathNavigate; import net.minecraft.pathfinding.PathNavigateGround; -import net.minecraft.server.MinecraftServer; +import net.minecraft.pathfinding.PathNodeType; +import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; @@ -30,15 +35,11 @@ import openblocks.common.entity.ai.EntityAIBreakBlock; import openblocks.common.entity.ai.EntityAIPickupPlayer; import openmods.Log; import openmods.api.VisibleForDocumentation; -import openmods.network.event.*; +import openmods.network.event.EventDirection; +import openmods.network.event.NetworkEvent; +import openmods.network.event.NetworkEventMeta; import openmods.utils.io.GameProfileSerializer; -import com.google.common.collect.Iterables; -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.minecraft.MinecraftProfileTexture; -import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; -import com.mojang.authlib.properties.Property; - @VisibleForDocumentation public class EntityMiniMe extends EntityCreature implements IEntityAdditionalSpawnData { @@ -100,7 +101,7 @@ public class EntityMiniMe extends EntityCreature implements IEntityAdditionalSpa public EntityMiniMe(World world, GameProfile owner) { this(world); - this.owner = owner != null? fetchFullProfile(owner) : null; + this.owner = owner != null? TileEntitySkull.updateGameprofile(owner) : null; } public EntityMiniMe(World world) { @@ -119,7 +120,7 @@ public class EntityMiniMe extends EntityCreature implements IEntityAdditionalSpa @Override protected PathNavigate getNewNavigator(World worldIn) { final PathNavigateGround navigator = new PathNavigateGround(this, worldIn); - navigator.setAvoidsWater(true); + setPathPriority(PathNodeType.WATER, -1.0F); navigator.setCanSwim(true); return navigator; } @@ -128,10 +129,10 @@ public class EntityMiniMe extends EntityCreature implements IEntityAdditionalSpa public void onEntityUpdate() { super.onEntityUpdate(); if (pickupCooldown > 0) pickupCooldown--; - if (wasRidden && riddenByEntity == null) { + if (wasRidden && !isBeingRidden()) { wasRidden = false; setPickupCooldown(1200); - } else if (riddenByEntity != null) { + } else if (isBeingRidden()) { wasRidden = true; } } @@ -152,19 +153,18 @@ public class EntityMiniMe extends EntityCreature implements IEntityAdditionalSpa @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); } @Override public void setCustomNameTag(String name) { super.setCustomNameTag(name); - if (!worldObj.isRemote && MinecraftServer.getServer() != null) { + if (!worldObj.isRemote) { if (name != null && (owner == null || !name.equalsIgnoreCase(owner.getName()))) { try { - final GameProfile profile = MinecraftServer.getServer().getPlayerProfileCache().getGameProfileForUsername(name); - this.owner = profile != null? fetchFullProfile(profile) : null; + this.owner = TileEntitySkull.updateGameprofile(new GameProfile(null, name)); propagateOwnerChange(); } catch (Exception e) { Log.warn(e, "Failed to change skin to %s", name); @@ -174,7 +174,7 @@ public class EntityMiniMe extends EntityCreature implements IEntityAdditionalSpa } private void propagateOwnerChange() { - NetworkEventManager.INSTANCE.dispatcher().senders.entity.sendMessage(new OwnerChangeEvent(getEntityId(), owner), this); + new OwnerChangeEvent(getEntityId(), owner).sendToEntity(this); } @SideOnly(Side.CLIENT) @@ -195,17 +195,6 @@ public class EntityMiniMe extends EntityCreature implements IEntityAdditionalSpa return null; } - private static GameProfile fetchFullProfile(GameProfile profile) { - // TODO 1.8.9 verify - final Property property = Iterables.getFirst(profile.getProperties().get("textures"), null); - if (property != null) return profile; - - final GameProfile cachedProfile = MinecraftServer.getServer().getPlayerProfileCache().getProfileByUUID(profile.getId()); - if (cachedProfile != null) return cachedProfile; - - return MinecraftServer.getServer().getMinecraftSessionService().fillProfileProperties(profile, true); - } - @Override protected boolean canDespawn() { return false; @@ -261,7 +250,7 @@ public class EntityMiniMe extends EntityCreature implements IEntityAdditionalSpa private static GameProfile readOwner(NBTTagCompound tag) { if (tag.hasKey("owner", Constants.NBT.TAG_STRING)) { String ownerName = tag.getString("owner"); - return MinecraftServer.getServer().getPlayerProfileCache().getGameProfileForUsername(ownerName); + return TileEntitySkull.updateGameprofile(new GameProfile((UUID)null, ownerName)); } else if (tag.hasKey("OwnerUUID", Constants.NBT.TAG_STRING)) { final String uuidStr = tag.getString("OwnerUUID"); try { diff --git a/src/main/java/openblocks/common/entity/EntityMount.java b/src/main/java/openblocks/common/entity/EntityMount.java index bf7a2bf3..4a81d1cb 100644 --- a/src/main/java/openblocks/common/entity/EntityMount.java +++ b/src/main/java/openblocks/common/entity/EntityMount.java @@ -29,7 +29,7 @@ public class EntityMount extends Entity { public void onUpdate() { super.onUpdate(); - if (riddenByEntity == null) setDead(); + if (isBeingRidden()) setDead(); // if((int) posY == posY) // Fix the client sometimes derping for some // odd reason... diff --git a/src/main/java/openblocks/common/entity/EntityMountedBlock.java b/src/main/java/openblocks/common/entity/EntityMountedBlock.java index 2a5ef78c..31faa414 100644 --- a/src/main/java/openblocks/common/entity/EntityMountedBlock.java +++ b/src/main/java/openblocks/common/entity/EntityMountedBlock.java @@ -12,7 +12,7 @@ public class EntityMountedBlock extends EntityBlock implements IMagnetAware { @Override protected boolean shouldPlaceBlock() { - return ridingEntity == null && !worldObj.isRemote; + return !isRiding() && !worldObj.isRemote; } @Override diff --git a/src/main/java/openblocks/common/entity/EntitySmoothMove.java b/src/main/java/openblocks/common/entity/EntitySmoothMove.java index b3069c70..56aaeb84 100644 --- a/src/main/java/openblocks/common/entity/EntitySmoothMove.java +++ b/src/main/java/openblocks/common/entity/EntitySmoothMove.java @@ -1,12 +1,10 @@ package openblocks.common.entity; import net.minecraft.entity.Entity; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -// TODO 1.8.9 verify changes in entity movement +// TODO 1.8.9 verify changes in entity movement. Seems that 'setPosition' catches all, so other overrides were removed public abstract class EntitySmoothMove extends Entity { public class MoveSmoother { @@ -26,7 +24,7 @@ public abstract class EntitySmoothMove extends Entity { this.minimalLengthSq = minimalLength * minimalLength; } - public void setTarget(Vec3 position) { + public void setTarget(Vec3d position) { setTarget(position.xCoord, position.yCoord, position.zCoord); } @@ -45,8 +43,7 @@ public abstract class EntitySmoothMove extends Entity { if (lenSq > panicLengthSq || lenSq < minimalLengthSq) { setPosition(targetX, targetY, targetZ); motionX = motionY = motionZ = 0; - } - else { + } else { if (lenSq > cutoff * cutoff) { double scale = cutoff / Math.sqrt(lenSq); dx *= scale; @@ -67,8 +64,7 @@ public abstract class EntitySmoothMove extends Entity { } protected MoveSmoother createSmoother(boolean isRemote) { - return isRemote? new MoveSmoother(0.25, 1.0, 8.0, 0.01) : - new MoveSmoother(0.5, 5.0, 128.0, 0.01); + return isRemote? new MoveSmoother(0.25, 1.0, 8.0, 0.01) : new MoveSmoother(0.5, 5.0, 128.0, 0.01); } @Override @@ -77,19 +73,6 @@ public abstract class EntitySmoothMove extends Entity { super.setPosition(x, y, z); } - @Override - public void setPositionAndRotation(double x, double y, double z, float yaw, float pitch) { - smoother.setTarget(x, y, z); - super.setPositionAndRotation(x, y, z, yaw, pitch); - } - - @Override - @SideOnly(Side.CLIENT) - public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean something) { - smoother.setTarget(x, y, z); - super.setRotation(yaw, pitch); - } - protected void updatePrevPosition() { prevDistanceWalkedModified = distanceWalkedModified; prevPosX = posX; diff --git a/src/main/java/openblocks/common/entity/EntityXPOrbNoFly.java b/src/main/java/openblocks/common/entity/EntityXPOrbNoFly.java index 9dfb7a09..4ca928e7 100644 --- a/src/main/java/openblocks/common/entity/EntityXPOrbNoFly.java +++ b/src/main/java/openblocks/common/entity/EntityXPOrbNoFly.java @@ -2,32 +2,44 @@ package openblocks.common.entity; import net.minecraft.block.material.Material; import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.init.SoundEvents; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; public class EntityXPOrbNoFly extends EntityXPOrb { public EntityXPOrbNoFly(World world) { super(world); - this.motionX = 0; - this.motionY = 0; - this.motionZ = 0; } public EntityXPOrbNoFly(World world, double x, double y, double z, int xp) { super(world, x, y, z, xp); - this.motionX = 0; - this.motionY = 0; - this.motionZ = 0; } @Override - public void onUpdate() - { - super.onEntityUpdate(); + public void onUpdate() { + final double x = posX; + final double y = posY; + final double z = posZ; - if (this.delayBeforeCanPickup > 0) --this.delayBeforeCanPickup; + final double vx = motionX; + final double vy = motionY; + final double vz = motionZ; + + // let original update run + super.onEntityUpdate(); + if (isDead) return; + + // and then re-do motion calculations without player tracking + + this.posX = x; + this.posY = y; + this.posZ = z; + + this.motionX = vx; + this.motionY = vy; + this.motionZ = vz; this.prevPosX = this.posX; this.prevPosY = this.posY; @@ -35,11 +47,11 @@ public class EntityXPOrbNoFly extends EntityXPOrb { this.motionY -= 0.029999999329447746D; final BlockPos pos = new BlockPos(this); - if (this.worldObj.getBlockState(pos).getBlock().getMaterial() == Material.lava) { + if (this.worldObj.getBlockState(pos).getMaterial() == Material.LAVA) { this.motionY = 0.20000000298023224D; this.motionX = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F; this.motionZ = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F; - playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + playSound(SoundEvents.ENTITY_GENERIC_BURN, 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); } pushOutOfBlocks(this.posX, (getEntityBoundingBox().minY + getEntityBoundingBox().maxY) / 2.0D, this.posZ); @@ -47,8 +59,7 @@ public class EntityXPOrbNoFly extends EntityXPOrb { moveEntity(this.motionX, this.motionY, this.motionZ); final float f; - if (this.onGround) - { + if (this.onGround) { final BlockPos posUnder = new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ)); f = this.worldObj.getBlockState(posUnder).getBlock().slipperiness * 0.98F; } else { @@ -59,18 +70,9 @@ public class EntityXPOrbNoFly extends EntityXPOrb { this.motionY *= 0.98; this.motionZ *= f; - if (this.onGround) - { + if (this.onGround) { this.motionY *= -0.8999999761581421D; } - - ++this.xpColor; - ++this.xpOrbAge; - - if (this.xpOrbAge >= 6000) - { - setDead(); - } } } diff --git a/src/main/java/openblocks/common/entity/ai/EntityAIBreakBlock.java b/src/main/java/openblocks/common/entity/ai/EntityAIBreakBlock.java index a1356801..87694be4 100644 --- a/src/main/java/openblocks/common/entity/ai/EntityAIBreakBlock.java +++ b/src/main/java/openblocks/common/entity/ai/EntityAIBreakBlock.java @@ -1,15 +1,14 @@ package openblocks.common.entity.ai; import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.init.Blocks; -import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.Path; import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import openmods.OpenMods; @@ -44,8 +43,8 @@ public class EntityAIBreakBlock extends EntityAIBase { blockCoord = new BlockPos( x + entity.posX, y + entity.posY, - z + entity.posZ - ); + z + entity.posZ); + if (canHarvestBlock(blockCoord)) { return true; } blockCoord = null; } @@ -70,7 +69,7 @@ public class EntityAIBreakBlock extends EntityAIBase { @Override public void startExecuting() { if (blockCoord != null) { - final PathEntity pathentity = pathFinder.getPathToPos(blockCoord); + final Path pathentity = pathFinder.getPathToPos(blockCoord); pathFinder.setPath(pathentity, 1.0); } } @@ -90,6 +89,6 @@ public class EntityAIBreakBlock extends EntityAIBase { public boolean canHarvestBlock(BlockPos coord) { final Block block = entity.worldObj.getBlockState(coord).getBlock(); return block instanceof BlockFlower || - block == Blocks.torch; + block == Blocks.TORCH; } } diff --git a/src/main/java/openblocks/common/entity/ai/EntityAICollectItem.java b/src/main/java/openblocks/common/entity/ai/EntityAICollectItem.java index a7d0c2e8..f4d25b89 100644 --- a/src/main/java/openblocks/common/entity/ai/EntityAICollectItem.java +++ b/src/main/java/openblocks/common/entity/ai/EntityAICollectItem.java @@ -1,13 +1,13 @@ package openblocks.common.entity.ai; import java.util.List; - import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemFood; +import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; +import openblocks.OpenBlocks; import openblocks.common.entity.EntityLuggage; import openmods.inventory.legacy.ItemDistribution; @@ -82,8 +82,8 @@ public class EntityAICollectItem extends EntityAIBase { // Check that the size changed if (preEatSize != stack.stackSize) { if (luggage.lastSound > 15) { - boolean isFood = stack.getItem() instanceof ItemFood; - luggage.playSound(isFood? "openblocks:luggage.eat.food" : "openblocks:luggage.eat.item", + boolean isFood = stack.getItemUseAction() == EnumAction.EAT; + luggage.playSound(isFood? OpenBlocks.Sounds.ENTITY_LUGGAGE_EAT_FOOD : OpenBlocks.Sounds.ENTITY_LUGGAGE_EAT_ITEM, 0.5f, 1.0f + (luggage.worldObj.rand.nextFloat() * 0.2f)); luggage.lastSound = 0; } diff --git a/src/main/java/openblocks/common/entity/ai/EntityAIPickupPlayer.java b/src/main/java/openblocks/common/entity/ai/EntityAIPickupPlayer.java index cd00a3d1..c50b935a 100644 --- a/src/main/java/openblocks/common/entity/ai/EntityAIPickupPlayer.java +++ b/src/main/java/openblocks/common/entity/ai/EntityAIPickupPlayer.java @@ -1,15 +1,13 @@ package openblocks.common.entity.ai; +import com.mojang.authlib.GameProfile; import java.util.List; - import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.pathfinding.PathNavigate; import net.minecraft.world.World; import openblocks.common.entity.EntityMiniMe; -import com.mojang.authlib.GameProfile; - public class EntityAIPickupPlayer extends EntityAIBase { private EntityMiniMe minime; @@ -65,7 +63,7 @@ public class EntityAIPickupPlayer extends EntityAIBase { World world = minime.worldObj; if (!world.isRemote && canRidePlayer(targetPlayer)) { if (minime.getDistanceToEntity(targetPlayer) < 1.0) { - targetPlayer.mountEntity(minime); + targetPlayer.startRiding(minime); } } } @@ -74,6 +72,6 @@ public class EntityAIPickupPlayer extends EntityAIBase { final GameProfile owner = minime.getOwner(); return owner != null && player != null && player.getGameProfile().getId().equals(owner.getId()) && - player.ridingEntity == null; + player.isRiding(); } } diff --git a/src/main/java/openblocks/common/item/ItemCartographer.java b/src/main/java/openblocks/common/item/ItemCartographer.java index cdd18fb0..fc81f763 100644 --- a/src/main/java/openblocks/common/item/ItemCartographer.java +++ b/src/main/java/openblocks/common/item/ItemCartographer.java @@ -1,11 +1,13 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -48,7 +50,7 @@ public class ItemCartographer extends Item { } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if (!player.capabilities.isCreativeMode) --stack.stackSize; if (!world.isRemote) { @@ -59,7 +61,7 @@ public class ItemCartographer extends Item { } } - return stack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } public static AssistantType getTypeFromItem(ItemStack stack) { diff --git a/src/main/java/openblocks/common/item/ItemCraneBackpack.java b/src/main/java/openblocks/common/item/ItemCraneBackpack.java index 5566526d..9689f2ef 100644 --- a/src/main/java/openblocks/common/item/ItemCraneBackpack.java +++ b/src/main/java/openblocks/common/item/ItemCraneBackpack.java @@ -4,10 +4,11 @@ import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -19,40 +20,35 @@ import openmods.infobook.BookDocumentation; @BookDocumentation(customName = "crane_backpack", hasVideo = true) public class ItemCraneBackpack extends ItemArmor { - private static final int ARMOR_CHESTPIECE = 1; public static final String TEXTURE_CRANE = "openblocks:textures/models/crane.png"; public ItemCraneBackpack() { - super(ArmorMaterial.IRON, 2, ARMOR_CHESTPIECE); + super(ArmorMaterial.IRON, 2, EntityEquipmentSlot.CHEST); } @Override - public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { - return armorType == ARMOR_CHESTPIECE; + public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity) { + return armorType == EntityEquipmentSlot.CHEST; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - return armorSlot == ARMOR_CHESTPIECE? ModelCraneBackpack.instance : null; + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped _default) { + return armorSlot == EntityEquipmentSlot.CHEST? ModelCraneBackpack.instance : null; } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot armorSlot, String type) { return TEXTURE_CRANE; } private static boolean isPointInBlock(World world, EntityPlayer player, double radius) { - double posX = player.posX - + radius - * MathHelper.cos((player.rotationYaw + 90) * (float)Math.PI / 180); + double posX = player.posX + radius * MathHelper.cos((player.rotationYaw + 90) * (float)Math.PI / 180); double posY = player.posY + player.getEyeHeight() + 0.2; - double posZ = player.posZ - + radius - * MathHelper.sin((player.rotationYaw + 90) * (float)Math.PI / 180); + double posZ = player.posZ + radius * MathHelper.sin((player.rotationYaw + 90) * (float)Math.PI / 180); AxisAlignedBB aabb = new AxisAlignedBB(posX - 0.1, posY - 0.1, posZ - 0.1, posX + 0.1, posY + 0.1, posZ + 0.1); - return !world.getCollidingBoundingBoxes(player, aabb).isEmpty(); + return !world.getCollisionBoxes(player, aabb).isEmpty(); } @Override @@ -61,6 +57,7 @@ public class ItemCraneBackpack extends ItemArmor { if (!world.isRemote) CraneRegistry.instance.ensureMagnetExists(player); if (Config.doCraneCollisionCheck) { + // TODO 1.10 verify if this still works boolean isColliding = isPointInBlock(world, player, CraneRegistry.ARM_RADIUS) || isPointInBlock(world, player, 2 * CraneRegistry.ARM_RADIUS / 3) || isPointInBlock(world, player, CraneRegistry.ARM_RADIUS / 3); @@ -80,8 +77,8 @@ public class ItemCraneBackpack extends ItemArmor { } } - public static boolean isWearingCrane(EntityPlayer player) { - ItemStack armor = player.getCurrentArmor(2); + public static boolean isWearingCrane(EntityLivingBase player) { + ItemStack armor = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); return armor != null && armor.getItem() instanceof ItemCraneBackpack; } } diff --git a/src/main/java/openblocks/common/item/ItemCraneControl.java b/src/main/java/openblocks/common/item/ItemCraneControl.java index 347b16f4..23e3a9fd 100644 --- a/src/main/java/openblocks/common/item/ItemCraneControl.java +++ b/src/main/java/openblocks/common/item/ItemCraneControl.java @@ -1,13 +1,16 @@ package openblocks.common.item; +import com.google.common.collect.MapMaker; import java.util.Map; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; import openblocks.Config; import openblocks.common.CraneRegistry; @@ -15,8 +18,6 @@ import openblocks.common.entity.EntityMagnet; import openmods.OpenMods; import openmods.infobook.BookDocumentation; -import com.google.common.collect.MapMaker; - @BookDocumentation(customName = "crane_control", hasVideo = true) public class ItemCraneControl extends Item { @@ -54,19 +55,19 @@ public class ItemCraneControl extends Item { } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { CraneRegistry.Data data = CraneRegistry.instance.getData(player, false); if (data != null) { data.isExtending = Config.craneShiftControl? player.isSneaking() : !data.isExtending; } - player.setItemInUse(stack, getMaxItemUseDuration(stack)); - return stack; + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { + public void onUsingTick(ItemStack stack, EntityLivingBase player, int count) { if (player instanceof EntityPlayerMP && ItemCraneBackpack.isWearingCrane(player)) { CraneRegistry.Data data = CraneRegistry.instance.getData(player, true); diff --git a/src/main/java/openblocks/common/item/ItemCursor.java b/src/main/java/openblocks/common/item/ItemCursor.java index a3cb8117..81fac631 100644 --- a/src/main/java/openblocks/common/item/ItemCursor.java +++ b/src/main/java/openblocks/common/item/ItemCursor.java @@ -1,14 +1,19 @@ package openblocks.common.item; +import javax.annotation.Nullable; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import openblocks.Config; import openmods.infobook.BookDocumentation; import openmods.utils.EnchantmentUtils; import openmods.utils.ItemUtils; @@ -17,6 +22,7 @@ import openmods.utils.NbtUtils; @BookDocumentation(hasVideo = true) public class ItemCursor extends Item { + // TODO 1.10 maybe allow offhand item use? public ItemCursor() { setMaxStackSize(1); } @@ -27,42 +33,46 @@ public class ItemCursor extends Item { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { NBTTagCompound tag = ItemUtils.getItemTag(stack); - tag.setInteger("dimension", world.provider.getDimensionId()); + tag.setInteger("dimension", world.provider.getDimension()); NbtUtils.store(tag, pos); - tag.setInteger("side", side.ordinal()); - return true; + tag.setInteger("side", facing.ordinal()); + return EnumActionResult.SUCCESS; } @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (world.isRemote) return itemStack; + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + if (!world.isRemote) { + NBTTagCompound tag = stack.getTagCompound(); + if (tag != null && NbtUtils.hasCoordinates(tag) && tag.hasKey("dimension")) { + final int dimension = tag.getInteger("dimension"); - NBTTagCompound tag = itemStack.getTagCompound(); - if (tag != null && NbtUtils.hasCoordinates(tag) && tag.hasKey("dimension")) { - final int dimension = tag.getInteger("dimension"); - - final BlockPos pos = NbtUtils.readBlockPos(tag); - if (world.provider.getDimensionId() == dimension && world.isBlockLoaded(pos)) { - final EnumFacing side = NbtUtils.readEnum(tag, "side", EnumFacing.UP); - clickBlock(world, player, pos, side); + final BlockPos pos = NbtUtils.readBlockPos(tag); + if (world.provider.getDimension() == dimension && world.isBlockLoaded(pos)) { + final EnumFacing side = NbtUtils.readEnum(tag, "side", EnumFacing.UP); + clickBlock(world, player, hand, stack, pos, side); + } } } - return itemStack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - private static void clickBlock(World world, EntityPlayer player, BlockPos pos, EnumFacing side) { + private static void clickBlock(World world, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, BlockPos pos, EnumFacing side) { if (!world.isAirBlock(pos)) { final IBlockState state = world.getBlockState(pos); - final Block block = state.getBlock(); - if (player.capabilities.isCreativeMode) block.onBlockActivated(world, pos, state, player, side, 0, 0, 0); - else { - final int cost = (int)Math.max(0, Math.sqrt(player.getDistanceSq(pos)) - 10); - final int playerExperience = EnchantmentUtils.getPlayerXP(player); - if (cost <= playerExperience) { - block.onBlockActivated(world, pos, state, player, side, 0, 0, 0); - EnchantmentUtils.addPlayerXP(player, -cost); + final double distanceToLinkedBlock = player.getDistanceSq(pos); + if (distanceToLinkedBlock < Config.cursorDistanceLimit) { + final Block block = state.getBlock(); + if (player.capabilities.isCreativeMode) { + block.onBlockActivated(world, pos, state, player, hand, heldItem, side, 0, 0, 0); + } else { + final int cost = (int)Math.max(0, distanceToLinkedBlock - 10); + final int playerExperience = EnchantmentUtils.getPlayerXP(player); + if (cost <= playerExperience) { + block.onBlockActivated(world, pos, state, player, hand, heldItem, side, 0, 0, 0); + EnchantmentUtils.addPlayerXP(player, -cost); + } } } } diff --git a/src/main/java/openblocks/common/item/ItemDevNull.java b/src/main/java/openblocks/common/item/ItemDevNull.java index 1f5f9190..79143805 100644 --- a/src/main/java/openblocks/common/item/ItemDevNull.java +++ b/src/main/java/openblocks/common/item/ItemDevNull.java @@ -1,14 +1,14 @@ package openblocks.common.item; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -16,7 +16,9 @@ import openblocks.Config; import openblocks.OpenBlocks; import openblocks.OpenBlocksGuiHandler; import openmods.infobook.BookDocumentation; -import openmods.inventory.*; +import openmods.inventory.ItemInventory; +import openmods.inventory.PlayerItemInventory; +import openmods.inventory.StackEqualityTesterBuilder; import openmods.inventory.StackEqualityTesterBuilder.IEqualityTester; import openmods.inventory.legacy.ItemDistribution; @@ -29,8 +31,8 @@ public class ItemDevNull extends Item { private final EntityPlayer player; - public DevNullInventory(EntityPlayer player) { - super(player, 1); + public DevNullInventory(EntityPlayer player, int protectedSlot) { + super(player, 1, protectedSlot); this.player = player; } @@ -49,7 +51,7 @@ public class ItemDevNull extends Item { } private void checkStack(ItemStack stack) { - if (calculateDepth(stack) > STACK_LIMIT) player.triggerAchievement(OpenBlocks.stackAchievement); + if (calculateDepth(stack) > STACK_LIMIT) player.addStat(OpenBlocks.stackAchievement); } } @@ -72,40 +74,23 @@ public class ItemDevNull extends Item { } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if (!world.isRemote && (!Config.devNullSneakGui || player.isSneaking())) player.openGui(OpenBlocks.instance, OpenBlocksGuiHandler.GuiId.devNull.ordinal(), world, player.inventory.currentItem, 0, 0); - return stack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { - IInventory inventory = new ItemInventory(stack, 1); - ItemStack containedStack = inventory.getStackInSlot(0); - if (containedStack != null) { - Item item = containedStack.getItem(); - if (item instanceof ItemBlock) { - final Block placedBlock = ((ItemBlock)item).getBlock(); - // logic based on ItemBlock.canPlaceBlockOnSide, so don't blame me for hardcoding - final Block block = world.getBlockState(pos).getBlock(); - - if (block == Blocks.snow_layer && block.isReplaceable(world, pos)) side = EnumFacing.UP; - else if (!block.isReplaceable(world, pos)) pos = pos.offset(side); - - return world.canBlockBePlaced(placedBlock, pos, false, side, null, stack); - } - } - - return false; - } + // TODO 1.10 removed onItemUseFirst, verify if it was needed? @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + if (hand == EnumHand.OFF_HAND) return EnumActionResult.PASS; // TODO 1.10 verify if it works as expected? + PlayerItemInventory inventory = new PlayerItemInventory(player, 1); ItemStack containedStack = inventory.getStackInSlot(0); if (containedStack != null) { Item item = containedStack.getItem(); if (item instanceof ItemBlock) { - boolean response = ((ItemBlock)item).onItemUse(containedStack, player, world, pos, side, hitX, hitY, hitZ); + EnumActionResult response = item.onItemUse(containedStack, player, world, pos, hand, facing, hitX, hitY, hitZ); if (containedStack.stackSize == 0) { inventory.setInventorySlotContents(0, null); } @@ -113,7 +98,7 @@ public class ItemDevNull extends Item { return response; } } - return true; + return EnumActionResult.PASS; // TODO 1.01 verify this result } private static final IEqualityTester tester = new StackEqualityTesterBuilder().useItem().useDamage().useNBT().build(); @@ -121,8 +106,8 @@ public class ItemDevNull extends Item { @SubscribeEvent public void onItemPickUp(EntityItemPickupEvent evt) { - final EntityPlayer player = evt.entityPlayer; - final ItemStack pickedStack = evt.item.getEntityItem(); + final EntityPlayer player = evt.getEntityPlayer(); + final ItemStack pickedStack = evt.getItem().getEntityItem(); if (pickedStack == null || player == null) return; diff --git a/src/main/java/openblocks/common/item/ItemElevator.java b/src/main/java/openblocks/common/item/ItemElevator.java index b1a02558..3707838f 100644 --- a/src/main/java/openblocks/common/item/ItemElevator.java +++ b/src/main/java/openblocks/common/item/ItemElevator.java @@ -1,7 +1,6 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; diff --git a/src/main/java/openblocks/common/item/ItemEmptyMap.java b/src/main/java/openblocks/common/item/ItemEmptyMap.java index 1552562b..1ba6f15b 100644 --- a/src/main/java/openblocks/common/item/ItemEmptyMap.java +++ b/src/main/java/openblocks/common/item/ItemEmptyMap.java @@ -1,7 +1,6 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/main/java/openblocks/common/item/ItemEpicEraser.java b/src/main/java/openblocks/common/item/ItemEpicEraser.java index ad253213..0ad98f40 100644 --- a/src/main/java/openblocks/common/item/ItemEpicEraser.java +++ b/src/main/java/openblocks/common/item/ItemEpicEraser.java @@ -7,9 +7,11 @@ import openmods.infobook.BookDocumentation; @BookDocumentation(customName = "epic_eraser") public class ItemEpicEraser extends Item { + private static final int MAX_DAMAGE = 15; + public ItemEpicEraser() { setMaxStackSize(1); - setMaxDamage(15); + setMaxDamage(MAX_DAMAGE); } @Override @@ -26,7 +28,7 @@ public class ItemEpicEraser extends Item { @Override public boolean hasContainerItem(ItemStack stack) { - return stack.getItemDamage() < getMaxDamage() - 1; + return stack.getItemDamage() < MAX_DAMAGE - 1; } } diff --git a/src/main/java/openblocks/common/item/ItemFilledBucket.java b/src/main/java/openblocks/common/item/ItemFilledBucket.java index 5b910d82..c4c63352 100644 --- a/src/main/java/openblocks/common/item/ItemFilledBucket.java +++ b/src/main/java/openblocks/common/item/ItemFilledBucket.java @@ -6,7 +6,7 @@ import openmods.item.ItemGeneric; public class ItemFilledBucket extends ItemGeneric { public ItemFilledBucket() { - setContainerItem(Items.bucket); + setContainerItem(Items.BUCKET); setMaxStackSize(1); } } diff --git a/src/main/java/openblocks/common/item/ItemFlagBlock.java b/src/main/java/openblocks/common/item/ItemFlagBlock.java index 3c7668e5..750f46ae 100644 --- a/src/main/java/openblocks/common/item/ItemFlagBlock.java +++ b/src/main/java/openblocks/common/item/ItemFlagBlock.java @@ -3,8 +3,11 @@ package openblocks.common.item; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.common.block.BlockFlag; import openmods.item.ItemOpenBlock; @@ -16,16 +19,16 @@ public class ItemFlagBlock extends ItemOpenBlock { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { - if (player.isSneaking()) return false; + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + if (player.isSneaking()) return EnumActionResult.PASS; // TODO 1.10 pass or fail? Should allow offhand use... - return super.onItemUse(stack, player, world, pos, side, hitX, hitY, hitZ); + return super.onItemUse(stack, player, world, pos, hand, facing, hitX, hitY, hitZ); } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { stack.setItemDamage((stack.getItemDamage() + 1) % BlockFlag.COLORS.length); - return stack.copy(); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); // TODO 1.10 verify } } diff --git a/src/main/java/openblocks/common/item/ItemGoldenEye.java b/src/main/java/openblocks/common/item/ItemGoldenEye.java index 61c718d2..f6e5bce8 100644 --- a/src/main/java/openblocks/common/item/ItemGoldenEye.java +++ b/src/main/java/openblocks/common/item/ItemGoldenEye.java @@ -1,17 +1,21 @@ package openblocks.common.item; +import com.google.common.base.Strings; import java.util.List; import java.util.Map; - import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.fml.relauncher.Side; @@ -20,10 +24,9 @@ import openblocks.Config; import openblocks.common.entity.EntityGoldenEye; import openmods.Log; import openmods.utils.ItemUtils; +import openmods.utils.TranslationUtils; import openmods.world.StructureRegistry; -import com.google.common.base.Strings; - public class ItemGoldenEye extends Item { public static final int MAX_DAMAGE = 100; @@ -35,16 +38,17 @@ public class ItemGoldenEye extends Item { } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if (world instanceof WorldServer && player instanceof EntityPlayerMP) { EntityPlayerMP betterPlayer = (EntityPlayerMP)player; if (player.isSneaking()) tryLearnStructure(stack, (WorldServer)world, betterPlayer); else { if (trySpawnEntity(stack, (WorldServer)world, betterPlayer)) stack.stackSize = 0; } + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - return stack; + return ActionResult.newResult(EnumActionResult.PASS, stack); } private static void tryLearnStructure(ItemStack stack, WorldServer world, EntityPlayerMP player) { @@ -55,7 +59,7 @@ public class ItemGoldenEye extends Item { for (Map.Entry e : nearbyStructures.entrySet()) { BlockPos pos = e.getValue(); - if (Config.eyeDebug) player.addChatMessage(new ChatComponentTranslation( + if (Config.eyeDebug) player.addChatMessage(new TextComponentTranslation( "openblocks.misc.structure_pos", e.getKey(), pos.getX(), pos.getY(), pos.getZ())); double distSq = player.getDistanceSqToCenter(pos); @@ -86,13 +90,13 @@ public class ItemGoldenEye extends Item { BlockPos structurePos = nearbyStructures.get(structureName); if (structurePos != null) { - if (Config.eyeDebug) player.addChatComponentMessage(new ChatComponentTranslation( + if (Config.eyeDebug) player.addChatComponentMessage(new TextComponentTranslation( "openblocks.misc.structure_pos", structureName, structurePos.getX(), structurePos.getY(), structurePos.getZ())); stack.setItemDamage(damage + 1); EntityGoldenEye eye = new EntityGoldenEye(world, stack, player, structurePos); world.spawnEntityInWorld(eye); - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDEREYE_LAUNCH, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); return true; } return false; @@ -102,14 +106,14 @@ public class ItemGoldenEye extends Item { @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List result) { result.add(new ItemStack(item, 1, 0)); - result.add(new ItemStack(item, 1, getMaxDamage())); + result.add(new ItemStack(item, 1, MAX_DAMAGE)); } @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List result, boolean expanded) { NBTTagCompound tag = ItemUtils.getItemTag(stack); - if (tag.hasKey(TAG_STRUCTURE)) result.add(StatCollector.translateToLocal("openblocks.misc.locked")); + if (tag.hasKey(TAG_STRUCTURE)) result.add(TranslationUtils.translateToLocal("openblocks.misc.locked")); } } diff --git a/src/main/java/openblocks/common/item/ItemGuide.java b/src/main/java/openblocks/common/item/ItemGuide.java index a4bc40de..38c7e865 100644 --- a/src/main/java/openblocks/common/item/ItemGuide.java +++ b/src/main/java/openblocks/common/item/ItemGuide.java @@ -1,14 +1,13 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import openblocks.shapes.GuideShape; import openmods.item.ItemOpenBlock; +import openmods.utils.TranslationUtils; public class ItemGuide extends ItemOpenBlock { @@ -34,7 +33,7 @@ public class ItemGuide extends ItemOpenBlock { } private static void addIntInfo(NBTTagCompound tag, String name, String format, List result) { - if (tag.hasKey(name)) result.add(StatCollector.translateToLocalFormatted(format, tag.getInteger(name))); + if (tag.hasKey(name)) result.add(TranslationUtils.translateToLocalFormatted(format, tag.getInteger(name))); } @Override @@ -51,7 +50,7 @@ public class ItemGuide extends ItemOpenBlock { final int negY = -tag.getInteger(TAG_NEG_Y); final int negZ = -tag.getInteger(TAG_NEG_Z); - result.add(StatCollector.translateToLocalFormatted("openblocks.misc.box", negX, negY, negZ, posX, posY, posZ)); + result.add(TranslationUtils.translateToLocalFormatted("openblocks.misc.box", negX, negY, negZ, posX, posY, posZ)); } else { addIntInfo(tag, TAG_WIDTH, "openblocks.misc.width", result); addIntInfo(tag, TAG_HEIGHT, "openblocks.misc.height", result); @@ -64,7 +63,7 @@ public class ItemGuide extends ItemOpenBlock { int mode = tag.getInteger(TAG_SHAPE); try { GuideShape shape = GuideShape.VALUES[mode]; - result.add(StatCollector.translateToLocalFormatted("openblocks.misc.shape", shape.getLocalizedName())); + result.add(TranslationUtils.translateToLocalFormatted("openblocks.misc.shape", shape.getLocalizedName())); } catch (ArrayIndexOutOfBoundsException e) {} } } diff --git a/src/main/java/openblocks/common/item/ItemHangGlider.java b/src/main/java/openblocks/common/item/ItemHangGlider.java index f65f2e45..d1a35b52 100644 --- a/src/main/java/openblocks/common/item/ItemHangGlider.java +++ b/src/main/java/openblocks/common/item/ItemHangGlider.java @@ -1,31 +1,37 @@ package openblocks.common.item; +import com.google.common.collect.MapMaker; import java.util.Map; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; import openblocks.common.entity.EntityHangGlider; import openmods.infobook.BookDocumentation; -import com.google.common.collect.MapMaker; - @BookDocumentation(hasVideo = true) public class ItemHangGlider extends Item { + // TODO 1.10 allow using offhand + private static Map spawnedGlidersMap = new MapMaker().weakKeys().weakValues().makeMap(); public ItemHangGlider() {} @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if (!world.isRemote && player != null) { EntityHangGlider glider = spawnedGlidersMap.get(player); if (glider != null) despawnGlider(player, glider); else spawnGlider(player); + + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - return itemStack; + + return ActionResult.newResult(EnumActionResult.PASS, stack); } private static void despawnGlider(EntityPlayer player, EntityHangGlider glider) { diff --git a/src/main/java/openblocks/common/item/ItemHeightMap.java b/src/main/java/openblocks/common/item/ItemHeightMap.java index 6ec95b26..f6e494ce 100644 --- a/src/main/java/openblocks/common/item/ItemHeightMap.java +++ b/src/main/java/openblocks/common/item/ItemHeightMap.java @@ -1,7 +1,6 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/main/java/openblocks/common/item/ItemImaginary.java b/src/main/java/openblocks/common/item/ItemImaginary.java index 5b3efbd6..b9681bed 100644 --- a/src/main/java/openblocks/common/item/ItemImaginary.java +++ b/src/main/java/openblocks/common/item/ItemImaginary.java @@ -1,26 +1,33 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.*; -import net.minecraft.nbt.NBTBase.NBTPrimitive; -import net.minecraft.util.*; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTPrimitive; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.Config; -import openblocks.common.tileentity.*; +import openblocks.common.tileentity.TileEntityImaginary; import openblocks.common.tileentity.TileEntityImaginary.ICollisionData; import openblocks.common.tileentity.TileEntityImaginary.PanelData; import openblocks.common.tileentity.TileEntityImaginary.StairsData; import openmods.colors.ColorMeta; import openmods.item.ItemOpenBlock; import openmods.utils.ItemUtils; +import openmods.utils.TranslationUtils; public class ItemImaginary extends ItemOpenBlock { @@ -171,19 +178,17 @@ public class ItemImaginary extends ItemOpenBlock { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { - if (stack == null) return false; - + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { NBTTagCompound tag = ItemUtils.getItemTag(stack); float uses = getUses(tag); if (uses <= 0) { stack.stackSize = 0; - return true; + return EnumActionResult.FAIL; } - if (uses < getMode(tag).cost) return false; + if (uses < getMode(tag).cost) return EnumActionResult.FAIL; - return super.onItemUse(stack, player, world, pos, side, hitX, hitY, hitZ); + return super.onItemUse(stack, player, world, pos, hand, facing, hitX, hitY, hitZ); } @Override @@ -202,14 +207,14 @@ public class ItemImaginary extends ItemOpenBlock { public void addInformation(ItemStack stack, EntityPlayer player, List result, boolean extended) { NBTTagCompound tag = ItemUtils.getItemTag(stack); - result.add(StatCollector.translateToLocalFormatted("openblocks.misc.uses", getUses(tag))); + result.add(TranslationUtils.translateToLocalFormatted("openblocks.misc.uses", getUses(tag))); NBTTagInt color = (NBTTagInt)tag.getTag(TAG_COLOR); - if (color != null) result.add(StatCollector.translateToLocalFormatted("openblocks.misc.color", color.getInt())); + if (color != null) result.add(TranslationUtils.translateToLocalFormatted("openblocks.misc.color", color.getInt())); PlacementMode mode = getMode(tag); - String translatedMode = StatCollector.translateToLocal(mode.name); - result.add(StatCollector.translateToLocalFormatted("openblocks.misc.mode", translatedMode)); + String translatedMode = TranslationUtils.translateToLocal(mode.name); + result.add(TranslationUtils.translateToLocalFormatted("openblocks.misc.mode", translatedMode)); } @Override @@ -219,16 +224,7 @@ public class ItemImaginary extends ItemOpenBlock { result.add(setupValues(color.rgb, new ItemStack(this, 1, DAMAGE_CRAYON))); } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) { - if (isCrayon(stack) && pass == 1) { - NBTTagCompound tag = stack.getTagCompound(); - return tag != null? tag.getInteger(TAG_COLOR) : 0x000000; - } - - return 0xFFFFFF; - } + // TODO 1.10 item coloring @Override public boolean hasContainerItem(ItemStack stack) { @@ -248,7 +244,7 @@ public class ItemImaginary extends ItemOpenBlock { } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { NBTTagCompound tag = ItemUtils.getItemTag(stack); if (getUses(tag) <= 0) { stack.stackSize = 0; @@ -259,11 +255,11 @@ public class ItemImaginary extends ItemOpenBlock { if (world.isRemote) { PlacementMode mode = PlacementMode.VALUES[modeId]; - ChatComponentTranslation modeName = new ChatComponentTranslation(mode.name); - player.addChatComponentMessage(new ChatComponentTranslation("openblocks.misc.mode", modeName)); + TextComponentTranslation modeName = new TextComponentTranslation(mode.name); + player.addChatComponentMessage(new TextComponentTranslation("openblocks.misc.mode", modeName)); } } - - return stack; + // TODO 1.10 verify if mode change is stored + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } } diff --git a/src/main/java/openblocks/common/item/ItemImaginationGlasses.java b/src/main/java/openblocks/common/item/ItemImaginationGlasses.java index f6d21af9..e4dd4ac0 100644 --- a/src/main/java/openblocks/common/item/ItemImaginationGlasses.java +++ b/src/main/java/openblocks/common/item/ItemImaginationGlasses.java @@ -1,21 +1,21 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.common.tileentity.TileEntityImaginary; import openblocks.common.tileentity.TileEntityImaginary.Property; import openmods.colors.ColorMeta; import openmods.utils.ItemUtils; +import openmods.utils.TranslationUtils; public class ItemImaginationGlasses extends ItemArmor { @@ -52,32 +52,25 @@ public class ItemImaginationGlasses extends ItemArmor { return stack; } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) { - return getGlassesColor(stack); - } + // TODO 1.10 glasses color @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List result, boolean extended) { - result.add(StatCollector.translateToLocalFormatted("openblocks.misc.color", getColor(stack))); + result.add(TranslationUtils.translateToLocalFormatted("openblocks.misc.color", getColor(stack))); } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { if ("overlay".equals(type)) return "openblocks:textures/models/glasses_crayon_overlay.png"; - return super.getArmorTexture(stack, entity, slot, type); } } - private static final int ARMOR_HELMET = 0; - public final Type type; public ItemImaginationGlasses(Type type) { - super(ArmorMaterial.GOLD, 1, ARMOR_HELMET); + super(ArmorMaterial.GOLD, 1, EntityEquipmentSlot.HEAD); this.type = type; setHasSubtypes(true); } @@ -122,7 +115,7 @@ public class ItemImaginationGlasses extends ItemArmor { } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return this.type.textureName; } diff --git a/src/main/java/openblocks/common/item/ItemInfoBook.java b/src/main/java/openblocks/common/item/ItemInfoBook.java index c27e3107..b3688d46 100644 --- a/src/main/java/openblocks/common/item/ItemInfoBook.java +++ b/src/main/java/openblocks/common/item/ItemInfoBook.java @@ -3,6 +3,9 @@ package openblocks.common.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; import net.minecraftforge.fml.common.FMLCommonHandler; import openblocks.client.gui.GuiInfoBook; @@ -12,8 +15,8 @@ public class ItemInfoBook extends Item { public ItemInfoBook() {} @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if (world.isRemote) FMLCommonHandler.instance().showGuiScreen(new GuiInfoBook()); - return stack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } } diff --git a/src/main/java/openblocks/common/item/ItemLuggage.java b/src/main/java/openblocks/common/item/ItemLuggage.java index 672fcea0..8587e184 100644 --- a/src/main/java/openblocks/common/item/ItemLuggage.java +++ b/src/main/java/openblocks/common/item/ItemLuggage.java @@ -3,7 +3,10 @@ package openblocks.common.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import openblocks.common.entity.EntityLuggage; import openmods.infobook.BookDocumentation; @@ -16,21 +19,21 @@ public class ItemLuggage extends Item { } @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) { if (!world.isRemote) { - - Vec3 vec3 = new Vec3(player.posX, player.posY, player.posZ); - Vec3 vec31 = player.getLook(1.0f); - Vec3 vec32 = vec3.addVector(vec31.xCoord * 2.0f, vec31.yCoord * 2.0f, vec31.zCoord * 2.0f); + Vec3d vec3 = new Vec3d(player.posX, player.posY, player.posZ); + Vec3d vec31 = player.getLook(1.0f); + Vec3d vec32 = vec3.addVector(vec31.xCoord * 2.0f, vec31.yCoord * 2.0f, vec31.zCoord * 2.0f); EntityLuggage luggage = new EntityLuggage(world); luggage.setPositionAndRotation(0.5 + vec32.xCoord, vec3.yCoord, 0.5 + vec32.zCoord, 0, 0); - luggage.setOwnerId(player.getGameProfile().getId().toString()); + luggage.setOwnerId(player.getGameProfile().getId()); luggage.restoreFromStack(itemStack); world.spawnEntityInWorld(luggage); itemStack.stackSize--; } - return itemStack; + + return ActionResult.newResult(EnumActionResult.SUCCESS, itemStack); } } diff --git a/src/main/java/openblocks/common/item/ItemPaintBrush.java b/src/main/java/openblocks/common/item/ItemPaintBrush.java index 83da0e54..17468d9f 100644 --- a/src/main/java/openblocks/common/item/ItemPaintBrush.java +++ b/src/main/java/openblocks/common/item/ItemPaintBrush.java @@ -1,19 +1,20 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.OpenBlocks; import openblocks.api.IPaintableBlock; import openblocks.common.block.BlockCanvas; @@ -61,9 +62,9 @@ public class ItemPaintBrush extends Item { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { Integer color = getColorFromStack(stack); - if (stack.getItemDamage() > getMaxDamage() || color == null) return true; + if (stack.getItemDamage() > MAX_USES || color == null) return EnumActionResult.FAIL; if (PaintUtils.instance.isAllowedToReplace(world, pos)) { BlockCanvas.replaceBlock(world, pos); @@ -72,10 +73,10 @@ public class ItemPaintBrush extends Item { final boolean changed; if (player.isSneaking()) changed = tryRecolorBlock(world, pos, color, EnumFacing.VALUES); - else changed = tryRecolorBlock(world, pos, color, side); + else changed = tryRecolorBlock(world, pos, color, facing); if (changed) { - world.playSoundAtEntity(player, "mob.slime.small", 0.1F, 0.8F); + world.playSound(null, player.getPosition(), SoundEvents.ENTITY_SLIME_SQUISH, SoundCategory.PLAYERS, 0.1F, 0.8F); if (!player.capabilities.isCreativeMode) { if (stack.attemptDamageItem(1, player.getRNG())) { @@ -84,9 +85,11 @@ public class ItemPaintBrush extends Item { stack.setItemDamage(0); } } + + return EnumActionResult.SUCCESS; } - return true; + return EnumActionResult.FAIL; } private static boolean tryRecolorBlock(World world, BlockPos pos, int rgb, EnumFacing... sides) { @@ -123,16 +126,7 @@ public class ItemPaintBrush extends Item { return false; } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack itemStack, int pass) { - if (pass == 1) { - Integer color = getColorFromStack(itemStack); - if (color != null) return color; - } - - return 0xFFFFFF; - } + // TODO 1.10 figure out RGB item coloring public static Integer getColorFromStack(ItemStack stack) { if (stack.hasTagCompound()) { diff --git a/src/main/java/openblocks/common/item/ItemPaintCan.java b/src/main/java/openblocks/common/item/ItemPaintCan.java index 9fa6f339..0146119f 100644 --- a/src/main/java/openblocks/common/item/ItemPaintCan.java +++ b/src/main/java/openblocks/common/item/ItemPaintCan.java @@ -1,7 +1,6 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/openblocks/common/item/ItemPedometer.java b/src/main/java/openblocks/common/item/ItemPedometer.java index 04556242..cf24734d 100644 --- a/src/main/java/openblocks/common/item/ItemPedometer.java +++ b/src/main/java/openblocks/common/item/ItemPedometer.java @@ -4,9 +4,14 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; +import openblocks.OpenBlocks; import openblocks.common.PedometerHandler; import openblocks.common.PedometerHandler.PedometerData; import openblocks.common.PedometerHandler.PedometerState; @@ -20,17 +25,17 @@ public class ItemPedometer extends Item { } private static void send(EntityPlayer player, String format, Object... args) { - player.addChatComponentMessage(new ChatComponentTranslation(format, args)); + player.addChatComponentMessage(new TextComponentTranslation(format, args)); } private SpeedUnit speedUnit = SpeedUnit.M_PER_TICK; private DistanceUnit distanceUnit = DistanceUnit.M; @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if (world.isRemote) { if (player.isSneaking()) { - PedometerHandler.reset(player); + PedometerHandler.getProperty(player).reset(); send(player, "openblocks.misc.pedometer.tracking_reset"); } else { PedometerState state = PedometerHandler.getProperty(player); @@ -42,15 +47,16 @@ public class ItemPedometer extends Item { } } } else { - world.playSoundAtEntity(player, "openblocks:pedometer.use", 1F, 1F); + world.playSound(null, player.getPosition(), OpenBlocks.Sounds.ITEM_PEDOMETER_USE, SoundCategory.PLAYERS, 1F, 1F); } - return stack; + + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } protected void showPedometerData(EntityPlayer player, PedometerState state) { PedometerData result = state.getData(); if (result == null) return; - player.addChatComponentMessage(new ChatComponentText("")); + player.addChatComponentMessage(new TextComponentString("")); send(player, "openblocks.misc.pedometer.start_point", String.format("%.1f %.1f %.1f", result.startingPoint.xCoord, result.startingPoint.yCoord, result.startingPoint.zCoord)); send(player, "openblocks.misc.pedometer.speed", speedUnit.format(result.currentSpeed)); @@ -69,7 +75,10 @@ public class ItemPedometer extends Item { @Override public void onUpdate(ItemStack stack, World world, Entity entity, int slotId, boolean isSelected) { - if (world.isRemote && slotId < 9) PedometerHandler.updatePedometerData(entity); + if (world.isRemote && slotId < 9) { + PedometerState state = PedometerHandler.getProperty(entity); + if (state.isRunning()) state.update(entity); + } } // TODO 1.8.9 actually change model based on this diff --git a/src/main/java/openblocks/common/item/ItemSkyBlock.java b/src/main/java/openblocks/common/item/ItemSkyBlock.java index aac873c4..ad5fb75d 100644 --- a/src/main/java/openblocks/common/item/ItemSkyBlock.java +++ b/src/main/java/openblocks/common/item/ItemSkyBlock.java @@ -1,18 +1,16 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.common.block.BlockSky; -import openmods.utils.render.RenderUtils; +import openmods.utils.TranslationUtils; public class ItemSkyBlock extends ItemBlock { @@ -33,16 +31,12 @@ public class ItemSkyBlock extends ItemBlock { result.add(new ItemStack(this, 1, 1)); } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) { - return RenderUtils.getFogColor().getColor(); - } + // TODO 1.10 item colors @Override public void addInformation(ItemStack stack, EntityPlayer player, List result, boolean expanded) { super.addInformation(stack, player, result, expanded); - if (BlockSky.isInverted(stack.getItemDamage())) result.add(StatCollector.translateToLocal("openblocks.misc.inverted")); + if (BlockSky.isInverted(stack.getItemDamage())) result.add(TranslationUtils.translateToLocal("openblocks.misc.inverted")); } } diff --git a/src/main/java/openblocks/common/item/ItemSleepingBag.java b/src/main/java/openblocks/common/item/ItemSleepingBag.java index 1251495f..6b51f8cc 100644 --- a/src/main/java/openblocks/common/item/ItemSleepingBag.java +++ b/src/main/java/openblocks/common/item/ItemSleepingBag.java @@ -1,87 +1,73 @@ package openblocks.common.item; -import java.util.List; - -import net.minecraft.block.state.IBlockState; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayer.EnumStatus; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.play.server.S0APacketUseBed; -import net.minecraft.util.*; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.Constants; -import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import openblocks.api.SleepingBagUseEvent; import openblocks.asm.EntityPlayerVisitor; import openblocks.client.model.ModelSleepingBag; import openmods.infobook.BookDocumentation; -import openmods.reflection.FieldAccess; import openmods.utils.BlockUtils; import openmods.utils.ItemUtils; -import openmods.utils.NbtUtils; @BookDocumentation(customName = "sleepingbag") public class ItemSleepingBag extends ItemArmor { - private static final String TAG_SPAWN = "Spawn"; - private static final String TAG_POSITION = "Position"; private static final String TAG_SLEEPING = "Sleeping"; private static final String TAG_SLOT = "Slot"; - private static final int ARMOR_CHESTPIECE_TYPE = 1; - private static final int ARMOR_CHESTPIECE_SLOT = 2; - - private static final FieldAccess IS_SLEEPING = FieldAccess.create(EntityPlayer.class, "sleeping", "field_71083_bS"); - - private static final FieldAccess SLEEPING_TIMER = FieldAccess.create(EntityPlayer.class, "sleepTimer", "field_71076_b"); public static final String TEXTURE_SLEEPINGBAG = "openblocks:textures/models/sleepingbag.png"; public ItemSleepingBag() { - super(ArmorMaterial.IRON, 2, ARMOR_CHESTPIECE_TYPE); + super(ArmorMaterial.IRON, 2, EntityEquipmentSlot.CHEST); } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return TEXTURE_SLEEPINGBAG; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - return armorSlot == ARMOR_CHESTPIECE_TYPE? ModelSleepingBag.instance : null; + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped _default) { + return armorSlot == EntityEquipmentSlot.CHEST? ModelSleepingBag.instance : null; } @Override - public ItemStack onItemRightClick(ItemStack sleepingBagStack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(ItemStack heldStack, World world, EntityPlayer player, EnumHand hand) { if (!world.isRemote) { ItemStack currentArmor = getChestpieceSlot(player); if (currentArmor != null) currentArmor = currentArmor.copy(); - final ItemStack sleepingBagCopy = sleepingBagStack.copy(); + final ItemStack sleepingBagCopy = heldStack.copy(); NBTTagCompound tag = ItemUtils.getItemTag(sleepingBagCopy); tag.setInteger(TAG_SLOT, player.inventory.currentItem); setChestpieceSlot(player, sleepingBagCopy); - if (currentArmor != null) return currentArmor; - sleepingBagStack.stackSize = 0; + if (currentArmor != null) return ActionResult.newResult(EnumActionResult.SUCCESS, currentArmor); + heldStack.stackSize = 0; } - return sleepingBagStack; + + return ActionResult.newResult(EnumActionResult.SUCCESS, heldStack); } @Override - public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { - return armorType == ARMOR_CHESTPIECE_TYPE; + public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity) { + return armorType == EntityEquipmentSlot.CHEST; } @Override @@ -91,128 +77,23 @@ public class ItemSleepingBag extends ItemArmor { NBTTagCompound tag = ItemUtils.getItemTag(itemStack); if (!EntityPlayerVisitor.IsInBedHookSuccess) { - player.addChatComponentMessage(new ChatComponentTranslation("openblocks.misc.sleeping_bag_broken")); + player.addChatComponentMessage(new TextComponentTranslation("openblocks.misc.sleeping_bag_broken")); getOutOfSleepingBag(player); } else if (tag.getBoolean(TAG_SLEEPING)) { // player just woke up - restoreOriginalSpawn(player, tag); - restoreOriginalPosition(player, tag); + // TODO 1.10 reimplement if needed? tag.removeTag(TAG_SLEEPING); getOutOfSleepingBag(player); } else { // player just put in on - final BlockPos pos = player.getPosition(); + // final BlockPos pos = player.getPosition(); + // tag.setBoolean(TAG_SLEEPING, true); + // TODO 1.10 use PR to reimplement. Remember to add custom checks - if (canPlayerSleep(player, world, pos)) { - storeOriginalSpawn(player, tag); - storeOriginalPosition(player, tag); - tag.setBoolean(TAG_SLEEPING, true); - sleepSafe((EntityPlayerMP)player, world, pos); - } else getOutOfSleepingBag(player); + getOutOfSleepingBag(player); } } - private static void sleepSafe(EntityPlayerMP player, World world, BlockPos pos) { - // TODO 1.8.9 replace if forge PR is accepted - if (player.isRiding()) player.mountEntity(null); - - IS_SLEEPING.set(player, true); - SLEEPING_TIMER.set(player, 0); - player.playerLocation = pos; - - player.motionX = player.motionZ = player.motionY = 0.0D; - world.updateAllPlayersSleepingFlag(); - - S0APacketUseBed sleepPacket = new S0APacketUseBed(player, pos); - player.getServerForPlayer().getEntityTracker().sendToAllTrackingEntity(player, sleepPacket); - player.playerNetServerHandler.sendPacket(sleepPacket); - } - - private static EnumStatus vanillaCanSleep(EntityPlayer player, World world, BlockPos pos) { - PlayerSleepInBedEvent event = new PlayerSleepInBedEvent(player, pos); - MinecraftForge.EVENT_BUS.post(event); - if (event.result != null) return event.result; - - if (!world.provider.isSurfaceWorld()) return EntityPlayer.EnumStatus.NOT_POSSIBLE_HERE; - if (world.isDaytime()) return EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW; - - List list = world.getEntitiesWithinAABB(EntityMob.class, new AxisAlignedBB(pos.getX() - 8, pos.getY() - 5, pos.getZ() - 8, pos.getX() + 8, pos.getY() + 5, pos.getZ() + 8)); - - if (!list.isEmpty()) return EntityPlayer.EnumStatus.NOT_SAFE; - - return EntityPlayer.EnumStatus.OK; - } - - private static boolean canPlayerSleep(EntityPlayer player, World world, BlockPos pos) { - if (player.isPlayerSleeping() || !player.isEntityAlive()) return false; - - if (!isNotSuffocating(world, pos) || !isSolidEnough(world, pos.down())) { - player.addChatComponentMessage(new ChatComponentTranslation("openblocks.misc.oh_no_ground")); - return false; - } - - final EnumStatus status = vanillaCanSleep(player, world, pos); - final SleepingBagUseEvent evt = new SleepingBagUseEvent(player, status); - evt.playerChat = findDefaultChatComponent(status); - MinecraftForge.EVENT_BUS.post(evt); - - switch (evt.getResult()) { - case ALLOW: - return true; - case DEFAULT: - if (evt.playerChat != null) player.addChatComponentMessage(evt.playerChat); - return evt.defaultCanSleep(); - case DENY: - default: - if (evt.playerChat != null) player.addChatComponentMessage(evt.playerChat); - return false; - } - } - - private static IChatComponent findDefaultChatComponent(EnumStatus status) { - switch (status) { - case NOT_POSSIBLE_NOW: - return new ChatComponentTranslation("tile.bed.noSleep"); - case NOT_SAFE: - return new ChatComponentTranslation("tile.bed.notSafe"); - default: - return null; - } - } - - private static AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos) { - final IBlockState state = world.getBlockState(pos); - return state.getBlock().getCollisionBoundingBox(world, pos, state); - } - - private static boolean isNotSuffocating(World world, BlockPos pos) { - return (world.isAirBlock(pos) || getCollisionBoundingBox(world, pos) == null); - } - - private static boolean isSolidEnough(World world, BlockPos pos) { - AxisAlignedBB aabb = getCollisionBoundingBox(world, pos); - if (aabb == null) return false; - - double dx = aabb.maxX - aabb.minX; - double dy = aabb.maxY - aabb.minY; - double dz = aabb.maxZ - aabb.minZ; - - return (dx >= 0.5) && (dy >= 0.5) && (dz >= 0.5); - } - - private static boolean isChestplate(ItemStack stack) { - if (stack == null) return false; - Item item = stack.getItem(); - if (item instanceof ItemSleepingBag) return false; - - if (item instanceof ItemArmor) { - ItemArmor armorItem = (ItemArmor)item; - return armorItem.armorType == ARMOR_CHESTPIECE_TYPE; - } - - return false; - } - private static Integer getReturnSlot(NBTTagCompound tag) { if (tag.hasKey(TAG_SLOT, Constants.NBT.TAG_ANY_NUMERIC)) { int slot = tag.getInteger(TAG_SLOT); @@ -254,34 +135,6 @@ public class ItemSleepingBag extends ItemArmor { } } - // TODO 1.8.9 may not be needed after Forge PR - // alternativelly, use event - private static void storeOriginalSpawn(EntityPlayer player, NBTTagCompound tag) { - BlockPos spawn = player.getBedLocation(player.worldObj.provider.getDimensionId()); - if (spawn != null) tag.setTag(TAG_SPAWN, NbtUtils.store(spawn)); - } - - private static void restoreOriginalSpawn(EntityPlayer player, NBTTagCompound tag) { - if (tag.hasKey(TAG_SPAWN)) { - BlockPos coords = NbtUtils.readBlockPos(tag.getCompoundTag(TAG_SPAWN)); - player.setSpawnChunk(coords, false, player.worldObj.provider.getDimensionId()); - tag.removeTag(TAG_SPAWN); - } - } - - // TODO 1.8.9 may not be needed - players seem to be frozen in 1.8.9 - private static void storeOriginalPosition(Entity e, NBTTagCompound tag) { - tag.setTag(TAG_POSITION, NbtUtils.store(e.posX, e.posY, e.posZ)); - } - - private static void restoreOriginalPosition(Entity e, NBTTagCompound tag) { - if (tag.hasKey(TAG_POSITION)) { - Vec3 position = NbtUtils.readVec(tag.getCompoundTag(TAG_POSITION)); - e.setPosition(position.xCoord, position.yCoord, position.zCoord); - tag.removeTag(TAG_POSITION); - } - } - public static boolean isWearingSleepingBag(EntityPlayer player) { ItemStack armor = getChestpieceSlot(player); return isSleepingBag(armor); @@ -292,10 +145,24 @@ public class ItemSleepingBag extends ItemArmor { } private static ItemStack setChestpieceSlot(EntityPlayer player, ItemStack chestpiece) { - return player.inventory.armorInventory[ARMOR_CHESTPIECE_SLOT] = chestpiece; + player.setItemStackToSlot(EntityEquipmentSlot.CHEST, chestpiece); + return chestpiece; } private static ItemStack getChestpieceSlot(EntityPlayer player) { - return player.inventory.armorInventory[ARMOR_CHESTPIECE_SLOT]; + return player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); + } + + private static boolean isChestplate(ItemStack stack) { + if (stack == null) return false; + Item item = stack.getItem(); + if (item instanceof ItemSleepingBag) return false; + + if (item instanceof ItemArmor) { + ItemArmor armorItem = (ItemArmor)item; + return armorItem.armorType == EntityEquipmentSlot.CHEST; + } + + return false; } } diff --git a/src/main/java/openblocks/common/item/ItemSlimalyzer.java b/src/main/java/openblocks/common/item/ItemSlimalyzer.java index 16527f8d..ca3a13b4 100644 --- a/src/main/java/openblocks/common/item/ItemSlimalyzer.java +++ b/src/main/java/openblocks/common/item/ItemSlimalyzer.java @@ -3,8 +3,10 @@ package openblocks.common.item; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.SoundCategory; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; +import openblocks.OpenBlocks; import openmods.infobook.BookDocumentation; @BookDocumentation @@ -21,7 +23,7 @@ public class ItemSlimalyzer extends Item { int previousDamage = stack.getItemDamage(); stack.setItemDamage(chunk.getRandomWithSeed(987234911L).nextInt(10) == 0? 1 : 0); if (previousDamage != stack.getItemDamage() && previousDamage == 0) { - world.playSoundAtEntity(entity, "openblocks:slimalyzer.signal", 1F, 1F); + world.playSound(null, entity.getPosition(), OpenBlocks.Sounds.ITEM_SLIMALYZER_PING, SoundCategory.PLAYERS, 1F, 1F); } } else { stack.setItemDamage(0); diff --git a/src/main/java/openblocks/common/item/ItemSonicGlasses.java b/src/main/java/openblocks/common/item/ItemSonicGlasses.java index a03774ae..599ca429 100644 --- a/src/main/java/openblocks/common/item/ItemSonicGlasses.java +++ b/src/main/java/openblocks/common/item/ItemSonicGlasses.java @@ -3,6 +3,7 @@ package openblocks.common.item; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; @@ -12,16 +13,13 @@ import openmods.infobook.BookDocumentation; @BookDocumentation public class ItemSonicGlasses extends ItemArmor { - - private static final int ARMOR_HELMET = 0; - public ItemSonicGlasses() { - super(ArmorMaterial.IRON, 2, ARMOR_HELMET); + super(ArmorMaterial.IRON, 2, EntityEquipmentSlot.HEAD); } @Override - public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { - return armorType == ARMOR_HELMET; + public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity) { + return armorType == EntityEquipmentSlot.HEAD; } @SideOnly(Side.CLIENT) @@ -29,8 +27,8 @@ public class ItemSonicGlasses extends ItemArmor { @Override @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - if (armorSlot == ARMOR_HELMET) { + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped _default) { + if (armorSlot == EntityEquipmentSlot.HEAD) { if (model == null) model = new ModelSonicGlasses(); return model; } @@ -39,7 +37,7 @@ public class ItemSonicGlasses extends ItemArmor { } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return "openblocks:textures/models/glasses.png"; } diff --git a/src/main/java/openblocks/common/item/ItemSpongeOnAStick.java b/src/main/java/openblocks/common/item/ItemSpongeOnAStick.java index 34a553eb..4ab076f8 100644 --- a/src/main/java/openblocks/common/item/ItemSpongeOnAStick.java +++ b/src/main/java/openblocks/common/item/ItemSpongeOnAStick.java @@ -1,12 +1,14 @@ package openblocks.common.item; -import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.Config; import openmods.infobook.BookDocumentation; @@ -20,19 +22,19 @@ public class ItemSpongeOnAStick extends Item { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { - soakUp(world, pos, player, stack); - return true; + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + return soakUp(world, pos, player, stack)? EnumActionResult.SUCCESS : EnumActionResult.FAIL; + } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - soakUp(world, player.getPosition(), player, stack); - return stack; + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + boolean result = soakUp(world, player.getPosition(), player, stack); + return ActionResult.newResult(result? EnumActionResult.SUCCESS : EnumActionResult.FAIL, stack); } - private void soakUp(World world, BlockPos pos, EntityPlayer player, ItemStack stack) { - if (world.isRemote) return; + private static boolean soakUp(World world, BlockPos pos, EntityPlayer player, ItemStack stack) { + boolean absorbedAnything = false; boolean hitLava = false; int damage = stack.getItemDamage(); @@ -40,15 +42,15 @@ public class ItemSpongeOnAStick extends Item { for (int y = -Config.spongeStickRange; y <= Config.spongeStickRange; y++) { for (int z = -Config.spongeStickRange; z <= Config.spongeStickRange; z++) { final BlockPos targetPos = pos.add(x, y, z); - Block block = world.getBlockState(targetPos).getBlock(); - if (block != null) { - Material material = block.getMaterial(); - if (material.isLiquid()) { - hitLava |= material == Material.lava; - world.setBlockToAir(targetPos); - if (++damage >= getMaxDamage()) break; - } + + Material material = world.getBlockState(targetPos).getMaterial(); + if (material.isLiquid()) { + absorbedAnything = true; + hitLava |= material == Material.LAVA; + world.setBlockToAir(targetPos); + if (++damage >= Config.spongeMaxDamage) break; } + } } } @@ -58,8 +60,13 @@ public class ItemSpongeOnAStick extends Item { player.setFire(6); } - if (damage >= getMaxDamage()) stack.stackSize = 0; - else stack.setItemDamage(damage); + if (absorbedAnything) { + if (damage >= Config.spongeMaxDamage) stack.stackSize = 0; + else stack.setItemDamage(damage); + return true; + } + + return false; } } diff --git a/src/main/java/openblocks/common/item/ItemSqueegee.java b/src/main/java/openblocks/common/item/ItemSqueegee.java index a842553b..d5e42776 100644 --- a/src/main/java/openblocks/common/item/ItemSqueegee.java +++ b/src/main/java/openblocks/common/item/ItemSqueegee.java @@ -4,9 +4,13 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import openblocks.OpenBlocks; import openblocks.common.tileentity.TileEntityCanvas; import openmods.infobook.BookDocumentation; @@ -19,16 +23,16 @@ public class ItemSqueegee extends Item { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { TileEntity te = world.getTileEntity(pos); if (te instanceof TileEntityCanvas) { TileEntityCanvas canvas = (TileEntityCanvas)te; if (player.isSneaking()) canvas.removePaint(EnumFacing.VALUES); - else canvas.removePaint(side); - world.playSoundAtEntity(player, "openblocks:squeegee.use", 1, 1); - return true; + else canvas.removePaint(facing); + world.playSound(null, player.getPosition(), OpenBlocks.Sounds.ITEM_SQUEEGEE_ACTION, SoundCategory.PLAYERS, 1, 1); + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.FAIL; } } diff --git a/src/main/java/openblocks/common/item/ItemStencil.java b/src/main/java/openblocks/common/item/ItemStencil.java new file mode 100644 index 00000000..d3292f41 --- /dev/null +++ b/src/main/java/openblocks/common/item/ItemStencil.java @@ -0,0 +1,63 @@ +package openblocks.common.item; + +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import openblocks.OpenBlocks; +import openblocks.common.Stencil; +import openblocks.common.block.BlockCanvas; +import openblocks.common.tileentity.TileEntityCanvas; +import openmods.utils.render.PaintUtils; + +public class ItemStencil extends Item { + + public ItemStencil() { + setCreativeTab(OpenBlocks.tabOpenBlocks); + setHasSubtypes(true); + } + + // TODO 1.10 rendering + + @Override + @SuppressWarnings({ "unchecked", "rawtypes" }) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) { + for (Stencil stencil : Stencil.values()) { + list.add(new ItemStack(item, 1, stencil.ordinal())); + } + } + + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + + if (PaintUtils.instance.isAllowedToReplace(world, pos)) { + BlockCanvas.replaceBlock(world, pos); + } + + TileEntity te = world.getTileEntity(pos); + + if (te instanceof TileEntityCanvas) { + TileEntityCanvas canvas = (TileEntityCanvas)te; + int stencilId = stack.getItemDamage(); + Stencil stencil; + try { + stencil = Stencil.VALUES[stencilId]; + } catch (ArrayIndexOutOfBoundsException e) { + return EnumActionResult.FAIL; + } + + if (canvas.useStencil(facing, stencil)) stack.stackSize--; + return EnumActionResult.SUCCESS; + } + + return EnumActionResult.PASS; + } + +} diff --git a/src/main/java/openblocks/common/item/ItemTankBlock.java b/src/main/java/openblocks/common/item/ItemTankBlock.java index 536cc26b..417b1d58 100644 --- a/src/main/java/openblocks/common/item/ItemTankBlock.java +++ b/src/main/java/openblocks/common/item/ItemTankBlock.java @@ -1,20 +1,22 @@ package openblocks.common.item; +import com.google.common.base.Strings; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.*; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.IFluidContainerItem; import openblocks.OpenBlocks; import openblocks.common.tileentity.TileEntityTank; import openmods.item.ItemOpenBlock; import openmods.utils.ItemUtils; - -import com.google.common.base.Strings; +import openmods.utils.TranslationUtils; public class ItemTankBlock extends ItemOpenBlock implements IFluidContainerItem { @@ -42,7 +44,7 @@ public class ItemTankBlock extends ItemOpenBlock implements IFluidContainerItem if (fluidStack != null && fluidStack.amount > 0) { final String fluidName = getFluidName(fluidStack); - return StatCollector.translateToLocalFormatted(unlocalizedName + ".filled.name", fluidName); + return TranslationUtils.translateToLocalFormatted(unlocalizedName + ".filled.name", fluidName); } return super.getItemStackDisplayName(stack); @@ -54,7 +56,7 @@ public class ItemTankBlock extends ItemOpenBlock implements IFluidContainerItem if (!Strings.isNullOrEmpty(localizedName) && !localizedName.equals(fluid.getUnlocalizedName())) { return fluid.getRarity(fluidStack).rarityColor.toString() + localizedName; } else { - return EnumChatFormatting.OBFUSCATED + "LOLNOPE" + EnumChatFormatting.RESET; + return TextFormatting.OBFUSCATED + "LOLNOPE" + TextFormatting.RESET; } } diff --git a/src/main/java/openblocks/common/item/ItemTrophyBlock.java b/src/main/java/openblocks/common/item/ItemTrophyBlock.java index a4ae0619..df35c83c 100644 --- a/src/main/java/openblocks/common/item/ItemTrophyBlock.java +++ b/src/main/java/openblocks/common/item/ItemTrophyBlock.java @@ -1,16 +1,15 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import openblocks.common.TrophyHandler.Trophy; import openmods.item.ItemOpenBlock; import openmods.utils.ItemUtils; +import openmods.utils.TranslationUtils; public class ItemTrophyBlock extends ItemOpenBlock { @@ -49,8 +48,8 @@ public class ItemTrophyBlock extends ItemOpenBlock { public String getItemStackDisplayName(ItemStack stack) { Trophy trophyType = getTrophy(stack); if (trophyType != null) { - final String name = StatCollector.translateToLocal("entity." + trophyType.name() + ".name"); - return StatCollector.translateToLocalFormatted(super.getUnlocalizedName() + ".entity.name", name); + final String name = TranslationUtils.translateToLocal("entity." + trophyType.name() + ".name"); + return TranslationUtils.translateToLocalFormatted(super.getUnlocalizedName() + ".entity.name", name); } return super.getItemStackDisplayName(stack); diff --git a/src/main/java/openblocks/common/item/ItemWrench.java b/src/main/java/openblocks/common/item/ItemWrench.java index 95f3c7f8..96be4edc 100644 --- a/src/main/java/openblocks/common/item/ItemWrench.java +++ b/src/main/java/openblocks/common/item/ItemWrench.java @@ -1,23 +1,25 @@ package openblocks.common.item; -import java.util.Set; - -import javax.annotation.Nullable; - -import net.minecraft.block.*; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -import openmods.infobook.BookDocumentation; - -import org.apache.commons.lang3.ArrayUtils; - import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; +import java.util.Set; +import javax.annotation.Nullable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockButton; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockLever; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import openmods.infobook.BookDocumentation; +import org.apache.commons.lang3.ArrayUtils; @BookDocumentation public class ItemWrench extends Item { @@ -33,7 +35,7 @@ public class ItemWrench extends Item { } @Override - public boolean doesSneakBypassUse(World world, BlockPos pos, EntityPlayer player) { + public boolean doesSneakBypassUse(ItemStack stack, IBlockAccess world, BlockPos pos, EntityPlayer player) { return true; } @@ -47,20 +49,18 @@ public class ItemWrench extends Item { } @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) { final Block block = world.getBlockState(pos).getBlock(); - if (requiresSneaking(block) && !player.isSneaking()) return false; + if (requiresSneaking(block) && !player.isSneaking()) return EnumActionResult.PASS; final EnumFacing[] rotations = block.getValidRotations(world, pos); if (ArrayUtils.contains(rotations, side)) { - if (block.rotateBlock(world, pos, side)) { - player.swingItem(); - return !world.isRemote; + if (block.rotateBlock(world, pos, side)) { return EnumActionResult.SUCCESS; // TODO verify if swing animation plays } } - return false; + return EnumActionResult.FAIL; } } diff --git a/src/main/java/openblocks/common/item/MetaMiracleMagnet.java b/src/main/java/openblocks/common/item/MetaMiracleMagnet.java index 5dd6d783..3dbb867d 100644 --- a/src/main/java/openblocks/common/item/MetaMiracleMagnet.java +++ b/src/main/java/openblocks/common/item/MetaMiracleMagnet.java @@ -1,7 +1,6 @@ package openblocks.common.item; import java.util.List; - import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import openblocks.Config; diff --git a/src/main/java/openblocks/common/item/MetaPointer.java b/src/main/java/openblocks/common/item/MetaPointer.java index 03eab0e6..67bb9e87 100644 --- a/src/main/java/openblocks/common/item/MetaPointer.java +++ b/src/main/java/openblocks/common/item/MetaPointer.java @@ -4,8 +4,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import openblocks.api.IPointable; import openmods.utils.ItemUtils; @@ -24,29 +28,29 @@ public class MetaPointer extends MetaGeneric { } @Override - public ItemStack onItemRightClick(ItemStack itemStack, EntityPlayer player, World world) { - if (!world.isRemote) { - Vec3 posVec = new Vec3(player.posX, player.posY + 1.62F, player.posZ); - Vec3 lookVec = player.getLook(1.0f); - Vec3 targetVec = posVec.addVector(lookVec.xCoord * 10f, lookVec.yCoord * 10f, lookVec.zCoord * 10f); + public ActionResult onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) { + if (player.isSneaking()) { + Vec3d posVec = new Vec3d(player.posX, player.posY + 1.62F, player.posZ); + Vec3d lookVec = player.getLook(1.0f); + Vec3d targetVec = posVec.addVector(lookVec.xCoord * 10f, lookVec.yCoord * 10f, lookVec.zCoord * 10f); - MovingObjectPosition movingObject = world.rayTraceBlocks(posVec, targetVec); + RayTraceResult movingObject = world.rayTraceBlocks(posVec, targetVec); NBTTagCompound tag = ItemUtils.getItemTag(itemStack); - if (movingObject != null && movingObject.typeOfHit.equals(MovingObjectType.BLOCK)) { + if (movingObject != null && movingObject.typeOfHit.equals(RayTraceResult.Type.BLOCK)) { final BlockPos targetPos = movingObject.getBlockPos(); final TileEntity pointedTileEntity = world.getTileEntity(targetPos); if (pointedTileEntity instanceof IPointable) { NBTTagCompound linkTag = new NBTTagCompound(); NbtUtils.store(linkTag, targetPos); - linkTag.setInteger("Dimension", world.provider.getDimensionId()); + linkTag.setInteger("Dimension", world.provider.getDimension()); tag.setTag("lastPoint", linkTag); ((IPointable)pointedTileEntity).onPointingStart(itemStack, player); } else if (tag.hasKey("lastPoint")) { NBTTagCompound cannonTag = tag.getCompoundTag("lastPoint"); BlockPos sourcePos = NbtUtils.readBlockPos(cannonTag); int d = cannonTag.getInteger("Dimension"); - if (world.provider.getDimensionId() == d && world.isBlockLoaded(sourcePos)) { + if (world.provider.getDimension() == d && world.isBlockLoaded(sourcePos)) { TileEntity tile = world.getTileEntity(sourcePos); if (tile instanceof IPointable) { ((IPointable)tile).onPointingEnd(itemStack, player, targetPos); @@ -54,8 +58,9 @@ public class MetaPointer extends MetaGeneric { } } } - + return ActionResult.newResult(EnumActionResult.SUCCESS, itemStack); } - return itemStack; + + return ActionResult.newResult(EnumActionResult.PASS, itemStack); } } diff --git a/src/main/java/openblocks/common/item/MetaStencil.java b/src/main/java/openblocks/common/item/MetaStencil.java index 199738ac..c506dbf0 100644 --- a/src/main/java/openblocks/common/item/MetaStencil.java +++ b/src/main/java/openblocks/common/item/MetaStencil.java @@ -3,8 +3,10 @@ package openblocks.common.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.common.Stencil; import openblocks.common.block.BlockCanvas; @@ -21,7 +23,7 @@ public class MetaStencil extends MetaGeneric { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (PaintUtils.instance.isAllowedToReplace(world, pos)) { BlockCanvas.replaceBlock(world, pos); } @@ -30,10 +32,10 @@ public class MetaStencil extends MetaGeneric { if (te instanceof TileEntityCanvas) { TileEntityCanvas canvas = (TileEntityCanvas)te; - if (canvas.useStencil(side, stencil)) stack.stackSize--; - return true; + if (canvas.useStencil(facing, stencil)) stack.stackSize--; + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.FAIL; } } diff --git a/src/main/java/openblocks/common/item/MetasGeneric.java b/src/main/java/openblocks/common/item/MetasGeneric.java index 9ccb992e..c0b28735 100644 --- a/src/main/java/openblocks/common/item/MetasGeneric.java +++ b/src/main/java/openblocks/common/item/MetasGeneric.java @@ -1,5 +1,6 @@ package openblocks.common.item; +import com.google.common.collect.ImmutableList; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.Loader; @@ -11,17 +12,15 @@ import openmods.infobook.ICustomBookEntryProvider; import openmods.item.IMetaItem; import openmods.item.IMetaItemFactory; -import com.google.common.collect.ImmutableList; - public enum MetasGeneric implements IMetaItemFactory { + gliderWing { @Override public IMetaItem createMetaItem() { ItemStack result = newItemStack(); return new MetaGeneric("gliderwing", - new ShapedOreRecipe(result, " sl", "sll", "lll", 's', "stickWood", 'l', Items.leather), - new ShapedOreRecipe(result, "ls ", "lls", "lll", 's', "stickWood", 'l', Items.leather) - ); + new ShapedOreRecipe(result, " sl", "sll", "lll", 's', "stickWood", 'l', Items.LEATHER), + new ShapedOreRecipe(result, "ls ", "lls", "lll", 's', "stickWood", 'l', Items.LEATHER)); } }, beam { @@ -30,8 +29,7 @@ public enum MetasGeneric implements IMetaItemFactory { ItemStack result = newItemStack(2); return new MetaGeneric("beam", new ShapedOreRecipe(result, "iii", "b y", "iii", 'i', "ingotIron", 'b', "dyeBlack", 'y', "dyeYellow"), - new ShapedOreRecipe(result, "iii", "y b", "iii", 'i', "ingotIron", 'b', "dyeBlack", 'y', "dyeYellow") - ); + new ShapedOreRecipe(result, "iii", "y b", "iii", 'i', "ingotIron", 'b', "dyeBlack", 'y', "dyeYellow")); } }, craneEngine { @@ -39,8 +37,7 @@ public enum MetasGeneric implements IMetaItemFactory { public IMetaItem createMetaItem() { ItemStack result = newItemStack(); return new MetaGeneric("crane_engine", - new ShapedOreRecipe(result, "iii", "isi", "iri", 'i', "ingotIron", 's', "stickWood", 'r', "dustRedstone") - ); + new ShapedOreRecipe(result, "iii", "isi", "iri", 'i', "ingotIron", 's', "stickWood", 'r', "dustRedstone")); } }, craneMagnet { @@ -49,8 +46,7 @@ public enum MetasGeneric implements IMetaItemFactory { ItemStack result = newItemStack(); return new MetaGeneric("crane_magnet", new ShapedOreRecipe(result, "biy", "iri", 'i', "ingotIron", 'r', "dustRedstone", 'b', "dyeBlack", 'y', "dyeYellow"), - new ShapedOreRecipe(result, "yib", "iri", 'i', "ingotIron", 'r', "dustRedstone", 'b', "dyeBlack", 'y', "dyeYellow") - ); + new ShapedOreRecipe(result, "yib", "iri", 'i', "ingotIron", 'r', "dustRedstone", 'b', "dyeBlack", 'y', "dyeYellow")); } }, miracleMagnet { @@ -59,9 +55,8 @@ public enum MetasGeneric implements IMetaItemFactory { ItemStack result = newItemStack(); ItemStack magnet = craneMagnet.newItemStack(); return new MetaMiracleMagnet("miracle_magnet", - new ShapedOreRecipe(result, "rer", "eme", "rer", 'r', "dustRedstone", 'e', Items.ender_pearl, 'm', magnet), - new ShapedOreRecipe(result, "ere", "rmr", "ere", 'r', "dustRedstone", 'e', Items.ender_pearl, 'm', magnet) - ); + new ShapedOreRecipe(result, "rer", "eme", "rer", 'r', "dustRedstone", 'e', Items.ENDER_PEARL, 'm', magnet), + new ShapedOreRecipe(result, "ere", "rmr", "ere", 'r', "dustRedstone", 'e', Items.ENDER_PEARL, 'm', magnet)); } @Override @@ -74,8 +69,7 @@ public enum MetasGeneric implements IMetaItemFactory { public IMetaItem createMetaItem() { ItemStack result = newItemStack(2); return new MetaGeneric("line", - new ShapedOreRecipe(result, "sss", "bbb", "sss", 's', Items.string, 'b', "slimeball") - ); + new ShapedOreRecipe(result, "sss", "bbb", "sss", 's', Items.STRING, 'b', "slimeball")); } }, mapController { @@ -83,8 +77,7 @@ public enum MetasGeneric implements IMetaItemFactory { public IMetaItem createMetaItem() { ItemStack result = newItemStack(1); return new MetaGeneric("map_controller", - new ShapedOreRecipe(result, " r ", "rgr", " r ", 'r', "dustRedstone", 'g', "ingotGold") - ); + new ShapedOreRecipe(result, " r ", "rgr", " r ", 'r', "dustRedstone", 'g', "ingotGold")); } }, mapMemory { @@ -92,8 +85,7 @@ public enum MetasGeneric implements IMetaItemFactory { public IMetaItem createMetaItem() { ItemStack result = newItemStack(1); return new MetaGeneric("map_memory", - new ShapedOreRecipe(result, "rg", "rg", "rg", 'g', "nuggetGold", 'r', "dustRedstone") - ); + new ShapedOreRecipe(result, "rg", "rg", "rg", 'g', "nuggetGold", 'r', "dustRedstone")); } }, /** @@ -117,8 +109,7 @@ public enum MetasGeneric implements IMetaItemFactory { public IMetaItem createMetaItem() { ItemStack result = newItemStack(); return new MetaGeneric("assistant_base", - new ShapedOreRecipe(result, "iei", "iri", 'i', "ingotIron", 'e', Items.ender_pearl, 'r', "dustRedstone") - ); + new ShapedOreRecipe(result, "iei", "iri", 'i', "ingotIron", 'e', Items.ENDER_PEARL, 'r', "dustRedstone")); } }, unpreparedStencil { @@ -126,8 +117,7 @@ public enum MetasGeneric implements IMetaItemFactory { public IMetaItem createMetaItem() { ItemStack result = newItemStack(); return new MetaGeneric("unprepared_stencil", - new ShapedOreRecipe(result, " p ", "pip", " p ", 'p', Items.paper, 'i', "ingotIron") - ); + new ShapedOreRecipe(result, " p ", "pip", " p ", 'p', Items.PAPER, 'i', "ingotIron")); } }, sketchingPencil { @@ -135,8 +125,7 @@ public enum MetasGeneric implements IMetaItemFactory { public IMetaItem createMetaItem() { ItemStack result = newItemStack(); return new MetaGeneric("sketching_pencil", - new ShapedOreRecipe(result, "c ", " s ", " s", 'c', new ItemStack(Items.coal, 1, OreDictionary.WILDCARD_VALUE), 's', "stickWood") - ); + new ShapedOreRecipe(result, "c ", " s ", " s", 'c', new ItemStack(Items.COAL, 1, OreDictionary.WILDCARD_VALUE), 's', "stickWood")); } }; diff --git a/src/main/java/openblocks/common/item/MetasGenericUnstackable.java b/src/main/java/openblocks/common/item/MetasGenericUnstackable.java index 29a3dffe..072c3da6 100644 --- a/src/main/java/openblocks/common/item/MetasGenericUnstackable.java +++ b/src/main/java/openblocks/common/item/MetasGenericUnstackable.java @@ -13,7 +13,7 @@ public enum MetasGenericUnstackable implements IMetaItemFactory { @Override public IMetaItem createMetaItem() { ItemStack result = newItemStack(); - final ItemStack whiteWool = ColorMeta.WHITE.createStack(Blocks.wool, 1); + final ItemStack whiteWool = ColorMeta.WHITE.createStack(Blocks.WOOL, 1); return new MetaPointer("pointer", new ShapedOreRecipe(result, "w ", "ww ", "w ", 'w', whiteWool)); } }; diff --git a/src/main/java/openblocks/common/recipe/CrayonGlassesRecipe.java b/src/main/java/openblocks/common/recipe/CrayonGlassesRecipe.java index 948b264a..c2c66305 100644 --- a/src/main/java/openblocks/common/recipe/CrayonGlassesRecipe.java +++ b/src/main/java/openblocks/common/recipe/CrayonGlassesRecipe.java @@ -1,7 +1,7 @@ package openblocks.common.recipe; +import com.google.common.collect.Lists; import java.util.List; - import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; @@ -12,14 +12,12 @@ import openblocks.OpenBlocks; import openblocks.common.item.ItemImaginary; import openmods.utils.ItemUtils; -import com.google.common.collect.Lists; - public class CrayonGlassesRecipe extends ShapelessRecipes { private static List createFakeIngredientsList() { ItemStack block = new ItemStack(OpenBlocks.Blocks.imaginary, 1, ItemImaginary.DAMAGE_CRAYON); ItemImaginary.setupValues(0x00FFFF, block); - return Lists.newArrayList(new ItemStack(Items.paper), block); + return Lists.newArrayList(new ItemStack(Items.PAPER), block); } private static ItemStack createFakeResult() { @@ -39,11 +37,9 @@ public class CrayonGlassesRecipe extends ShapelessRecipes { ItemStack stack = inv.getStackInSlot(i); if (stack != null) { if (stack.getItem() instanceof ItemImaginary) { - if (gotCrayon - || ItemImaginary.getUses(stack) < ItemImaginary.CRAFTING_COST) return false; - + if (gotCrayon || ItemImaginary.getUses(stack) < ItemImaginary.CRAFTING_COST) return false; gotCrayon = true; - } else if (stack.getItem() == Items.paper) { + } else if (stack.getItem() == Items.PAPER) { if (gotPaper) return false; gotPaper = true; diff --git a/src/main/java/openblocks/common/recipe/CrayonMixingRecipe.java b/src/main/java/openblocks/common/recipe/CrayonMixingRecipe.java index c0d3b3e7..d052dacf 100644 --- a/src/main/java/openblocks/common/recipe/CrayonMixingRecipe.java +++ b/src/main/java/openblocks/common/recipe/CrayonMixingRecipe.java @@ -17,8 +17,9 @@ public class CrayonMixingRecipe extends CustomRecipeBase { for (int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); if (stack == null) continue; - if ((!(stack.getItem() instanceof ItemImaginary)) - || !ItemImaginary.isCrayon(stack)) return false; + if (!(stack.getItem() instanceof ItemImaginary) + || !ItemImaginary.isCrayon(stack)) + return false; if (ItemImaginary.getUses(stack) < ItemImaginary.CRAFTING_COST) continue; count++; } @@ -34,7 +35,6 @@ public class CrayonMixingRecipe extends CustomRecipeBase { if (stack == null || (ItemImaginary.getUses(stack) < ItemImaginary.CRAFTING_COST)) continue; final NBTTagCompound tag = stack.getTagCompound(); - if (tag != null && tag.hasKey(ItemImaginary.TAG_COLOR, Constants.NBT.TAG_INT)) { count++; final int color = tag.getInteger(ItemImaginary.TAG_COLOR); diff --git a/src/main/java/openblocks/common/recipe/GoldenEyeRechargeRecipe.java b/src/main/java/openblocks/common/recipe/GoldenEyeRechargeRecipe.java index e7fa37f3..bac91f90 100644 --- a/src/main/java/openblocks/common/recipe/GoldenEyeRechargeRecipe.java +++ b/src/main/java/openblocks/common/recipe/GoldenEyeRechargeRecipe.java @@ -15,7 +15,7 @@ public class GoldenEyeRechargeRecipe extends ShapelessOreRecipe { private static final int PEARL_RECHARGE = 10; public GoldenEyeRechargeRecipe() { - super(new ItemStack(OpenBlocks.Items.goldenEye, 1, ItemGoldenEye.MAX_DAMAGE - PEARL_RECHARGE), new ItemStack(OpenBlocks.Items.goldenEye, 1, ItemGoldenEye.MAX_DAMAGE), Items.ender_pearl); + super(new ItemStack(OpenBlocks.Items.goldenEye, 1, ItemGoldenEye.MAX_DAMAGE - PEARL_RECHARGE), new ItemStack(OpenBlocks.Items.goldenEye, 1, ItemGoldenEye.MAX_DAMAGE), Items.ENDER_PEARL); } @Override diff --git a/src/main/java/openblocks/common/recipe/MapResizeRecipe.java b/src/main/java/openblocks/common/recipe/MapResizeRecipe.java index 22a8ed4f..f1bb51c0 100644 --- a/src/main/java/openblocks/common/recipe/MapResizeRecipe.java +++ b/src/main/java/openblocks/common/recipe/MapResizeRecipe.java @@ -23,7 +23,8 @@ public class MapResizeRecipe extends ShapedOreRecipe { if (inventory.getStackInRowAndColumn(0, 0) != null || inventory.getStackInRowAndColumn(0, 2) != null || inventory.getStackInRowAndColumn(2, 0) != null || - inventory.getStackInRowAndColumn(2, 2) != null) return false; + inventory.getStackInRowAndColumn(2, 2) != null) + return false; for (int i = 0; i < 3; i++) { ItemStack left = inventory.getStackInRowAndColumn(0, i); diff --git a/src/main/java/openblocks/common/recipe/TorchBowRecipe.java b/src/main/java/openblocks/common/recipe/TorchBowRecipe.java index 18ba7fa8..a6d7fd72 100644 --- a/src/main/java/openblocks/common/recipe/TorchBowRecipe.java +++ b/src/main/java/openblocks/common/recipe/TorchBowRecipe.java @@ -22,13 +22,13 @@ public class TorchBowRecipe extends CustomRecipeBase { for (int i = 0; i < inventorycrafting.getSizeInventory(); i++) { ItemStack stack = inventorycrafting.getStackInSlot(i); if (stack != null) { - if (stack.getItem() == Items.bow && bowStack == null) { + if (stack.getItem() == Items.BOW && bowStack == null) { bowStack = stack; continue; - } else if (stack.getItem() == Items.flint && flintStack == null) { + } else if (stack.getItem() == Items.FLINT && flintStack == null) { flintStack = stack; continue; - } else if (stack.getItem() == Items.bone && boneStack == null) { + } else if (stack.getItem() == Items.BONE && boneStack == null) { boneStack = stack; continue; } @@ -65,7 +65,7 @@ public class TorchBowRecipe extends CustomRecipeBase { @Override public ItemStack getRecipeOutput() { - return new ItemStack(Items.bow); + return new ItemStack(Items.BOW); } } diff --git a/src/main/java/openblocks/common/sync/SyncableBlockLayers.java b/src/main/java/openblocks/common/sync/SyncableBlockLayers.java index 7e8202a3..1e8906fc 100644 --- a/src/main/java/openblocks/common/sync/SyncableBlockLayers.java +++ b/src/main/java/openblocks/common/sync/SyncableBlockLayers.java @@ -1,15 +1,13 @@ package openblocks.common.sync; +import com.google.common.collect.Lists; import java.util.LinkedList; import java.util.List; - import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.PacketBuffer; import openblocks.common.Stencil; import openmods.sync.SyncableObjectBase; -import com.google.common.collect.Lists; - public class SyncableBlockLayers extends SyncableObjectBase { public static class Layer { diff --git a/src/main/java/openblocks/common/tileentity/TileEntityAutoAnvil.java b/src/main/java/openblocks/common/tileentity/TileEntityAutoAnvil.java index a91e4124..c3ee62d3 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityAutoAnvil.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityAutoAnvil.java @@ -1,10 +1,11 @@ package openblocks.common.tileentity; +import com.google.common.base.Optional; import java.util.Set; - import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -19,7 +20,10 @@ import openblocks.client.gui.GuiAutoAnvil; import openblocks.common.LiquidXpUtils; import openblocks.common.container.ContainerAutoAnvil; import openblocks.common.tileentity.TileEntityAutoAnvil.AutoSlots; -import openmods.api.*; +import openmods.api.IHasGui; +import openmods.api.INeighbourAwareTile; +import openmods.api.IValueProvider; +import openmods.api.IValueReceiver; import openmods.gui.misc.IConfigurableGuiSlots; import openmods.include.IncludeInterface; import openmods.include.IncludeOverride; @@ -32,10 +36,14 @@ import openmods.sync.SyncableFlags; import openmods.sync.SyncableSides; import openmods.sync.SyncableTank; import openmods.tileentity.SyncedTileEntity; -import openmods.utils.*; -import openmods.utils.bitmap.*; - -import com.google.common.base.Optional; +import openmods.utils.EnchantmentUtils; +import openmods.utils.MiscUtils; +import openmods.utils.SidedInventoryAdapter; +import openmods.utils.VanillaAnvilLogic; +import openmods.utils.bitmap.BitMapUtils; +import openmods.utils.bitmap.IRpcDirectionBitMap; +import openmods.utils.bitmap.IRpcIntBitMap; +import openmods.utils.bitmap.IWriteableBitMap; public class TileEntityAutoAnvil extends SyncedTileEntity implements IHasGui, IInventoryProvider, IConfigurableGuiSlots, INeighbourAwareTile, ITickable { @@ -78,7 +86,7 @@ public class TileEntityAutoAnvil extends SyncedTileEntity implements IHasGui, II private final GenericInventory inventory = registerInventoryCallback(new TileEntityInventory(this, "autoanvil", true, 3) { @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - if (i == 0 && (!itemstack.getItem().isItemTool(itemstack) && itemstack.getItem() != Items.enchanted_book)) { return false; } + if (i == 0 && (!itemstack.getItem().isItemTool(itemstack) && itemstack.getItem() != Items.ENCHANTED_BOOK)) { return false; } if (i == 2) { return false; } return super.isItemValidForSlot(i, itemstack); } @@ -158,7 +166,7 @@ public class TileEntityAutoAnvil extends SyncedTileEntity implements IHasGui, II removeModifiers(helper.getModifierCost()); inventory.setInventorySlotContents(Slots.tool.ordinal(), null); inventory.setInventorySlotContents(Slots.output.ordinal(), output); - playSoundAtBlock("random.anvil_use", 0.3f, 1f); + playSoundAtBlock(SoundEvents.BLOCK_ANVIL_USE, 0.3f, 1f); } } } @@ -225,9 +233,10 @@ public class TileEntityAutoAnvil extends SyncedTileEntity implements IHasGui, II } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityAutoEnchantmentTable.java b/src/main/java/openblocks/common/tileentity/TileEntityAutoEnchantmentTable.java index 5c1254fa..8f9fe942 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityAutoEnchantmentTable.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityAutoEnchantmentTable.java @@ -2,7 +2,6 @@ package openblocks.common.tileentity; import java.util.Random; import java.util.Set; - import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -20,7 +19,11 @@ import openblocks.common.LiquidXpUtils; import openblocks.common.container.ContainerAutoEnchantmentTable; import openblocks.common.tileentity.TileEntityAutoEnchantmentTable.AutoSlots; import openblocks.rpc.ILevelChanger; -import openmods.api.*; +import openmods.api.IHasGui; +import openmods.api.IInventoryCallback; +import openmods.api.INeighbourAwareTile; +import openmods.api.IValueProvider; +import openmods.api.IValueReceiver; import openmods.gui.misc.IConfigurableGuiSlots; import openmods.include.IncludeInterface; import openmods.include.IncludeOverride; @@ -29,12 +32,18 @@ import openmods.inventory.IInventoryProvider; import openmods.inventory.TileEntityInventory; import openmods.inventory.legacy.ItemDistribution; import openmods.liquids.SidedFluidHandler; -import openmods.sync.*; +import openmods.sync.SyncableFlags; +import openmods.sync.SyncableInt; +import openmods.sync.SyncableSides; +import openmods.sync.SyncableTank; import openmods.tileentity.SyncedTileEntity; import openmods.utils.EnchantmentUtils; import openmods.utils.MiscUtils; import openmods.utils.SidedInventoryAdapter; -import openmods.utils.bitmap.*; +import openmods.utils.bitmap.BitMapUtils; +import openmods.utils.bitmap.IRpcDirectionBitMap; +import openmods.utils.bitmap.IRpcIntBitMap; +import openmods.utils.bitmap.IWriteableBitMap; public class TileEntityAutoEnchantmentTable extends SyncedTileEntity implements IInventoryProvider, IHasGui, IConfigurableGuiSlots, ILevelChanger, IInventoryCallback, INeighbourAwareTile, ITickable { @@ -144,7 +153,7 @@ public class TileEntityAutoEnchantmentTable extends SyncedTileEntity implements if (inputStack == null) return; ItemStack resultingStack = inputStack.copy(); resultingStack.stackSize = 1; - if (EnchantmentUtils.enchantItem(resultingStack, targetLevel.get(), worldObj.rand)) { + if (EnchantmentUtils.enchantItem(resultingStack, targetLevel.get(), worldObj.rand, false)) { tank.drain(xpRequired, true); inputStack.stackSize--; if (inputStack.stackSize < 1) { @@ -165,7 +174,7 @@ public class TileEntityAutoEnchantmentTable extends SyncedTileEntity implements private void handleBookRotation() { this.bookSpreadPrev = this.bookSpread; this.bookRotationPrev = this.bookRotation2; - EntityPlayer entityplayer = this.worldObj.getClosestPlayer(pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, 3.0D); + EntityPlayer entityplayer = this.worldObj.getClosestPlayer(pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, 3.0D, false); if (entityplayer != null) { double d0 = entityplayer.posX - (pos.getX() + 0.5F); @@ -287,9 +296,11 @@ public class TileEntityAutoEnchantmentTable extends SyncedTileEntity implements } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityBearTrap.java b/src/main/java/openblocks/common/tileentity/TileEntityBearTrap.java index d68abd2c..b5174fa0 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityBearTrap.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityBearTrap.java @@ -2,16 +2,23 @@ package openblocks.common.tileentity; import java.util.Set; import java.util.UUID; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; -import net.minecraft.util.MathHelper; -import openmods.api.*; -import openmods.sync.*; +import net.minecraft.util.math.MathHelper; +import openblocks.OpenBlocks; +import openmods.api.IActivateAwareTile; +import openmods.api.IAddAwareTile; +import openmods.api.INeighbourAwareTile; +import openmods.api.ISurfaceAttachment; +import openmods.sync.ISyncListener; +import openmods.sync.ISyncableObject; +import openmods.sync.SyncableBoolean; +import openmods.sync.SyncableFlags; +import openmods.sync.SyncableUUID; import openmods.tileentity.SyncedTileEntity; public class TileEntityBearTrap extends SyncedTileEntity implements IActivateAwareTile, ISurfaceAttachment, INeighbourAwareTile, IAddAwareTile, ITickable { @@ -133,7 +140,7 @@ public class TileEntityBearTrap extends SyncedTileEntity implements IActivateAwa if (!flags.get(Flags.isShut)) { flags.on(Flags.isShut); trappedEntity.setValue(trapped.getUniqueID()); - playSoundAtBlock("openblocks:beartrap.close", 0.5F, 1.0F); + playSoundAtBlock(OpenBlocks.Sounds.BLOCK_BEARTRAP_CLOSE, 0.5F, 1.0F); worldObj.notifyNeighborsOfStateChange(pos, getBlockType()); } } @@ -142,7 +149,7 @@ public class TileEntityBearTrap extends SyncedTileEntity implements IActivateAwa if (flags.get(Flags.isShut)) { flags.off(Flags.isShut); trappedEntity.clear(); - playSoundAtBlock("openblocks:beartrap.open", 0.5F, 1.0F); + playSoundAtBlock(OpenBlocks.Sounds.BLOCK_BEARTRAP_OPEN, 0.5F, 1.0F); worldObj.notifyNeighborsOfStateChange(pos, getBlockType()); } } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityBigButton.java b/src/main/java/openblocks/common/tileentity/TileEntityBigButton.java index 088069c3..7016cf44 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityBigButton.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityBigButton.java @@ -1,8 +1,8 @@ package openblocks.common.tileentity; import java.util.Set; - import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -51,7 +51,7 @@ public class TileEntityBigButton extends SyncedTileEntity implements IActivateAw if (tickCounter > 0) { tickCounter--; if (tickCounter <= 0) { - playSoundAtBlock("random.click", 0.3F, 0.5F); + playSoundAtBlock(SoundEvents.BLOCK_STONE_BUTTON_CLICK_OFF, 0.3F, 0.5F); flags.off(Flags.active); sync(); } @@ -87,7 +87,7 @@ public class TileEntityBigButton extends SyncedTileEntity implements IActivateAw } else { flags.on(Flags.active); tickCounter = getTickTime(); - playSoundAtBlock("random.click", 0.3F, 0.6F); + playSoundAtBlock(SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, 0.3F, 0.6F); sync(); } } @@ -104,9 +104,11 @@ public class TileEntityBigButton extends SyncedTileEntity implements IActivateAw } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityBlockBreaker.java b/src/main/java/openblocks/common/tileentity/TileEntityBlockBreaker.java index 233036e5..55b5df2c 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityBlockBreaker.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityBlockBreaker.java @@ -1,17 +1,18 @@ package openblocks.common.tileentity; import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.WorldServer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -76,8 +77,9 @@ public class TileEntityBlockBreaker extends SyncedTileEntity implements INeighbo } } - private boolean canBreakBlock(Block block, BlockPos pos) { - return !block.isAir(worldObj, pos) && block != Blocks.bedrock && block.getBlockHardness(worldObj, pos) > -1.0F; + private boolean canBreakBlock(IBlockState state, BlockPos pos) { + final Block block = state.getBlock(); + return !block.isAir(state, worldObj, pos) && state != Blocks.BEDROCK && state.getBlockHardness(worldObj, pos) > -1.0F; } private void triggerBreakBlock() { @@ -85,11 +87,11 @@ public class TileEntityBlockBreaker extends SyncedTileEntity implements INeighbo final BlockPos target = pos.offset(direction); if (worldObj.isBlockLoaded(target)) { - final Block block = worldObj.getBlockState(target).getBlock(); - if (canBreakBlock(block, target)) sendBlockEvent(EVENT_ACTIVATE, 0); + final IBlockState state = worldObj.getBlockState(target); + if (canBreakBlock(state, target)) sendBlockEvent(EVENT_ACTIVATE, 0); } - playSoundAtBlock("tile.piston.in", 0.5F, worldObj.rand.nextFloat() * 0.15F + 0.6F); + playSoundAtBlock(SoundEvents.BLOCK_PISTON_EXTEND, 0.5F, worldObj.rand.nextFloat() * 0.15F + 0.6F); } @Override @@ -110,8 +112,8 @@ public class TileEntityBlockBreaker extends SyncedTileEntity implements INeighbo if (!worldObj.isBlockLoaded(target)) return; - final Block block = worldObj.getBlockState(target).getBlock(); - if (!canBreakBlock(block, target)) return; + final IBlockState blockState = worldObj.getBlockState(target); + if (!canBreakBlock(blockState, target)) return; final List drops = FakePlayerPool.instance.executeOnPlayer((WorldServer)worldObj, new BreakBlockAction(worldObj, target)); tryInjectItems(drops, direction.getOpposite()); @@ -137,9 +139,11 @@ public class TileEntityBlockBreaker extends SyncedTileEntity implements INeighbo } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityBlockPlacer.java b/src/main/java/openblocks/common/tileentity/TileEntityBlockPlacer.java index d4bdf138..5d068e11 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityBlockPlacer.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityBlockPlacer.java @@ -1,13 +1,15 @@ package openblocks.common.tileentity; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.Vec3; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.WorldServer; import openblocks.client.gui.GuiBlockPlacer; import openblocks.common.container.ContainerBlockPlacer; @@ -63,7 +65,7 @@ public class TileEntityBlockPlacer extends OpenTileEntity implements INeighbourA return false; } - private void placeBlock(final int slotId) { + private void placeBlock(int slotId) { if (!(worldObj instanceof WorldServer)) return; final ItemStack stack = inventory.getStackInSlot(slotId); @@ -74,16 +76,24 @@ public class TileEntityBlockPlacer extends OpenTileEntity implements INeighbourA if (!worldObj.isBlockLoaded(target)) return; - final Block block = worldObj.getBlockState(target).getBlock(); - if (!block.isAir(worldObj, target) && !block.isReplaceable(worldObj, target)) return; + final IBlockState state = worldObj.getBlockState(target); + final Block block = state.getBlock(); + if (!block.isAir(state, worldObj, target) && !block.isReplaceable(worldObj, target)) return; - // TODO 1.8.9 verify placing - ItemStack newStack = FakePlayerPool.instance.executeOnPlayer((WorldServer)worldObj, new UseItemAction(stack, - new Vec3(pos), - new Vec3(pos.down()), - direction.getOpposite())); + // this logic is tuned for vanilla blocks (like pistons), which places blocks with front facing player + // so to place object pointing in the same direction as placer, we need configuration player-target-placer + // * 2, since some blocks may take into account player height, so distance must be greater than that + final BlockPos playerPos = target.offset(direction, 2); - inventory.setInventorySlotContents(slotId, newStack); + final ItemStack result = FakePlayerPool.instance.executeOnPlayer((WorldServer)worldObj, new UseItemAction( + stack, + new Vec3d(playerPos), + new Vec3d(target), + new Vec3d(target).addVector(0.5, 0.5, 0.5), + direction.getOpposite(), + EnumHand.MAIN_HAND)); + + inventory.setInventorySlotContents(slotId, result); } @Override @@ -115,9 +125,10 @@ public class TileEntityBlockPlacer extends OpenTileEntity implements INeighbourA } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityBuilderGuide.java b/src/main/java/openblocks/common/tileentity/TileEntityBuilderGuide.java index 7a850eb5..9b7939bb 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityBuilderGuide.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityBuilderGuide.java @@ -1,7 +1,6 @@ package openblocks.common.tileentity; import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayerMP; @@ -9,9 +8,11 @@ import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; import openblocks.rpc.IGuideAnimationTrigger; import openmods.shapes.IShapeable; import openmods.utils.render.GeometryUtils; @@ -37,7 +38,7 @@ public class TileEntityBuilderGuide extends TileEntityGuide implements IGuideAni final int blockMeta = itemBlock.getMetadata(heldStack.getItemDamage()); if (player.capabilities.isCreativeMode && isInFillMode()) { - creativeReplaceBlocks(block, blockMeta); + creativeReplaceBlocks(player, heldStack, block, blockMeta, side, hitX, hitY, hitZ); return true; } else { return survivalPlaceBlocks(player, heldStack, block, blockMeta, side, hitX, hitY, hitZ); @@ -53,10 +54,13 @@ public class TileEntityBuilderGuide extends TileEntityGuide implements IGuideAni if (worldObj.isRemote) ticks++; } - private void creativeReplaceBlocks(Block block, int blockMeta) { - final IBlockState state = block.getStateFromMeta(blockMeta); - for (BlockPos coord : getShapeSafe()) - worldObj.setBlockState(pos.add(coord), state); + private void creativeReplaceBlocks(EntityPlayerMP player, ItemStack heldStack, Block block, int blockMeta, EnumFacing side, float hitX, float hitY, float hitZ) { + // TODO verify + for (BlockPos coord : getShapeSafe().getCoords()) { + final BlockPos clickPos = pos.add(coord); + final IBlockState state = block.getStateForPlacement(worldObj, clickPos, side, hitX, hitY, hitZ, blockMeta, player, heldStack); + worldObj.setBlockState(clickPos, state); + } } @Override @@ -66,12 +70,13 @@ public class TileEntityBuilderGuide extends TileEntityGuide implements IGuideAni } private boolean survivalPlaceBlocks(EntityPlayerMP player, ItemStack heldItem, Block block, int blockMeta, EnumFacing side, float hitX, float hitY, float hitZ) { - for (BlockPos relCoord : getShapeSafe()) { + for (BlockPos relCoord : getShapeSafe().getCoords()) { BlockPos absPos = pos.add(relCoord); if (worldObj.isBlockLoaded(absPos) && worldObj.isAirBlock(absPos)) { - boolean hasPlaced = player.theItemInWorldManager.activateBlockOrUseItem(player, worldObj, heldItem, absPos, side, hitX, hitY, hitZ); - if (hasPlaced) { - final int stateId = Block.getStateId(block.getStateFromMeta(blockMeta)); + final EnumActionResult placeResult = player.interactionManager.processRightClickBlock(player, worldObj, heldItem, EnumHand.MAIN_HAND, absPos, side, hitX, hitY, hitZ); + + if (placeResult == EnumActionResult.PASS) { + final int stateId = Block.getStateId(worldObj.getBlockState(absPos)); createServerRpcProxy(IGuideAnimationTrigger.class).trigger(absPos, stateId); return true; } @@ -83,7 +88,7 @@ public class TileEntityBuilderGuide extends TileEntityGuide implements IGuideAni } private boolean isInFillMode() { - return worldObj.getBlockState(pos.up()).getBlock() == Blocks.obsidian; + return worldObj.getBlockState(pos.up()).getBlock() == Blocks.OBSIDIAN; } public float getTicks() { diff --git a/src/main/java/openblocks/common/tileentity/TileEntityCannon.java b/src/main/java/openblocks/common/tileentity/TileEntityCannon.java index 44ad6fc0..88dc05ed 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityCannon.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityCannon.java @@ -4,9 +4,16 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ITickable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import openblocks.OpenBlocks; import openblocks.api.IPointable; import openblocks.common.entity.EntityItemProjectile; import openblocks.rpc.ITriggerable; @@ -41,12 +48,12 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS public double currentYaw = 0; private double currentSpeed = 1.4; - public Vec3 motion; + public Vec3d motion; public boolean renderLine = true; private int ticksSinceLastFire = Integer.MAX_VALUE; - private Vec3 projectileOrigin = null; + private Vec3d projectileOrigin = null; @Override protected void createSyncedFields() { @@ -119,12 +126,12 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS item.setDefaultPickupDelay(); // Now that we generate vectors instead of eular angles, this should be revised. - Vec3 motion = getMotion(); + Vec3d motion = getMotion(); item.motionX = motion.xCoord; item.motionY = motion.yCoord; item.motionZ = motion.zCoord; worldObj.spawnEntityInWorld(item); - playSoundAtBlock("openblocks:cannon.activate", 0.2f, 1.0f); + playSoundAtBlock(OpenBlocks.Sounds.BLOCK_CANNON_ACTIVATE, 0.2f, 1.0f); } @Override @@ -153,7 +160,7 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS return box.expand(32.0, 32.0, 32.0); } - private Vec3 calcMotionFromAngles() { + private Vec3d calcMotionFromAngles() { double p = Math.toRadians(currentPitch); double y = Math.toRadians(180 - currentYaw); double sinPitch = Math.sin(p); @@ -161,7 +168,7 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS double sinYaw = Math.sin(y); double cosYaw = Math.cos(y); - return new Vec3(-cosPitch * sinYaw * currentSpeed, + return new Vec3d(-cosPitch * sinYaw * currentSpeed, sinPitch * currentSpeed, -cosPitch * cosYaw * currentSpeed); } @@ -170,21 +177,21 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS motion = null; } - public Vec3 getMotion() { + public Vec3d getMotion() { if (motion == null) motion = calcMotionFromAngles(); return motion; } private void checkOrigin() { if (projectileOrigin == null) { - projectileOrigin = new Vec3(pos).addVector(0.5, 0, 0.5); + projectileOrigin = new Vec3d(pos).addVector(0.5, 0, 0.5); } } public void setTarget(BlockPos pos) { checkOrigin(); // We target the middle of the block, at the very top. - final Vec3 target = new Vec3(pos).addVector(0.5, 1, 0.5); + final Vec3d target = new Vec3d(pos).addVector(0.5, 1, 0.5); // Horizontal distance between the origin and target final double distHorizontal = KNOB_LOB_HORIZONTAL_MUL * Math.sqrt( @@ -195,20 +202,19 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS final double distVertical = Math.max((target.yCoord - projectileOrigin.yCoord) * KNOB_LOB_VERTICAL_MUL, 0); // Calculate the arc of the trajectory - final float lobScale = (float) - Math.min(KNOB_LOB_MAXIMUM_VALUE, - Math.max(KNOB_LOB_MINIMUM_VALUE, - KNOB_LOB_BONUS + distHorizontal + distVertical)); + final float lobScale = (float)Math.min(KNOB_LOB_MAXIMUM_VALUE, + Math.max(KNOB_LOB_MINIMUM_VALUE, + KNOB_LOB_BONUS + distHorizontal + distVertical)); // Calculate the velocity of the projectile - final Vec3 velocity = TileEntityCannonLogic.calculateTrajectory(projectileOrigin, target, lobScale); + final Vec3d velocity = TileEntityCannonLogic.calculateTrajectory(projectileOrigin, target, lobScale); // m/s applied to item. final double speed = velocity.lengthVector(); targetSpeed.set(speed); // reverse the vector to angles for cannon model - final Vec3 direction = velocity.normalize(); + final Vec3d direction = velocity.normalize(); final double pitch = Math.asin(direction.yCoord); final double yaw = Math.atan2(direction.zCoord, direction.xCoord); @@ -229,12 +235,12 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS @Override public void onPointingStart(ItemStack itemStack, EntityPlayer player) { - player.addChatComponentMessage(new ChatComponentTranslation("openblocks.misc.selected_cannon")); + player.addChatComponentMessage(new TextComponentTranslation("openblocks.misc.selected_cannon")); } @Override public void onPointingEnd(ItemStack itemStack, EntityPlayer player, BlockPos pos) { - player.addChatMessage(new ChatComponentTranslation("openblocks.misc.pointed_cannon", pos.getX(), pos.getY(), pos.getZ())); + player.addChatMessage(new TextComponentTranslation("openblocks.misc.pointed_cannon", pos.getX(), pos.getY(), pos.getZ())); setTarget(pos); } @@ -293,7 +299,7 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS /** * Physics gravity vector in partial time squared for acceleration calculation */ - private static final Vec3 PHYS_GRAVITY_VECTOR_SQUARE_PARTIAL = new Vec3(0, PHYS_PARTIAL_TIME_SQUARE * -PHYS_PARTIAL_WORLD_GRAVITY, 0); + private static final Vec3d PHYS_GRAVITY_VECTOR_SQUARE_PARTIAL = new Vec3d(0, PHYS_PARTIAL_TIME_SQUARE * -PHYS_PARTIAL_WORLD_GRAVITY, 0); /** * The actual work for calculating trajectory. Which is much simpler now. @@ -306,24 +312,22 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS * The arcing size of the trajectory * @return Vector to achieve trajectory */ - public static Vec3 calculateTrajectory(Vec3 start, Vec3 target, float scale) { + public static Vec3d calculateTrajectory(Vec3d start, Vec3d target, float scale) { final double n = scale * PHYS_STEPS_PER_SECOND; final double accelerationMultiplier = 0.5 * n * n + n; // (n^2+n)/2 - final Vec3 scaledAcceleration = new Vec3( + final Vec3d scaledAcceleration = new Vec3d( PHYS_GRAVITY_VECTOR_SQUARE_PARTIAL.xCoord * accelerationMultiplier, PHYS_GRAVITY_VECTOR_SQUARE_PARTIAL.yCoord * accelerationMultiplier, - PHYS_GRAVITY_VECTOR_SQUARE_PARTIAL.zCoord * accelerationMultiplier - ); + PHYS_GRAVITY_VECTOR_SQUARE_PARTIAL.zCoord * accelerationMultiplier); // -1 /n * Phys = -Phys / n final double velocityMultiplier = -PHYS_STEPS_PER_SECOND / n; - final Vec3 velocity = new Vec3( + final Vec3d velocity = new Vec3d( (start.xCoord + scaledAcceleration.xCoord - target.xCoord) * velocityMultiplier, (start.yCoord + scaledAcceleration.yCoord - target.yCoord) * velocityMultiplier, - (start.zCoord + scaledAcceleration.zCoord - target.zCoord) * velocityMultiplier - ); + (start.zCoord + scaledAcceleration.zCoord - target.zCoord) * velocityMultiplier); return velocity; } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityCanvas.java b/src/main/java/openblocks/common/tileentity/TileEntityCanvas.java index aae88d6a..a89a7108 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityCanvas.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityCanvas.java @@ -1,9 +1,9 @@ package openblocks.common.tileentity; +import com.google.common.collect.Maps; import java.util.List; import java.util.Map; import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -27,8 +27,6 @@ import openmods.sync.SyncableIntArray; import openmods.tileentity.SyncedTileEntity; import openmods.utils.BlockUtils; -import com.google.common.collect.Maps; - public class TileEntityCanvas extends SyncedTileEntity implements IActivateAwareTile, ICustomBreakDrops, ICustomHarvestDrops { /* Used for painting other blocks */ @@ -125,7 +123,8 @@ public class TileEntityCanvas extends SyncedTileEntity implements IActivateAware public IBlockState getPaintedBlockState() { if (paintedBlockState == null) { final Block block = paintedBlock.getValue(); - if (block != Blocks.air) { + if (block != Blocks.AIR) { + // TODO 1.10 switch storage to state paintedBlockState = block.getStateFromMeta(paintedBlockMeta.get()); } else { paintedBlockState = OpenBlocks.Blocks.canvas.getDefaultState(); @@ -212,7 +211,7 @@ public class TileEntityCanvas extends SyncedTileEntity implements IActivateAware @Override public boolean onBlockActivated(EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { - ItemStack held = player.getHeldItem(); + ItemStack held = player.getHeldItemMainhand(); if (held != null) { Item heldItem = held.getItem(); if (heldItem instanceof ItemSqueegee || heldItem instanceof ItemPaintBrush || heldItem == OpenBlocks.Items.stencil) return false; diff --git a/src/main/java/openblocks/common/tileentity/TileEntityDonationStation.java b/src/main/java/openblocks/common/tileentity/TileEntityDonationStation.java index 882bd34b..89add557 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityDonationStation.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityDonationStation.java @@ -1,7 +1,6 @@ package openblocks.common.tileentity; import java.util.List; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -50,9 +49,10 @@ public class TileEntityDonationStation extends OpenTileEntity implements IHasGui } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityDrawingTable.java b/src/main/java/openblocks/common/tileentity/TileEntityDrawingTable.java index dcf29dbc..4615b1e8 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityDrawingTable.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityDrawingTable.java @@ -52,9 +52,10 @@ public class TileEntityDrawingTable extends OpenTileEntity implements IHasGui, I } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityElevatorRotating.java b/src/main/java/openblocks/common/tileentity/TileEntityElevatorRotating.java index 5181de62..b94e3ce3 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityElevatorRotating.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityElevatorRotating.java @@ -2,13 +2,15 @@ package openblocks.common.tileentity; import java.util.List; import java.util.Set; - import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; -import openmods.api.*; +import openmods.api.IActivateAwareTile; +import openmods.api.ICustomHarvestDrops; +import openmods.api.ICustomPickItem; +import openmods.api.IPlaceAwareTile; import openmods.colors.ColorMeta; import openmods.sync.SyncableEnum; import openmods.tileentity.SyncedTileEntity; @@ -60,7 +62,7 @@ public class TileEntityElevatorRotating extends SyncedTileEntity implements IPla public boolean onBlockActivated(EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldObj.isRemote) return false; - ItemStack stack = player.getHeldItem(); + ItemStack stack = player.getHeldItemMainhand(); if (stack != null) { Set metas = ColorMeta.fromStack(stack); if (!metas.isEmpty()) { diff --git a/src/main/java/openblocks/common/tileentity/TileEntityFan.java b/src/main/java/openblocks/common/tileentity/TileEntityFan.java index e7a988b9..b60bc742 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityFan.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityFan.java @@ -1,16 +1,15 @@ package openblocks.common.tileentity; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ITickable; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.Vec3d; import openblocks.Config; import openmods.api.IAddAwareTile; import openmods.api.INeighbourAwareTile; @@ -50,13 +49,13 @@ public class TileEntityFan extends SyncedTileEntity implements IPlaceAwareTile, if (entities.isEmpty()) return; double angle = Math.toRadians(getAngle() - 90); - final Vec3 blockPos = getConeApex(angle); - final Vec3 basePos = getConeBaseCenter(angle); - final Vec3 coneAxis = new Vec3(basePos.xCoord - blockPos.xCoord, basePos.yCoord - blockPos.yCoord, basePos.zCoord - blockPos.zCoord); + final Vec3d blockPos = getConeApex(angle); + final Vec3d basePos = getConeBaseCenter(angle); + final Vec3d coneAxis = new Vec3d(basePos.xCoord - blockPos.xCoord, basePos.yCoord - blockPos.yCoord, basePos.zCoord - blockPos.zCoord); for (Entity entity : entities) { if (entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode) continue; - Vec3 directionVec = new Vec3( + Vec3d directionVec = new Vec3d( entity.posX - blockPos.xCoord, entity.posY - blockPos.yCoord, entity.posZ - blockPos.zCoord); @@ -65,24 +64,24 @@ public class TileEntityFan extends SyncedTileEntity implements IPlaceAwareTile, final double distToOrigin = directionVec.lengthVector(); final double force = (1.0 - distToOrigin / Config.fanRange) * maxForce; if (force <= 0) continue; - Vec3 normal = directionVec.normalize(); + Vec3d normal = directionVec.normalize(); entity.motionX += force * normal.xCoord; entity.motionZ += force * normal.zCoord; } } } - private Vec3 getConeBaseCenter(double angle) { + private Vec3d getConeBaseCenter(double angle) { // TODO 1.8.9 this may be constant - return new Vec3(pos) + return new Vec3d(pos) .addVector( (Math.cos(angle) * Config.fanRange), 0.5, (Math.sin(angle) * Config.fanRange)); } - private Vec3 getConeApex(double angle) { - return new Vec3(pos) + private Vec3d getConeApex(double angle) { + return new Vec3d(pos) .addVector( 0.5 - Math.cos(angle) * 1.1, 0.5, @@ -94,7 +93,7 @@ public class TileEntityFan extends SyncedTileEntity implements IPlaceAwareTile, return boundingBox.expand(Config.fanRange, Config.fanRange, Config.fanRange); } - private static boolean isLyingInSphericalCone(Vec3 coneAxis, Vec3 originToTarget, double halfAperture) { + private static boolean isLyingInSphericalCone(Vec3d coneAxis, Vec3d originToTarget, double halfAperture) { double angleToAxisCos = originToTarget.dotProduct(coneAxis) / originToTarget.lengthVector() / coneAxis.lengthVector(); return angleToAxisCos > Math.cos(halfAperture); } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityGoldenEgg.java b/src/main/java/openblocks/common/tileentity/TileEntityGoldenEgg.java index 076c77e9..ea72ce9b 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityGoldenEgg.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityGoldenEgg.java @@ -1,19 +1,21 @@ package openblocks.common.tileentity; +import com.google.common.base.Objects; +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; import java.util.List; import java.util.Random; import java.util.UUID; - import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTUtil; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.ITickable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.relauncher.Side; @@ -31,10 +33,6 @@ import openmods.fakeplayer.OpenModsFakePlayer; import openmods.sync.SyncableEnum; import openmods.tileentity.SyncedTileEntity; -import com.google.common.base.Objects; -import com.google.common.collect.Lists; -import com.mojang.authlib.GameProfile; - public class TileEntityGoldenEgg extends SyncedTileEntity implements IPlaceAwareTile, IBreakAwareTile, ITickable { private static final float SPEED_CHANGE_RATE = 0.1f; @@ -257,14 +255,16 @@ public class TileEntityGoldenEgg extends SyncedTileEntity implements IPlaceAware } @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); + public NBTTagCompound writeToNBT(NBTTagCompound nbt) { + nbt = super.writeToNBT(nbt); if (owner != null) { NBTTagCompound ownerTag = new NBTTagCompound(); NBTUtil.writeGameProfile(ownerTag, owner); nbt.setTag("Owner", ownerTag); } + + return nbt; } @Override @@ -273,7 +273,8 @@ public class TileEntityGoldenEgg extends SyncedTileEntity implements IPlaceAware if (nbt.hasKey("owner", Constants.NBT.TAG_STRING)) { String ownerName = nbt.getString("owner"); - this.owner = MinecraftServer.getServer().getPlayerProfileCache().getGameProfileForUsername(ownerName); + + this.owner = TileEntitySkull.updateGameprofile(new GameProfile(null, ownerName)); } else if (nbt.hasKey("OwnerUUID", Constants.NBT.TAG_STRING)) { final String uuidStr = nbt.getString("OwnerUUID"); try { diff --git a/src/main/java/openblocks/common/tileentity/TileEntityGrave.java b/src/main/java/openblocks/common/tileentity/TileEntityGrave.java index 9fc07997..83da2645 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityGrave.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityGrave.java @@ -1,10 +1,11 @@ package openblocks.common.tileentity; +import com.google.common.base.Predicate; +import com.google.common.base.Strings; import java.util.List; - import javax.annotation.Nullable; - import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; @@ -16,14 +17,22 @@ import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.text.ITextComponent; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.storage.WorldInfo; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.Config; -import openmods.api.*; +import openblocks.OpenBlocks; +import openmods.api.IActivateAwareTile; +import openmods.api.IAddAwareTile; +import openmods.api.INeighbourAwareTile; +import openmods.api.IPlaceAwareTile; import openmods.inventory.GenericInventory; import openmods.inventory.IInventoryProvider; import openmods.sync.SyncableBoolean; @@ -31,9 +40,6 @@ import openmods.sync.SyncableString; import openmods.tileentity.SyncedTileEntity; import openmods.utils.BlockUtils; -import com.google.common.base.Predicate; -import com.google.common.base.Strings; - public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile, IInventoryProvider, INeighbourAwareTile, IActivateAwareTile, IAddAwareTile, ITickable { private static final Predicate IS_MOB = new Predicate() { @@ -47,7 +53,7 @@ public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile private SyncableString perishedUsername; public SyncableBoolean onSoil; - private IChatComponent deathMessage; + private ITextComponent deathMessage; private GenericInventory inventory = registerInventoryCallback(new GenericInventory("grave", false, 1)); @@ -82,7 +88,7 @@ public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile return perishedUsername.getValue(); } - public void setDeathMessage(IChatComponent msg) { + public void setDeathMessage(ITextComponent msg) { deathMessage = msg.createCopy(); } @@ -115,14 +121,16 @@ public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); if (deathMessage != null) { - String serialized = IChatComponent.Serializer.componentToJson(deathMessage); + String serialized = ITextComponent.Serializer.componentToJson(deathMessage); tag.setString(TAG_MESSAGE, serialized); } + + return tag; } @Override @@ -133,7 +141,7 @@ public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile String serializedMsg = tag.getString(TAG_MESSAGE); if (!Strings.isNullOrEmpty(serializedMsg)) { - deathMessage = IChatComponent.Serializer.jsonToComponent(serializedMsg); + deathMessage = ITextComponent.Serializer.jsonToComponent(serializedMsg); } } @@ -143,8 +151,9 @@ public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile } protected void updateBlockBelow() { - Block block = worldObj.getBlockState(pos.down()).getBlock(); - onSoil.set(block == Blocks.dirt || block == Blocks.grass); + IBlockState block = worldObj.getBlockState(pos.down()); + final Material material = block.getMaterial(); + onSoil.set(material == Material.GRASS || material == Material.GROUND); } @Override @@ -167,7 +176,7 @@ public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile @Override public boolean onBlockActivated(EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { if (player.worldObj.isRemote) return false; - ItemStack held = player.getHeldItem(); + ItemStack held = player.getHeldItemMainhand(); if (held != null && held.getItem().getToolClasses(held).contains("shovel")) { robGrave(player, held); return true; @@ -190,14 +199,14 @@ public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile inventory.clearAndSetSlotCount(0); if (dropped) { - worldObj.playAuxSFXAtEntity(null, 2001, pos, Block.getIdFromBlock(Blocks.dirt)); + worldObj.playEvent(null, 2001, pos, Block.getIdFromBlock(Blocks.DIRT)); if (worldObj.rand.nextDouble() < Config.graveSpecialAction) ohNoes(player); held.damageItem(2, player); } } private void ohNoes(EntityPlayer player) { - worldObj.playSoundAtEntity(player, "openblocks:grave.rob", 1, 1); + worldObj.playSound(null, player.getPosition(), OpenBlocks.Sounds.BLOCK_GRAVE_ROB, SoundCategory.BLOCKS, 1, 1); final WorldInfo worldInfo = worldObj.getWorldInfo(); worldInfo.setThunderTime(35 * 20); diff --git a/src/main/java/openblocks/common/tileentity/TileEntityGuide.java b/src/main/java/openblocks/common/tileentity/TileEntityGuide.java index 00e2e192..a286bd05 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityGuide.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityGuide.java @@ -1,16 +1,31 @@ package openblocks.common.tileentity; -import java.util.*; - +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.primitives.Doubles; +import com.google.common.primitives.Ints; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.Config; import openblocks.common.item.ItemGuide; +import openblocks.shapes.CoordShape; import openblocks.shapes.GuideShape; import openmods.api.IAddAwareTile; import openmods.api.INeighbourAwareTile; @@ -19,24 +34,27 @@ import openmods.geometry.HalfAxis; import openmods.geometry.Orientation; import openmods.shapes.IShapeGenerator; import openmods.shapes.IShapeable; -import openmods.sync.*; +import openmods.sync.ISyncListener; +import openmods.sync.ISyncableObject; +import openmods.sync.SyncableBoolean; +import openmods.sync.SyncableEnum; +import openmods.sync.SyncableInt; +import openmods.sync.SyncableVarInt; import openmods.sync.drops.DroppableTileEntity; import openmods.sync.drops.StoreOnDrop; import openmods.utils.CollectionUtils; import openmods.utils.MathUtils; import openperipheral.api.adapter.Asynchronous; -import openperipheral.api.adapter.method.*; +import openperipheral.api.adapter.method.Alias; +import openperipheral.api.adapter.method.Arg; +import openperipheral.api.adapter.method.ReturnType; +import openperipheral.api.adapter.method.ScriptCallable; import openperipheral.api.struct.ScriptStruct; import openperipheral.api.struct.StructField; -import com.google.common.base.Preconditions; -import com.google.common.collect.*; -import com.google.common.primitives.Doubles; -import com.google.common.primitives.Ints; - public class TileEntityGuide extends DroppableTileEntity implements ISyncListener, INeighbourAwareTile, IAddAwareTile, ITickable { - private static final Comparator BlockPos_COMPARATOR = new Comparator() { + private static final Comparator COMPARATOR = new Comparator() { @Override public int compare(BlockPos o1, BlockPos o2) { { @@ -76,8 +94,10 @@ public class TileEntityGuide extends DroppableTileEntity implements ISyncListene } }; - private List shape; - private List previousShape; + private CoordShape shape; + private CoordShape previousShape; + private CoordShape toDeleteShape; + private float timeSinceChange = 0; private AxisAlignedBB renderAABB; @@ -265,11 +285,11 @@ public class TileEntityGuide extends DroppableTileEntity implements ISyncListene } private void displayModeChange(EntityPlayer player) { - player.addChatMessage(new ChatComponentTranslation("openblocks.misc.change_mode", getCurrentMode().getLocalizedName())); + player.addChatMessage(new TextComponentTranslation("openblocks.misc.change_mode", getCurrentMode().getLocalizedName())); } private void displayBlockCount(EntityPlayer player) { - player.addChatMessage(new ChatComponentTranslation("openblocks.misc.total_blocks", shape.size())); + player.addChatMessage(new TextComponentTranslation("openblocks.misc.total_blocks", shape.size())); } public boolean shouldRender() { @@ -290,8 +310,9 @@ public class TileEntityGuide extends DroppableTileEntity implements ISyncListene } private void recreateShape() { + toDeleteShape = previousShape; previousShape = shape; - shape = generateShape(); + shape = new CoordShape(generateShape()); renderAABB = null; } @@ -308,7 +329,7 @@ public class TileEntityGuide extends DroppableTileEntity implements ISyncListene generator.generateShape(-negX.get(), -negY.get(), -negZ.get(), posX.get(), posY.get(), posZ.get(), collector); final List sortedResults = Lists.newArrayList(uniqueResults); - Collections.sort(sortedResults, BlockPos_COMPARATOR); + Collections.sort(sortedResults, COMPARATOR); final List rotatedResult = Lists.newArrayList(); final Orientation orientation = getOrientation(); @@ -328,14 +349,20 @@ public class TileEntityGuide extends DroppableTileEntity implements ISyncListene return true; } - public List getShape() { + public CoordShape getShape() { return shape; } - public List getPreviousShape() { + public CoordShape getPreviousShape() { return previousShape; } + public CoordShape getAndDeleteShape() { + CoordShape toDel = toDeleteShape; + toDeleteShape = null; + return toDel; + } + @Override public void updateContainingBlockInfo() { super.updateContainingBlockInfo(); @@ -360,7 +387,7 @@ public class TileEntityGuide extends DroppableTileEntity implements ISyncListene double maxZ = 1; if (shape != null) { - for (BlockPos c : shape) { + for (BlockPos c : shape.getCoords()) { { final int x = c.getX(); if (maxX < x) maxX = x; @@ -411,7 +438,7 @@ public class TileEntityGuide extends DroppableTileEntity implements ISyncListene } private void notifyPlayer(EntityPlayer player) { - player.addChatMessage(new ChatComponentTranslation("openblocks.misc.change_box_size", + player.addChatMessage(new TextComponentTranslation("openblocks.misc.change_box_size", -negX.get(), -negY.get(), -negZ.get(), +posX.get(), +posY.get(), +posZ.get())); displayBlockCount(player); @@ -457,7 +484,7 @@ public class TileEntityGuide extends DroppableTileEntity implements ISyncListene updateRedstone(); } - protected List getShapeSafe() { + protected CoordShape getShapeSafe() { if (shape == null) recreateShape(); return shape; } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityHealBlock.java b/src/main/java/openblocks/common/tileentity/TileEntityHealBlock.java index 7fa3b4ec..d2ab86b7 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityHealBlock.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityHealBlock.java @@ -1,9 +1,8 @@ package openblocks.common.tileentity; import java.util.List; - import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; +import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; import net.minecraft.util.ITickable; import openmods.OpenMods; @@ -29,8 +28,8 @@ public class TileEntityHealBlock extends OpenTileEntity implements ITickable { * someone else should ultimately decide if it should be * done (you know who you are) */ - player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 1, 10)); - player.addPotionEffect(new PotionEffect(Potion.saturation.id, 1)); + player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 1, 10)); + player.addPotionEffect(new PotionEffect(MobEffects.SATURATION, 1)); } } } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityImaginary.java b/src/main/java/openblocks/common/tileentity/TileEntityImaginary.java index 005c7b3d..45ad5d59 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityImaginary.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityImaginary.java @@ -1,15 +1,15 @@ package openblocks.common.tileentity; +import com.google.common.base.Preconditions; import java.util.List; - import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.common.item.ItemImaginary; @@ -19,8 +19,6 @@ import openmods.api.ICustomPickItem; import openmods.tileentity.SimpleNetTileEntity; import openmods.utils.BlockUtils; -import com.google.common.base.Preconditions; - public class TileEntityImaginary extends SimpleNetTileEntity implements ICustomPickItem { public static final double PANEL_HEIGHT = 0.1; @@ -237,13 +235,15 @@ public class TileEntityImaginary extends SimpleNetTileEntity implements ICustomP } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); if (color != null) tag.setInteger("Color", color); tag.setBoolean("IsInverted", isInverted); tag.setByte("Type", (byte)collisionData.getType().ordinal()); collisionData.writeToNBT(tag); + + return tag; } @Override @@ -273,10 +273,6 @@ public class TileEntityImaginary extends SimpleNetTileEntity implements ICustomP return isInverted(); } - public boolean is(EntityPlayer player) { - return player.getHeldItem() != null; - } - public boolean is(Property what, Entity e) { return (e instanceof EntityPlayer) && is(what, (EntityPlayer)e); } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityItemDropper.java b/src/main/java/openblocks/common/tileentity/TileEntityItemDropper.java index 7cfa53ba..b6a67cb6 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityItemDropper.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityItemDropper.java @@ -83,9 +83,10 @@ public class TileEntityItemDropper extends OpenTileEntity implements INeighbourA } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityPaintCan.java b/src/main/java/openblocks/common/tileentity/TileEntityPaintCan.java index a5ce156b..ad88d9e9 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityPaintCan.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityPaintCan.java @@ -2,8 +2,10 @@ package openblocks.common.tileentity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; import openblocks.common.item.ItemPaintBrush; import openblocks.common.item.ItemPaintCan; import openmods.api.IActivateAwareTile; @@ -28,19 +30,19 @@ public class TileEntityPaintCan extends DroppableTileEntity implements IActivate @Override public boolean onBlockActivated(EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { - if (!worldObj.isRemote && amount.get() > 0) { - ItemStack heldStack = player.getHeldItem(); + if (amount.get() > 0) { // TODO 1.10 verify sounds effects of removing 'isRemote' + ItemStack heldStack = player.getHeldItemMainhand(); if (heldStack != null && heldStack.getItem() instanceof ItemPaintBrush) { ItemPaintBrush.setColor(heldStack, color.get()); heldStack.setItemDamage(0); amount.modify(-1); sync(); - worldObj.playSoundAtEntity(player, "game.neutral.swim.splash", 0.1F, 1.2F); + worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 1.2F); } } if (amount.get() <= 0 && !worldObj.isRemote) { - ItemStack item = new ItemStack(Items.bucket); + ItemStack item = new ItemStack(Items.BUCKET); BlockUtils.dropItemStackInWorld(worldObj, pos, item); worldObj.setBlockToAir(pos); } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityPaintMixer.java b/src/main/java/openblocks/common/tileentity/TileEntityPaintMixer.java index 08509734..f735e8bd 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityPaintMixer.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityPaintMixer.java @@ -1,7 +1,7 @@ package openblocks.common.tileentity; +import com.google.common.collect.Maps; import java.util.EnumMap; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; @@ -30,15 +30,11 @@ import openmods.sync.SyncableInt; import openmods.sync.drops.DroppableTileEntity; import openmods.sync.drops.StoreOnDrop; import openmods.utils.MiscUtils; - import org.apache.commons.lang3.ArrayUtils; -import com.google.common.collect.Maps; - public class TileEntityPaintMixer extends DroppableTileEntity implements IInventoryProvider, IHasGui, IInventoryCallback, IColorChanger, ITickable { - private static final ItemStack PAINT_CAN = new ItemStack(OpenBlocks.Blocks.paintCan); - private static final ItemStack MILK_BUCKET = new ItemStack(Items.milk_bucket); + private static final ItemStack MILK_BUCKET = new ItemStack(Items.MILK_BUCKET); public static final int PROGRESS_TICKS = 300; public static enum Slots { @@ -332,9 +328,10 @@ public class TileEntityPaintMixer extends DroppableTileEntity implements IInvent } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityProjector.java b/src/main/java/openblocks/common/tileentity/TileEntityProjector.java index 01248639..eec65732 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityProjector.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityProjector.java @@ -1,18 +1,20 @@ package openblocks.common.tileentity; import java.util.Set; - +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import openblocks.client.gui.GuiProjector; import openblocks.common.HeightMapData; import openblocks.common.MapDataManager; +import openblocks.common.block.BlockProjector; import openblocks.common.container.ContainerProjector; import openblocks.common.item.ItemEmptyMap; import openblocks.common.item.ItemHeightMap; @@ -22,13 +24,17 @@ import openmods.include.IncludeInterface; import openmods.inventory.GenericInventory; import openmods.inventory.IInventoryProvider; import openmods.inventory.TileEntityInventory; -import openmods.sync.*; +import openmods.sync.ISyncListener; +import openmods.sync.ISyncableObject; +import openmods.sync.SyncableByte; +import openmods.sync.SyncableInt; import openmods.tileentity.SyncedTileEntity; +import openmods.utils.BlockNotifyFlags; import openmods.utils.BlockUtils; public class TileEntityProjector extends SyncedTileEntity implements IHasGui, IInventoryProvider, ISyncListener, IRotatable { - private GenericInventory inventory = new TileEntityInventory(this, "openblocks.projector", false, 1) { + private final GenericInventory inventory = new TileEntityInventory(this, "openblocks.projector", false, 1) { @Override public boolean isItemValidForSlot(int i, ItemStack stack) { if (stack == null) return false; @@ -59,6 +65,17 @@ public class TileEntityProjector extends SyncedTileEntity implements IHasGui, II } else TileEntityProjector.this.mapId.set(-1); } else TileEntityProjector.this.mapId.set(-1); sync(); + + final boolean isActive = TileEntityProjector.this.mapId() >= 0; + final BlockPos pos = getPos(); + final IBlockState oldState = worldObj.getBlockState(pos); + final IBlockState newState = oldState.withProperty(BlockProjector.ACTIVE, isActive); + + if (oldState != newState) { + worldObj.setBlockState(pos, newState, BlockNotifyFlags.ALL); + // TODO 1.10 verify is following is needed (seems to be already handled) + // worldObj.checkLight(pos); + } } markUpdated(); @@ -85,12 +102,6 @@ public class TileEntityProjector extends SyncedTileEntity implements IHasGui, II return BlockUtils.expandAround(pos, 1, 5, 1); } - @Override - public void validate() { - super.validate(); - inventory.onInventoryChanged(0); - } - @Override public boolean shouldRenderInPass(int pass) { return pass == 0 || pass == 1; @@ -103,9 +114,10 @@ public class TileEntityProjector extends SyncedTileEntity implements IHasGui, II } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override @@ -158,11 +170,6 @@ public class TileEntityProjector extends SyncedTileEntity implements IHasGui, II if (worldObj != null || mapId < 0) MapDataManager.instance.markDataUpdated(worldObj, mapId); } - public void fetchMap() { - int mapId = this.mapId.get(); - if (worldObj != null && mapId >= 0) MapDataManager.getMapData(worldObj, mapId); - } - @Override @IncludeInterface public IInventory getInventory() { diff --git a/src/main/java/openblocks/common/tileentity/TileEntitySprinkler.java b/src/main/java/openblocks/common/tileentity/TileEntitySprinkler.java index f67769a6..1d86243d 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntitySprinkler.java +++ b/src/main/java/openblocks/common/tileentity/TileEntitySprinkler.java @@ -1,16 +1,18 @@ package openblocks.common.tileentity; import java.util.Random; - import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemDye; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.WorldServer; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -19,7 +21,9 @@ import openblocks.Config; import openblocks.OpenBlocks; import openblocks.client.gui.GuiSprinkler; import openblocks.common.container.ContainerSprinkler; -import openmods.api.*; +import openmods.api.IHasGui; +import openmods.api.INeighbourAwareTile; +import openmods.api.ISurfaceAttachment; import openmods.fakeplayer.FakePlayerPool; import openmods.fakeplayer.FakePlayerPool.PlayerUser; import openmods.fakeplayer.OpenModsFakePlayer; @@ -33,11 +37,10 @@ import openmods.liquids.GenericFluidHandler; import openmods.sync.SyncableFlags; import openmods.sync.SyncableTank; import openmods.tileentity.SyncedTileEntity; -import openmods.utils.BlockUtils; -public class TileEntitySprinkler extends SyncedTileEntity implements IBreakAwareTile, ISurfaceAttachment, IInventoryProvider, IHasGui, ITickable, INeighbourAwareTile { +public class TileEntitySprinkler extends SyncedTileEntity implements ISurfaceAttachment, IInventoryProvider, IHasGui, ITickable, INeighbourAwareTile { - private static final ItemStack BONEMEAL = new ItemStack(Items.dye, 1, 15); + private static final ItemStack BONEMEAL = new ItemStack(Items.DYE, 1, 15); private static final Random RANDOM = new Random(); @@ -91,7 +94,7 @@ public class TileEntitySprinkler extends SyncedTileEntity implements IBreakAware BlockPos target = pos.add(x, y, z); if (ItemDye.applyBonemeal(BONEMEAL.copy(), worldObj, target, fakePlayer)) - break; + break; } } @@ -119,7 +122,7 @@ public class TileEntitySprinkler extends SyncedTileEntity implements IBreakAware private void sprayParticles() { if (tank.getFluidAmount() > 0) { // 0 = All, 1 = Decreased, 2 = Minimal - final int particleSetting = Minecraft.getMinecraft().gameSettings.particleSetting; + final int particleSetting = OpenBlocks.proxy.getParticleSettings(); if (particleSetting > 2) return; final int fillFactor = SPRINKER_MOD[particleSetting]; @@ -144,7 +147,7 @@ public class TileEntitySprinkler extends SyncedTileEntity implements IBreakAware final double sideVelocityX = spraySideVelocity * offsetX; final double sideVelocityZ = spraySideVelocity * offsetZ; - Vec3 vec = new Vec3( + Vec3d vec = new Vec3d( forwardVelocityX + sideVelocityX, 0.35, forwardVelocityZ + sideVelocityZ); @@ -206,13 +209,6 @@ public class TileEntitySprinkler extends SyncedTileEntity implements IBreakAware return EnumFacing.DOWN; } - @Override - public void onBlockBroken() { - if (!worldObj.isRemote && !worldObj.isAirBlock(pos)) { - BlockUtils.dropItemStackInWorld(worldObj, pos, new ItemStack(OpenBlocks.Blocks.sprinkler)); - } - } - /** * Get spray direction of Sprinkler particles * @@ -235,9 +231,11 @@ public class TileEntitySprinkler extends SyncedTileEntity implements IBreakAware } @Override - public void writeToNBT(NBTTagCompound tag) { + public NBTTagCompound writeToNBT(NBTTagCompound tag) { super.writeToNBT(tag); inventory.writeToNBT(tag); + + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityTank.java b/src/main/java/openblocks/common/tileentity/TileEntityTank.java index 6f09ee2a..e902ec69 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityTank.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityTank.java @@ -1,8 +1,8 @@ package openblocks.common.tileentity; +import com.google.common.collect.Lists; import java.util.List; import java.util.Set; - import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -10,18 +10,29 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk.EnumCreateEntityType; -import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; +import net.minecraftforge.fluids.IFluidTank; import openblocks.Config; import openblocks.OpenBlocks; -import openblocks.client.renderer.tileentity.tank.*; +import openblocks.client.renderer.tileentity.tank.INeighbourMap; +import openblocks.client.renderer.tileentity.tank.ITankConnections; +import openblocks.client.renderer.tileentity.tank.ITankRenderFluidData; +import openblocks.client.renderer.tileentity.tank.NeighbourMap; +import openblocks.client.renderer.tileentity.tank.TankRenderLogic; import openblocks.common.LiquidXpUtils; import openblocks.common.item.ItemTankBlock; -import openmods.api.*; +import openmods.api.IActivateAwareTile; +import openmods.api.ICustomHarvestDrops; +import openmods.api.INeighbourAwareTile; +import openmods.api.IPlaceAwareTile; import openmods.include.IncludeInterface; import openmods.include.IncludeOverride; import openmods.liquids.GenericFluidHandler; @@ -32,8 +43,6 @@ import openmods.tileentity.SyncedTileEntity; import openmods.utils.EnchantmentUtils; import openmods.utils.ItemUtils; -import com.google.common.collect.Lists; - public class TileEntityTank extends SyncedTileEntity implements IActivateAwareTile, IPlaceAwareTile, INeighbourAwareTile, ICustomHarvestDrops, ITickable { private class RenderUpdateListeners implements ISyncListener { @@ -52,7 +61,8 @@ public class TileEntityTank extends SyncedTileEntity implements IActivateAwareTi if (changes.contains(tank)) { final FluidStack fluidStack = tank.getFluid(); if (!isSameFluid(fluidStack)) { - worldObj.markBlockForUpdate(pos); + // TODO 1.10 - verify + worldObj.markBlockRangeForRenderUpdate(pos, pos); prevFluidStack = fluidStack; int luminosity = fluidStack != null? fluidStack.getFluid().getLuminosity(fluidStack) : 0; @@ -82,7 +92,7 @@ public class TileEntityTank extends SyncedTileEntity implements IActivateAwareTi @Override public void invalidate() { super.invalidate(); - if (worldObj.isRemote) renderLogic.clearConnections(); + if (worldObj.isRemote) renderLogic.invalidateConnections(); } protected TileEntityTank getNeighourTank(BlockPos pos) { @@ -152,11 +162,11 @@ public class TileEntityTank extends SyncedTileEntity implements IActivateAwareTi } public ITankRenderFluidData getRenderFluidData() { - return renderLogic; + return renderLogic.getTankRenderData(); } - public ITankConnections getRenderConnectionsData() { - return renderLogic; + public ITankConnections getTankConnections() { + return renderLogic.getTankConnections(); } public boolean accepts(FluidStack liquid) { @@ -299,7 +309,7 @@ public class TileEntityTank extends SyncedTileEntity implements IActivateAwareTi worldObj.notifyNeighborsOfStateChange(pos, getBlockType()); } - if (worldObj.isRemote) renderLogic.validateConnections(); + if (worldObj.isRemote) renderLogic.validateConnections(worldObj, getPos()); } private void tryGetNeighbor(List result, FluidStack fluid, EnumFacing side) { @@ -322,6 +332,8 @@ public class TileEntityTank extends SyncedTileEntity implements IActivateAwareTi sum += n.tank.getFluidAmount(); final int suggestedAmount = sum / (count + 1); + if (Math.abs(suggestedAmount - contents.amount) < Config.tankFluidUpdateThreshold) return; // Don't balance small amounts to reduce server load + FluidStack suggestedStack = contents.copy(); suggestedStack.amount = suggestedAmount; diff --git a/src/main/java/openblocks/common/tileentity/TileEntityTarget.java b/src/main/java/openblocks/common/tileentity/TileEntityTarget.java index e6980b3e..47e68b82 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityTarget.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityTarget.java @@ -1,15 +1,20 @@ package openblocks.common.tileentity; +import com.google.common.base.Predicate; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import java.util.List; import java.util.Set; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.WorldServer; import openblocks.OpenBlocks; import openblocks.OpenBlocks.Blocks; @@ -26,10 +31,6 @@ import openmods.tileentity.SyncedTileEntity; import openmods.utils.BlockUtils; import openmods.utils.EntityUtils; -import com.google.common.base.Predicate; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - public class TileEntityTarget extends SyncedTileEntity implements ISurfaceAttachment, INeighbourAwareTile, IAddAwareTile, ITickable { private int strength = 0; @@ -80,7 +81,7 @@ public class TileEntityTarget extends SyncedTileEntity implements ISurfaceAttach List projectiles = worldObj.getEntitiesWithinAABB(Entity.class, getBB().expand(10, 10, 10), PROJECTILE_SELECTOR); for (Entity projectile : projectiles) { - MovingObjectPosition hit = EntityUtils.raytraceEntity(projectile); + RayTraceResult hit = EntityUtils.raytraceEntity(projectile); if (pos.equals(hit.getBlockPos())) { Blocks.target.onTargetHit(worldObj, pos, hit.hitVec); } @@ -132,7 +133,7 @@ public class TileEntityTarget extends SyncedTileEntity implements ISurfaceAttach if (isPowered != isEnabled()) { dropArrowsAsItems(world); - playSoundAtBlock(isPowered? "openblocks:target.open" : "openblocks:target.close", 0.5f, 1.0f); + playSoundAtBlock(isPowered? OpenBlocks.Sounds.BLOCK_TARGET_OPEN : OpenBlocks.Sounds.BLOCK_TARGET_CLOSE, 0.5f, 1.0f); setEnabled(isPowered); @@ -180,6 +181,6 @@ public class TileEntityTarget extends SyncedTileEntity implements ISurfaceAttach for (ItemStack drop : drops) BlockUtils.dropItemStackInWorld(worldObj, pos, drop); - if (failed > 0) BlockUtils.dropItemStackInWorld(worldObj, pos, new ItemStack(Items.arrow, failed)); + if (failed > 0) BlockUtils.dropItemStackInWorld(worldObj, pos, new ItemStack(Items.ARROW, failed)); } } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityTrophy.java b/src/main/java/openblocks/common/tileentity/TileEntityTrophy.java index bdc5d5b0..40a1a799 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityTrophy.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityTrophy.java @@ -1,7 +1,6 @@ package openblocks.common.tileentity; import java.util.List; - import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -11,7 +10,10 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; import openblocks.common.TrophyHandler.Trophy; import openblocks.common.item.ItemTrophyBlock; -import openmods.api.*; +import openmods.api.IActivateAwareTile; +import openmods.api.ICustomHarvestDrops; +import openmods.api.ICustomPickItem; +import openmods.api.IPlaceAwareTile; import openmods.sync.SyncableEnum; import openmods.tileentity.SyncedTileEntity; import openmods.utils.ItemUtils; @@ -73,9 +75,10 @@ public class TileEntityTrophy extends SyncedTileEntity implements IPlaceAwareTil } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); tag.setInteger("cooldown", cooldown); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityVacuumHopper.java b/src/main/java/openblocks/common/tileentity/TileEntityVacuumHopper.java index 07285692..ec9d19c2 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityVacuumHopper.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityVacuumHopper.java @@ -1,10 +1,10 @@ package openblocks.common.tileentity; +import com.google.common.base.Predicate; +import com.google.common.collect.Lists; import java.util.Collections; import java.util.List; - import javax.annotation.Nullable; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -26,7 +26,10 @@ import openblocks.common.LiquidXpUtils; import openblocks.common.container.ContainerVacuumHopper; import openblocks.common.entity.EntityItemProjectile; import openmods.OpenMods; -import openmods.api.*; +import openmods.api.IActivateAwareTile; +import openmods.api.IHasGui; +import openmods.api.INeighbourAwareTile; +import openmods.api.IValueProvider; import openmods.include.IncludeInterface; import openmods.inventory.GenericInventory; import openmods.inventory.IInventoryProvider; @@ -39,10 +42,10 @@ import openmods.sync.SyncableTank; import openmods.tileentity.SyncedTileEntity; import openmods.utils.EnchantmentUtils; import openmods.utils.SidedInventoryAdapter; -import openmods.utils.bitmap.*; - -import com.google.common.base.Predicate; -import com.google.common.collect.Lists; +import openmods.utils.bitmap.BitMapUtils; +import openmods.utils.bitmap.IReadableBitMap; +import openmods.utils.bitmap.IRpcDirectionBitMap; +import openmods.utils.bitmap.IWriteableBitMap; public class TileEntityVacuumHopper extends SyncedTileEntity implements IInventoryProvider, IActivateAwareTile, IHasGui, INeighbourAwareTile, ITickable { @@ -246,9 +249,10 @@ public class TileEntityVacuumHopper extends SyncedTileEntity implements IInvento } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityVillageHighlighter.java b/src/main/java/openblocks/common/tileentity/TileEntityVillageHighlighter.java index 1bed80d5..e1375ca8 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityVillageHighlighter.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityVillageHighlighter.java @@ -1,12 +1,11 @@ package openblocks.common.tileentity; -import java.util.ArrayList; +import com.google.common.collect.Lists; import java.util.Iterator; import java.util.List; - -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ITickable; -import net.minecraft.util.Vec3i; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.village.Village; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -43,11 +42,11 @@ public class TileEntityVillageHighlighter extends SyncedTileEntity implements IT public void update() { if (!worldObj.isRemote) { if (OpenMods.proxy.getTicks(worldObj) % 10 == 0) { - ArrayList tmpDataList = new ArrayList(); + List tmpDataList = Lists.newArrayList(); for (Village village : worldObj.villageCollectionObj.getVillageList()) { - if (village.func_179866_a(pos)) { + if (village.isBlockPosWithinSqVillageRadius(pos)) { tmpDataList.add(village.getVillageRadius()); - Vec3i d = village.getCenter().subtract(pos); + BlockPos d = village.getCenter().subtract(pos); tmpDataList.add(d.getX()); tmpDataList.add(d.getY()); tmpDataList.add(d.getZ()); @@ -93,7 +92,7 @@ public class TileEntityVillageHighlighter extends SyncedTileEntity implements IT if (worldObj.isRemote) return false; for (Village village : worldObj.villageCollectionObj.getVillageList()) { - if (village.func_179866_a(pos)) { + if (village.isBlockPosWithinSqVillageRadius(pos)) { int i = (int)(village.getNumVillageDoors() * 0.35D); if (village.getNumVillagers() < i) { return true; } } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityXPBottler.java b/src/main/java/openblocks/common/tileentity/TileEntityXPBottler.java index c7918688..1ed84797 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityXPBottler.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityXPBottler.java @@ -1,7 +1,6 @@ package openblocks.common.tileentity; import java.util.Set; - import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -19,7 +18,10 @@ import openblocks.client.gui.GuiXPBottler; import openblocks.common.LiquidXpUtils; import openblocks.common.container.ContainerXPBottler; import openblocks.common.tileentity.TileEntityXPBottler.AutoSlots; -import openmods.api.*; +import openmods.api.IHasGui; +import openmods.api.INeighbourAwareTile; +import openmods.api.IValueProvider; +import openmods.api.IValueReceiver; import openmods.gamelogic.WorkerLogic; import openmods.gui.misc.IConfigurableGuiSlots; import openmods.include.IncludeInterface; @@ -29,19 +31,25 @@ import openmods.inventory.IInventoryProvider; import openmods.inventory.TileEntityInventory; import openmods.inventory.legacy.ItemDistribution; import openmods.liquids.SidedFluidHandler; -import openmods.sync.*; +import openmods.sync.SyncableFlags; +import openmods.sync.SyncableInt; +import openmods.sync.SyncableSides; +import openmods.sync.SyncableTank; import openmods.tileentity.SyncedTileEntity; import openmods.utils.MiscUtils; import openmods.utils.SidedInventoryAdapter; -import openmods.utils.bitmap.*; +import openmods.utils.bitmap.BitMapUtils; +import openmods.utils.bitmap.IRpcDirectionBitMap; +import openmods.utils.bitmap.IRpcIntBitMap; +import openmods.utils.bitmap.IWriteableBitMap; public class TileEntityXPBottler extends SyncedTileEntity implements IInventoryProvider, IHasGui, IConfigurableGuiSlots, INeighbourAwareTile, ITickable { public static final int TANK_CAPACITY = LiquidXpUtils.xpToLiquidRatio(LiquidXpUtils.XP_PER_BOTTLE); public static final int PROGRESS_TICKS = 40; - protected static final ItemStack GLASS_BOTTLE = new ItemStack(Items.glass_bottle, 1); - protected static final ItemStack XP_BOTTLE = new ItemStack(Items.experience_bottle, 1); + protected static final ItemStack GLASS_BOTTLE = new ItemStack(Items.GLASS_BOTTLE, 1); + protected static final ItemStack XP_BOTTLE = new ItemStack(Items.EXPERIENCE_BOTTLE, 1); private boolean needsTankUpdate; @@ -60,7 +68,7 @@ public class TileEntityXPBottler extends SyncedTileEntity implements IInventoryP @Override public boolean isItemValidForSlot(int slot, ItemStack itemstack) { if (slot != Slots.input.ordinal()) return false; - return itemstack.getItem() == Items.glass_bottle; + return itemstack.getItem() == Items.GLASS_BOTTLE; } }); @@ -123,7 +131,7 @@ public class TileEntityXPBottler extends SyncedTileEntity implements IInventoryP if (logic.update()) { // this happens when the progress has completed - playSoundAtBlock("openblocks:bottler.signal", .5f, .8f); + playSoundAtBlock(OpenBlocks.Sounds.BLOCK_XPBOTTLER_DONE, 0.5f, 0.8f); inventory.decrStackSize(Slots.input.ordinal(), 1); tank.setFluid(null); @@ -204,9 +212,10 @@ public class TileEntityXPBottler extends SyncedTileEntity implements IInventoryP } @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); inventory.writeToNBT(tag); + return tag; } @Override diff --git a/src/main/java/openblocks/common/tileentity/TileEntityXPDrain.java b/src/main/java/openblocks/common/tileentity/TileEntityXPDrain.java index f57e85fd..8133737b 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityXPDrain.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityXPDrain.java @@ -2,14 +2,14 @@ package openblocks.common.tileentity; import java.lang.ref.WeakReference; import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; import openblocks.OpenBlocks; @@ -69,7 +69,7 @@ public class TileEntityXPDrain extends OpenTileEntity implements ITickable { if (finallyAcceptedLiquid <= 0) return; if (OpenMods.proxy.getTicks(worldObj) % 4 == 0) { - playSoundAtBlock("random.orb", 0.1F, 0.5F * ((worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.7F + 1.8F)); + playSoundAtBlock(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 0.1F, 0.5F * ((worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.7F + 1.8F)); } EnchantmentUtils.addPlayerXP(player, -acceptedXP); @@ -95,8 +95,8 @@ public class TileEntityXPDrain extends OpenTileEntity implements ITickable { if (!isAir) { TileEntity te = worldObj.getTileEntity(target); if (!(te instanceof IFluidHandler) && te != null) { - Block block = te.getBlockType(); - if (block.isOpaqueCube()) { return; } + final IBlockState blockState = worldObj.getBlockState(pos); + if (blockState.isOpaqueCube()) { return; } } else { targetTank = new WeakReference(te); return; diff --git a/src/main/java/openblocks/common/tileentity/TileEntityXPShower.java b/src/main/java/openblocks/common/tileentity/TileEntityXPShower.java index fd0ea689..faba34e5 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityXPShower.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityXPShower.java @@ -4,7 +4,8 @@ import net.minecraft.block.Block; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ITickable; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import openblocks.OpenBlocks; @@ -19,60 +20,73 @@ import openmods.tileentity.SyncedTileEntity; public class TileEntityXPShower extends SyncedTileEntity implements INeighbourAwareTile, IAddAwareTile, ITickable { + private static final FluidStack XP_FLUID = new FluidStack(OpenBlocks.Fluids.xpJuice, 1); + private static final int DRAIN_PER_CYCLE = 50; private GenericTank bufferTank = new GenericTank(FluidContainerRegistry.BUCKET_VOLUME, OpenBlocks.Fluids.xpJuice); - private int drainedCountdown = 0; private SyncableBoolean isOn; - private boolean isPowered = false; + private SyncableBoolean particleSpawnerActive; + private int particleSpawnTimer = 0; @Override protected void createSyncedFields() { isOn = new SyncableBoolean(); + particleSpawnerActive = new SyncableBoolean(); } @Override public void update() { if (!worldObj.isRemote) { + trySpawnXpOrbs(); + } else { + trySpawnParticles(); + } + } - if (!isPowered && OpenMods.proxy.getTicks(worldObj) % 3 == 0) { - bufferTank.fillFromSide(DRAIN_PER_CYCLE, worldObj, pos, getOrientation().north()); + private void trySpawnXpOrbs() { + boolean hasSpawnedParticle = false; + if (isOn.get() && OpenMods.proxy.getTicks(worldObj) % 3 == 0) { + bufferTank.fillFromSide(DRAIN_PER_CYCLE, worldObj, pos, getOrientation().north()); - int amountInTank = bufferTank.getFluidAmount(); + int amountInTank = bufferTank.getFluidAmount(); - if (amountInTank > 0) { + if (amountInTank > 0) { + int xpInTank = LiquidXpUtils.liquidToXpRatio(amountInTank); + int drainable = LiquidXpUtils.xpToLiquidRatio(xpInTank); - int xpInTank = LiquidXpUtils.liquidToXpRatio(amountInTank); - int drainable = LiquidXpUtils.xpToLiquidRatio(xpInTank); - - if (drainable > 0) { - - bufferTank.drain(drainable, true); - - drainedCountdown = 10; - - while (xpInTank > 0) { - int xpAmount = EntityXPOrb.getXPSplit(xpInTank); - xpInTank -= xpAmount; - worldObj.spawnEntityInWorld(new EntityXPOrbNoFly(worldObj, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, xpAmount)); - } + if (drainable > 0) { + bufferTank.drain(drainable, true); + while (xpInTank > 0) { + hasSpawnedParticle = true; + int xpAmount = EntityXPOrb.getXPSplit(xpInTank); + xpInTank -= xpAmount; + final BlockPos p = getPos(); + worldObj.spawnEntityInWorld(new EntityXPOrbNoFly(worldObj, p.getX() + 0.5D, p.getY(), p.getZ() + 0.5D, xpAmount)); } } } - - isOn.set(drainedCountdown-- > 0 && !isPowered); - sync(); - - } else if (isOn.get()) { - Vec3 vec = new Vec3( - (worldObj.rand.nextDouble() - 0.5) * 0.05, - 0, - (worldObj.rand.nextDouble() - 0.5) * 0.05); - OpenBlocks.proxy.spawnLiquidSpray(worldObj, new FluidStack(OpenBlocks.Fluids.xpJuice, 1000), pos.getX() + 0.5, pos.getY() + 0.4, pos.getZ() + 0.5, 0.4f, 0.7f, vec); - } + particleSpawnerActive.set(hasSpawnedParticle); + sync(); + } + + private void trySpawnParticles() { + final int particleLevel = OpenBlocks.proxy.getParticleSettings(); + if (particleLevel == 0 || (particleLevel == 1 && worldObj.rand.nextInt(3) == 0)) { + particleSpawnTimer = particleSpawnerActive.get()? 10 : particleSpawnTimer - 1; + + if (particleSpawnTimer > 0) { + final BlockPos p = getPos(); + Vec3d vec = new Vec3d( + (worldObj.rand.nextDouble() - 0.5) * 0.05, + 0, + (worldObj.rand.nextDouble() - 0.5) * 0.05); + OpenBlocks.proxy.spawnLiquidSpray(worldObj, XP_FLUID, p.getX() + 0.5d, p.getY() + 0.4d, p.getZ() + 0.5d, 0.4f, 0.7f, vec); + } + } } @Override @@ -86,7 +100,8 @@ public class TileEntityXPShower extends SyncedTileEntity implements INeighbourAw } public void updateState() { - isPowered = worldObj.isBlockIndirectlyGettingPowered(pos) > 0; + final int power = worldObj.isBlockIndirectlyGettingPowered(getPos()); // TODO 1.10 verify + isOn.set(power > 0); } @Override @@ -96,8 +111,9 @@ public class TileEntityXPShower extends SyncedTileEntity implements INeighbourAw } @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - bufferTank.writeToNBT(nbt); + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + tag = super.writeToNBT(tag); + bufferTank.writeToNBT(tag); + return tag; } } diff --git a/src/main/java/openblocks/enchantments/EnchantmentExplosive.java b/src/main/java/openblocks/enchantments/EnchantmentExplosive.java index 737f98a1..5f46ff87 100644 --- a/src/main/java/openblocks/enchantments/EnchantmentExplosive.java +++ b/src/main/java/openblocks/enchantments/EnchantmentExplosive.java @@ -2,11 +2,13 @@ package openblocks.enchantments; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; -import openblocks.OpenBlocks; +import net.minecraft.inventory.EntityEquipmentSlot; public final class EnchantmentExplosive extends Enchantment { - public EnchantmentExplosive(int id) { - super(id, OpenBlocks.location("explosive"), 2, EnumEnchantmentType.ARMOR); + private static final EntityEquipmentSlot[] ALL_ARMOR = new EntityEquipmentSlot[] { EntityEquipmentSlot.FEET, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.HEAD }; + + public EnchantmentExplosive() { + super(Rarity.RARE, EnumEnchantmentType.ARMOR, ALL_ARMOR); setName("openblocks.explosive"); } diff --git a/src/main/java/openblocks/enchantments/EnchantmentFlimFlam.java b/src/main/java/openblocks/enchantments/EnchantmentFlimFlam.java index 6b3b7694..245e1162 100644 --- a/src/main/java/openblocks/enchantments/EnchantmentFlimFlam.java +++ b/src/main/java/openblocks/enchantments/EnchantmentFlimFlam.java @@ -2,12 +2,18 @@ package openblocks.enchantments; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; -import openblocks.OpenBlocks; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; public class EnchantmentFlimFlam extends Enchantment { - public EnchantmentFlimFlam(int id) { - super(id, OpenBlocks.location("flimflam"), 2, EnumEnchantmentType.ALL); + private static final EntityEquipmentSlot[] ALL_ARMOR = new EntityEquipmentSlot[] { EntityEquipmentSlot.FEET, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.HEAD, EntityEquipmentSlot.MAINHAND }; + + public EnchantmentFlimFlam() { + super(Rarity.RARE, EnumEnchantmentType.ALL, ALL_ARMOR); setName("openblocks.flimflam"); } @@ -25,4 +31,11 @@ public class EnchantmentFlimFlam extends Enchantment { public int getMaxEnchantability(int level) { return getMinEnchantability(level) + 10; } + + @Override + public boolean canApplyAtEnchantingTable(ItemStack stack) { + final Item item = stack.getItem(); + return (item instanceof ItemArmor) || (item instanceof ItemSword); + } + } diff --git a/src/main/java/openblocks/enchantments/EnchantmentLastStand.java b/src/main/java/openblocks/enchantments/EnchantmentLastStand.java index b5f6b83f..78dc95e1 100644 --- a/src/main/java/openblocks/enchantments/EnchantmentLastStand.java +++ b/src/main/java/openblocks/enchantments/EnchantmentLastStand.java @@ -2,12 +2,13 @@ package openblocks.enchantments; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; -import openblocks.OpenBlocks; +import net.minecraft.inventory.EntityEquipmentSlot; public class EnchantmentLastStand extends Enchantment { + private static final EntityEquipmentSlot[] ALL_ARMOR = new EntityEquipmentSlot[] { EntityEquipmentSlot.FEET, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.HEAD }; - public EnchantmentLastStand(int id) { - super(id, OpenBlocks.location("laststand"), 2, EnumEnchantmentType.ARMOR); + public EnchantmentLastStand() { + super(Rarity.UNCOMMON, EnumEnchantmentType.ARMOR, ALL_ARMOR); setName("openblocks.laststand"); } diff --git a/src/main/java/openblocks/enchantments/ExplosiveEnchantmentsHandler.java b/src/main/java/openblocks/enchantments/ExplosiveEnchantmentsHandler.java index cc90c344..2636fb19 100644 --- a/src/main/java/openblocks/enchantments/ExplosiveEnchantmentsHandler.java +++ b/src/main/java/openblocks/enchantments/ExplosiveEnchantmentsHandler.java @@ -1,7 +1,11 @@ package openblocks.enchantments; -import java.util.*; - +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.MapMaker; +import java.util.List; +import java.util.Map; +import java.util.Set; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraft.enchantment.EnchantmentHelper; @@ -10,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Items; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; @@ -22,21 +27,12 @@ import openblocks.Config; import openblocks.OpenBlocks.Enchantments; import openmods.OpenMods; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.MapMaker; - public class ExplosiveEnchantmentsHandler { - public static final int ARMOR_HELMET = 3; - public static final int ARMOR_CHESTPIECE = 2; - public static final int ARMOR_PANTS = 1; - public static final int ARMOR_BOOTS = 0; - - private final List protectionParts = Lists.newArrayList(ARMOR_CHESTPIECE, ARMOR_HELMET, ARMOR_PANTS); - private static final double VERTICAL_FACTOR = 5; + private final List protectionParts = Lists.newArrayList(EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.HEAD); + private static final Set ALLOWED_DAMAGE_SOURCE = ImmutableSet.of("arrow", "player", "mob"); private static class EnchantmentLevel { @@ -74,7 +70,6 @@ public class ExplosiveEnchantmentsHandler { } private final static EnchantmentLevel LEVELS[] = new EnchantmentLevel[] { - null, // 1-based new EnchantmentLevel(0.10, 5, 5, 1, false, 1), new EnchantmentLevel(0.75, 7.5, 10, 2, false, 2), new EnchantmentLevel(1.00, 10, 5, 4, Config.explosiveEnchantGrief, 4) @@ -106,38 +101,34 @@ public class ExplosiveEnchantmentsHandler { private Map jumpBoosts = new MapMaker().weakKeys().makeMap(); - private static final ItemStack gunpowder = new ItemStack(Items.gunpowder); + private static final ItemStack gunpowder = new ItemStack(Items.GUNPOWDER); - private static void useItems(EntityPlayer player, int gunpowderSlot, int armorSlot, int gunpowderAmout) { + private static void useItems(EntityPlayer player, int gunpowderSlot, EntityEquipmentSlot armorSlot, int gunpowderAmout) { if (player.capabilities.isCreativeMode) return; - final InventoryPlayer inventory = player.inventory; - - ItemStack armor = inventory.armorItemInSlot(armorSlot); + ItemStack armor = player.getItemStackFromSlot(armorSlot); armor.damageItem(1, player); - if (armor.stackSize <= 0) inventory.armorInventory[armorSlot] = null; + if (armor.stackSize <= 0) player.setItemStackToSlot(armorSlot, null); + final InventoryPlayer inventory = player.inventory; ItemStack resource = inventory.mainInventory[gunpowderSlot]; resource.stackSize -= gunpowderAmout; if (resource.stackSize <= 0) inventory.mainInventory[gunpowderSlot] = null; } - private static EnchantmentLevel tryUseEnchantment(EntityPlayer player, int armorSlot) { - final InventoryPlayer inventory = player.inventory; - - ItemStack armor = inventory.armorInventory[armorSlot]; + private static EnchantmentLevel tryUseEnchantment(EntityPlayer player, EntityEquipmentSlot slot) { + ItemStack armor = player.getItemStackFromSlot(slot); if (armor == null || !(armor.getItem() instanceof ItemArmor)) return null; - Map enchantments = EnchantmentHelper.getEnchantments(armor); - Integer ench = enchantments.get(Enchantments.explosive.effectId); - if (ench == null || ench >= LEVELS.length) return null; - EnchantmentLevel level = LEVELS[ench]; - if (level == null) return null; + final InventoryPlayer inventory = player.inventory; + int explosiveLevel = EnchantmentHelper.getEnchantmentLevel(Enchantments.explosive, armor); + if (explosiveLevel <= 0 || explosiveLevel >= LEVELS.length - 1) return null; + EnchantmentLevel level = LEVELS[explosiveLevel - 1]; for (int i = 0; i < inventory.mainInventory.length; i++) { ItemStack stack = inventory.mainInventory[i]; if (stack != null && gunpowder.isItemEqual(stack) && stack.stackSize >= level.gunpowderNeeded) { - useItems(player, i, armorSlot, level.gunpowderNeeded); + useItems(player, i, slot, level.gunpowderNeeded); return level; } } @@ -146,8 +137,7 @@ public class ExplosiveEnchantmentsHandler { } private EnchantmentLevel tryUseUpperArmor(EntityPlayer player) { - Collections.shuffle(protectionParts); - for (int armorPart : protectionParts) { + for (EntityEquipmentSlot armorPart : protectionParts) { EnchantmentLevel result = tryUseEnchantment(player, armorPart); if (result != null) return result; } @@ -157,13 +147,13 @@ public class ExplosiveEnchantmentsHandler { @SubscribeEvent public void onFall(LivingFallEvent evt) { - final Entity e = evt.entityLiving; - if (evt.distance > 4 && !e.isSneaking() && e instanceof EntityPlayer) { + final Entity e = evt.getEntityLiving(); + if (evt.getDistance() > 4 && !e.isSneaking() && e instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)e; - EnchantmentLevel level = tryUseEnchantment(player, ARMOR_BOOTS); + EnchantmentLevel level = tryUseEnchantment(player, EntityEquipmentSlot.LEGS); if (level == null) return; - JumpInfo boost = new JumpInfo(level, evt.distance); + JumpInfo boost = new JumpInfo(level, evt.getDistance()); level.createJumpExplosion(player); if (OpenMods.proxy.isClientPlayer(player)) { // And Now, Ladies and Gentlemen! @@ -171,6 +161,7 @@ public class ExplosiveEnchantmentsHandler { // Loved By Everyone... // Possibly Buggy // TEEERRRRRIIIIBLE HAAAAAACK! + // TODO 1.10 maybe now stuff is betten? KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindJump.getKeyCode(), true); // no, seriously, can't find better way to make jump jumpBoosts.put(player, boost); @@ -181,7 +172,7 @@ public class ExplosiveEnchantmentsHandler { @SubscribeEvent public void onJump(LivingJumpEvent e) { - final Entity entity = e.entity; + final Entity entity = e.getEntity(); JumpInfo boost = jumpBoosts.remove(entity); if (boost != null) { boost.modifyVelocity(entity); @@ -198,8 +189,8 @@ public class ExplosiveEnchantmentsHandler { @SubscribeEvent public void onDamage(LivingAttackEvent e) { - final Entity victim = e.entity; - if (victim instanceof EntityPlayerMP && checkSource(e.source)) { + final Entity victim = e.getEntity(); + if (victim instanceof EntityPlayerMP && checkSource(e.getSource())) { EnchantmentLevel level = tryUseUpperArmor(((EntityPlayer)victim)); if (level != null) level.createArmorExplosion(victim); diff --git a/src/main/java/openblocks/enchantments/FlimFlamEnchantmentsHandler.java b/src/main/java/openblocks/enchantments/FlimFlamEnchantmentsHandler.java index ac74f7cb..9748cf53 100644 --- a/src/main/java/openblocks/enchantments/FlimFlamEnchantmentsHandler.java +++ b/src/main/java/openblocks/enchantments/FlimFlamEnchantmentsHandler.java @@ -1,37 +1,45 @@ package openblocks.enchantments; -import java.util.*; - +import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; +import javax.annotation.Nullable; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.world.World; -import net.minecraftforge.common.IExtendedEntityProperties; -import net.minecraftforge.event.entity.EntityEvent; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import openblocks.OpenBlocks; import openblocks.OpenBlocks.Enchantments; import openblocks.api.IFlimFlamDescription; import openblocks.enchantments.flimflams.FlimFlamRegistry; import openmods.Log; -import com.google.common.collect.Lists; - public class FlimFlamEnchantmentsHandler { - public static final String LUCK_PROPERTY = "OpenBlocks-Luck"; - public static final int LUCK_MARGIN = -30; public static final int EFFECT_DELAY = 20 * 15; // 15s cooldown private static final Random RANDOM = new Random(); - private static class Luck implements IExtendedEntityProperties { + private static class Luck { public int luck; @@ -39,39 +47,69 @@ public class FlimFlamEnchantmentsHandler { public boolean forceNext; - @Override - public void saveNBTData(NBTTagCompound entityTag) { - entityTag.setInteger(LUCK_PROPERTY, luck); - } + } - @Override - public void loadNBTData(NBTTagCompound entityTag) { - luck = entityTag.getInteger(LUCK_PROPERTY); - } + private static final ResourceLocation CAPABILITY_KEY = OpenBlocks.location("luck"); - @Override - public void init(Entity entity, World world) {} + @CapabilityInject(Luck.class) + private static Capability CAPABILITY; + + public static void registerCapability() { + CapabilityManager.INSTANCE.register(Luck.class, new Capability.IStorage() { + @Override + public NBTBase writeNBT(Capability capability, Luck instance, EnumFacing side) { + return new NBTTagInt(instance.luck); + } + + @Override + public void readNBT(Capability capability, Luck instance, EnumFacing side, NBTBase nbt) { + instance.luck = ((NBTTagInt)nbt).getInt(); + } + + }, new Callable() { + @Override + public Luck call() throws Exception { + return new Luck(); + } + }); } private static Luck getProperty(Entity entity) { - IExtendedEntityProperties prop = entity.getExtendedProperties(LUCK_PROPERTY); - return (prop instanceof Luck)? (Luck)prop : null; + return entity.getCapability(CAPABILITY, EnumFacing.UP); } @SubscribeEvent - public void onEntityConstruct(EntityEvent.EntityConstructing evt) { - if (evt.entity instanceof EntityPlayer) evt.entity.registerExtendedProperties(LUCK_PROPERTY, new Luck()); + public void attachCapability(AttachCapabilitiesEvent evt) { + if (evt.getObject() instanceof EntityPlayer) { + evt.addCapability(CAPABILITY_KEY, new ICapabilityProvider() { + + private final Luck state = new Luck(); + + @Override + public boolean hasCapability(Capability capability, @Nullable EnumFacing facing) { + return capability == CAPABILITY; + } + + @Override + @SuppressWarnings("unchecked") + public T getCapability(Capability capability, @Nullable EnumFacing facing) { + if (capability == CAPABILITY) return (T)state; + return null; + } + }); + } } @SubscribeEvent public void onDamage(LivingHurtEvent e) { - if (!(e.entityLiving instanceof EntityPlayer)) return; - if (e.entityLiving.worldObj.isRemote) return; + final EntityLivingBase entityLiving = e.getEntityLiving(); + if (!(entityLiving instanceof EntityPlayer)) return; + if (entityLiving.worldObj.isRemote) return; - final EntityPlayer targetPlayer = (EntityPlayer)e.entityLiving; + final EntityPlayer targetPlayer = (EntityPlayer)entityLiving; - if (e.source == null) return; - final Entity damageSource = e.source.getEntity(); + if (e.getSource() == null) return; + final Entity damageSource = e.getSource().getEntity(); if (!(damageSource instanceof EntityPlayer)) return; final EntityPlayer sourcePlayer = (EntityPlayer)damageSource; @@ -146,7 +184,7 @@ public class FlimFlamEnchantmentsHandler { if (effectMeta.action().execute(player)) { property.luck -= effectMeta.cost(); Log.debug("Player %s flim-flammed with %s, current luck: %s", player, effectMeta.name(), property.luck); - if (!effectMeta.isSilent()) player.addChatMessage(new ChatComponentTranslation("openblocks.flim_flammed")); + if (!effectMeta.isSilent()) player.addChatMessage(new TextComponentTranslation("openblocks.flim_flammed")); return; } } catch (Throwable t) { @@ -187,21 +225,14 @@ public class FlimFlamEnchantmentsHandler { } private static int getFlimFlamToolLevel(EntityPlayer player) { - return getFlimFlamLevel(player.getHeldItem()); + return EnchantmentHelper.getEnchantmentLevel(Enchantments.flimFlam, player.getHeldItemMainhand()); } private static int getFlimFlamArmorLevel(EntityPlayer player) { int sum = 0; for (ItemStack stack : player.inventory.armorInventory) { - sum += getFlimFlamLevel(stack); + sum += EnchantmentHelper.getEnchantmentLevel(Enchantments.flimFlam, stack); } return sum; } - - private static int getFlimFlamLevel(ItemStack stack) { - if (stack == null) return 0; - Map enchantments = EnchantmentHelper.getEnchantments(stack); - Integer result = enchantments.get(Enchantments.flimFlam.effectId); - return result != null? result : 0; - } } diff --git a/src/main/java/openblocks/enchantments/LastStandEnchantmentsHandler.java b/src/main/java/openblocks/enchantments/LastStandEnchantmentsHandler.java index 5b14e272..12779b36 100644 --- a/src/main/java/openblocks/enchantments/LastStandEnchantmentsHandler.java +++ b/src/main/java/openblocks/enchantments/LastStandEnchantmentsHandler.java @@ -1,66 +1,91 @@ package openblocks.enchantments; -import java.util.Map; - +import com.google.common.base.Supplier; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import openblocks.Config; import openblocks.OpenBlocks.Enchantments; +import openmods.calc.Environment; +import openmods.calc.ExprType; +import openmods.calc.SingleExprEvaluator; +import openmods.calc.SingleExprEvaluator.EnvironmentConfigurator; +import openmods.calc.types.fp.DoubleCalculatorFactory; +import openmods.config.properties.ConfigurationChange; +import openmods.entity.PlayerDamageEvent; import openmods.utils.EnchantmentUtils; public class LastStandEnchantmentsHandler { - @SubscribeEvent(priority = EventPriority.LOW) - public void onHurt(LivingHurtEvent e) { + private static final String VAR_ENCH_LEVEL = "ench"; + private static final String VAR_PLAYER_XP = "xp"; + private static final String VAR_PLAYER_HP = "hp"; + private static final String VAR_DAMAGE = "dmg"; - if (e.entityLiving instanceof EntityPlayer) { + private final SingleExprEvaluator reductionCalculator = SingleExprEvaluator.create(DoubleCalculatorFactory.createDefault()); - EntityPlayer player = (EntityPlayer)e.entityLiving; + { + updateReductionFormula(); + } - int enchantmentLevels = countLastStandEnchantmentLevels(player); + @SubscribeEvent + public void onConfigChange(ConfigurationChange.Post evt) { + if (evt.check("features", "lastStandFormula")) + updateReductionFormula(); + } - if (enchantmentLevels > 0) { + private void updateReductionFormula() { + reductionCalculator.setExpr(ExprType.INFIX, Config.lastStandEnchantmentFormula); + } - float healthAvailable = player.getHealth(); - healthAvailable -= e.ammount; + @SubscribeEvent + public void onHurt(final PlayerDamageEvent e) { + final int enchantmentLevels = countLastStandEnchantmentLevels(e.player); - if (healthAvailable < 1f) { + if (enchantmentLevels > 0) { + final float playerHealth = e.player.getHealth(); + final float healthAvailable = playerHealth - e.amount; - int xpAvailable = EnchantmentUtils.getPlayerXP(player); + if (healthAvailable < 1f) { + final int xpAvailable = EnchantmentUtils.getPlayerXP(e.player); - float xpRequired = 1f - healthAvailable; + float xpRequired = reductionCalculator.evaluate( + new EnvironmentConfigurator() { + @Override + public void accept(Environment env) { + env.setGlobalSymbol(VAR_ENCH_LEVEL, Double.valueOf(enchantmentLevels)); + env.setGlobalSymbol(VAR_PLAYER_XP, Double.valueOf(xpAvailable)); + env.setGlobalSymbol(VAR_PLAYER_HP, Double.valueOf(playerHealth)); + env.setGlobalSymbol(VAR_DAMAGE, Double.valueOf(e.amount)); + } + }, + new Supplier() { + @Override + public Double get() { + float xpRequired = 1f - healthAvailable; + xpRequired *= 50; + xpRequired /= enchantmentLevels; + xpRequired = Math.max(1, xpRequired); + return Double.valueOf(xpRequired); + } + }).floatValue(); - xpRequired *= 50; - xpRequired /= enchantmentLevels; - xpRequired = Math.max(1, xpRequired); - - if (xpAvailable >= xpRequired) { - player.setHealth(1f); - EnchantmentUtils.addPlayerXP(player, -(int)xpRequired); - e.ammount = 0; - e.setCanceled(true); - } + if (xpAvailable >= xpRequired) { + e.player.setHealth(1f); + EnchantmentUtils.addPlayerXP(e.player, -(int)xpRequired); + e.amount = 0; + e.setCanceled(true); } } - } } public static int countLastStandEnchantmentLevels(EntityPlayer player) { if (player != null) { int count = 0; - for (ItemStack stack : player.inventory.armorInventory) { - if (stack != null) { - Map enchantments = EnchantmentHelper.getEnchantments(stack); - Integer ench = enchantments.get(Enchantments.lastStand.effectId); - if (ench != null) { - count += ench; - } - } - } + for (ItemStack stack : player.inventory.armorInventory) + count += EnchantmentHelper.getEnchantmentLevel(Enchantments.lastStand, stack); return count; } return 0; diff --git a/src/main/java/openblocks/enchantments/flimflams/BaneFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/BaneFlimFlam.java index fa85792c..85c81eae 100644 --- a/src/main/java/openblocks/enchantments/flimflams/BaneFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/BaneFlimFlam.java @@ -1,7 +1,7 @@ package openblocks.enchantments.flimflams; -import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Enchantments; import net.minecraft.item.ItemStack; import openblocks.api.IFlimFlamAction; @@ -11,7 +11,7 @@ public class BaneFlimFlam implements IFlimFlamAction { public boolean execute(EntityPlayerMP target) { for (ItemStack stack : target.inventory.mainInventory) { if (stack != null && stack.getMaxStackSize() == 1 && !stack.isItemEnchantable() && !stack.isItemEnchanted()) { - stack.addEnchantment(Enchantment.baneOfArthropods, 5); + stack.addEnchantment(Enchantments.BANE_OF_ARTHROPODS, 5); return true; } } diff --git a/src/main/java/openblocks/enchantments/flimflams/DummyCreepersFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/DummyCreepersFlimFlam.java index 5dfcb102..ac91cbb3 100644 --- a/src/main/java/openblocks/enchantments/flimflams/DummyCreepersFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/DummyCreepersFlimFlam.java @@ -1,21 +1,20 @@ package openblocks.enchantments.flimflams; +import com.google.common.base.Throwables; import java.util.Random; - -import net.minecraft.entity.DataWatcher; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.EntityDataManager; import openblocks.api.IFlimFlamAction; import openmods.reflection.FieldAccess; -import com.google.common.base.Throwables; - public class DummyCreepersFlimFlam implements IFlimFlamAction { private static final Random random = new Random(); private static final FieldAccess EXPLOSION_RADIUS = FieldAccess.create(EntityCreeper.class, "explosionRadius", "field_82226_g"); - private static final FieldAccess DATA_WATCHER = FieldAccess.create(EntityCreeper.class, "dataWatcher", "field_70180_af"); + private static final FieldAccess> POWERED_DATA_PARAMETER = FieldAccess.create(EntityCreeper.class, "POWERED", "field_184714_b"); @Override public boolean execute(EntityPlayerMP target) { @@ -24,8 +23,8 @@ public class DummyCreepersFlimFlam implements IFlimFlamAction { EntityCreeper creeper = new EntityCreeper(target.worldObj); try { EXPLOSION_RADIUS.set(creeper, 0); - DataWatcher watcher = DATA_WATCHER.get(creeper); - watcher.updateObject(17, (byte)1); // Powered + EntityDataManager watcher = creeper.getDataManager(); + watcher.set(POWERED_DATA_PARAMETER.get(null), true); } catch (Throwable t) { throw Throwables.propagate(t); } diff --git a/src/main/java/openblocks/enchantments/flimflams/EffectFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/EffectFlimFlam.java index ceefdb00..9b2a232b 100644 --- a/src/main/java/openblocks/enchantments/flimflams/EffectFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/EffectFlimFlam.java @@ -1,16 +1,15 @@ package openblocks.enchantments.flimflams; +import com.google.common.collect.Lists; import java.util.Collections; import java.util.List; import java.util.Random; - import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.MobEffects; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import openblocks.api.IFlimFlamAction; -import com.google.common.collect.Lists; - public class EffectFlimFlam implements IFlimFlamAction { private static final Random RANDOM = new Random(); @@ -18,13 +17,15 @@ public class EffectFlimFlam implements IFlimFlamAction { private final List EFFECTS = Lists.newArrayList(); { - EFFECTS.add(new EffectMeta(Potion.blindness, 1, 1, seconds(15), seconds(60))); - EFFECTS.add(new EffectMeta(Potion.confusion, 1, 1, seconds(15), seconds(60))); - EFFECTS.add(new EffectMeta(Potion.digSlowdown, 50, 100, seconds(15), seconds(60))); + EFFECTS.add(new EffectMeta(MobEffects.BLINDNESS, 1, 1, seconds(15), seconds(60))); + EFFECTS.add(new EffectMeta(MobEffects.NAUSEA, 1, 1, seconds(15), seconds(60))); + EFFECTS.add(new EffectMeta(MobEffects.MINING_FATIGUE, 50, 100, seconds(15), seconds(60))); - EFFECTS.add(new EffectMeta(Potion.jump, 30, 50, seconds(5), seconds(15))); - EFFECTS.add(new EffectMeta(Potion.moveSpeed, 50, 100, seconds(5), seconds(15))); - EFFECTS.add(new EffectMeta(Potion.moveSlowdown, 4, 7, seconds(5), seconds(15))); + EFFECTS.add(new EffectMeta(MobEffects.JUMP_BOOST, 30, 50, seconds(5), seconds(15))); + EFFECTS.add(new EffectMeta(MobEffects.SPEED, 50, 100, seconds(5), seconds(15))); + EFFECTS.add(new EffectMeta(MobEffects.SLOWNESS, 4, 7, seconds(5), seconds(15))); + + EFFECTS.add(new EffectMeta(MobEffects.LEVITATION, 1, 1, seconds(5), seconds(15))); } private static int seconds(int s) { @@ -32,14 +33,14 @@ public class EffectFlimFlam implements IFlimFlamAction { } private static class EffectMeta { - public final int potionId; + public final Potion potion; public final int levelMin; public final int levelRange; public final int durationMin; public final int durationRange; public EffectMeta(Potion potion, int levelMin, int levelMax, int durationMin, int durationMax) { - this.potionId = potion.id; + this.potion = potion; this.levelMin = levelMin; this.levelRange = levelMax - levelMin + 1; this.durationMin = durationMin; @@ -55,7 +56,7 @@ public class EffectFlimFlam implements IFlimFlamAction { EffectMeta selected = EFFECTS.get(i); int duration = selected.durationMin + RANDOM.nextInt(selected.durationRange); int level = selected.levelMin + RANDOM.nextInt(selected.levelRange); - target.addPotionEffect(new PotionEffect(selected.potionId, duration, level)); + target.addPotionEffect(new PotionEffect(selected.potion, duration, level)); } return true; } diff --git a/src/main/java/openblocks/enchantments/flimflams/EncaseFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/EncaseFlimFlam.java index a193d22a..850b2fe9 100644 --- a/src/main/java/openblocks/enchantments/flimflams/EncaseFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/EncaseFlimFlam.java @@ -2,8 +2,8 @@ package openblocks.enchantments.flimflams; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import openblocks.api.IFlimFlamAction; public class EncaseFlimFlam implements IFlimFlamAction { @@ -25,7 +25,7 @@ public class EncaseFlimFlam implements IFlimFlamAction { final BlockPos pos = new BlockPos(x, y, z); if (!isGap && target.worldObj.isAirBlock(pos)) { - target.worldObj.setBlockState(pos, Blocks.dirt.getDefaultState()); + target.worldObj.setBlockState(pos, Blocks.DIRT.getDefaultState()); } } } @@ -33,10 +33,10 @@ public class EncaseFlimFlam implements IFlimFlamAction { final BlockPos torchPos = new BlockPos(playerX, playerY + 2, playerZ); boolean doTorch = target.worldObj.isAirBlock(torchPos) && - Blocks.torch.canPlaceBlockAt(target.worldObj, torchPos); + Blocks.TORCH.canPlaceBlockAt(target.worldObj, torchPos); if (doTorch) { - target.worldObj.setBlockState(torchPos, Blocks.torch.getDefaultState()); + target.worldObj.setBlockState(torchPos, Blocks.TORCH.getDefaultState()); } return true; diff --git a/src/main/java/openblocks/enchantments/flimflams/FlimFlamRegistry.java b/src/main/java/openblocks/enchantments/flimflams/FlimFlamRegistry.java index bde85abe..cccb54b5 100644 --- a/src/main/java/openblocks/enchantments/flimflams/FlimFlamRegistry.java +++ b/src/main/java/openblocks/enchantments/flimflams/FlimFlamRegistry.java @@ -1,17 +1,24 @@ package openblocks.enchantments.flimflams; -import java.util.*; - +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import openblocks.Config; -import openblocks.api.*; +import openblocks.api.FlimFlamDescriptionSimple; +import openblocks.api.IFlimFlamAction; +import openblocks.api.IFlimFlamDescription; +import openblocks.api.IFlimFlamRegistry; import openmods.Log; import openmods.access.ApiSingleton; import openmods.config.properties.ConfigurationChange; -import com.google.common.collect.*; - @ApiSingleton public class FlimFlamRegistry implements IFlimFlamRegistry { diff --git a/src/main/java/openblocks/enchantments/flimflams/InventoryShuffleFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/InventoryShuffleFlimFlam.java index 83781e79..a26ad245 100644 --- a/src/main/java/openblocks/enchantments/flimflams/InventoryShuffleFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/InventoryShuffleFlimFlam.java @@ -2,8 +2,6 @@ package openblocks.enchantments.flimflams; import java.util.Arrays; import java.util.Collections; -import java.util.List; - import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.ContainerPlayer; import net.minecraft.item.ItemStack; @@ -15,9 +13,8 @@ public class InventoryShuffleFlimFlam implements IFlimFlamAction { public boolean execute(EntityPlayerMP target) { if (target.openContainer != null && !(target.openContainer instanceof ContainerPlayer)) return false; final ItemStack[] mainInventory = target.inventory.mainInventory; - List stacks = Arrays.asList(mainInventory); - Collections.shuffle(stacks); - target.inventory.mainInventory = stacks.toArray(mainInventory); + Collections.shuffle(Arrays.asList(mainInventory)); + return true; } diff --git a/src/main/java/openblocks/enchantments/flimflams/InvisibleMobsFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/InvisibleMobsFlimFlam.java index e5dc1c8d..a346cb22 100644 --- a/src/main/java/openblocks/enchantments/flimflams/InvisibleMobsFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/InvisibleMobsFlimFlam.java @@ -2,12 +2,11 @@ package openblocks.enchantments.flimflams; import java.util.List; import java.util.Random; - import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.potion.Potion; +import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import openblocks.api.IFlimFlamAction; import openmods.utils.WorldUtils; @@ -27,7 +26,7 @@ public class InvisibleMobsFlimFlam implements IFlimFlamAction { if (mobs.isEmpty()) return false; for (EntityLiving e : mobs) { - if (random.nextFloat() < 0.3) e.addPotionEffect(new PotionEffect(Potion.invisibility.id, MIN_10, 1)); + if (random.nextFloat() < 0.3) e.addPotionEffect(new PotionEffect(MobEffects.INVISIBILITY, MIN_10, 1)); } return true; diff --git a/src/main/java/openblocks/enchantments/flimflams/ItemDropFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/ItemDropFlimFlam.java index 0e7ea123..df06c8bb 100644 --- a/src/main/java/openblocks/enchantments/flimflams/ItemDropFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/ItemDropFlimFlam.java @@ -1,7 +1,6 @@ package openblocks.enchantments.flimflams; import java.util.Random; - import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -28,7 +27,7 @@ public class ItemDropFlimFlam implements IFlimFlamAction { ItemStack stack = inv.getStackInSlot(slot); if (stack == null || random.nextFloat() > 0.5f) return false; - target.dropPlayerItemWithRandomChoice(inv.decrStackSize(slot, 1), true); + target.dropItem(inv.decrStackSize(slot, 1), true); return true; } diff --git a/src/main/java/openblocks/enchantments/flimflams/LoreFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/LoreFlimFlam.java index 6a71ed42..78a9c017 100644 --- a/src/main/java/openblocks/enchantments/flimflams/LoreFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/LoreFlimFlam.java @@ -1,16 +1,26 @@ package openblocks.enchantments.flimflams; +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; import java.util.Collections; import java.util.List; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.*; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemShears; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.common.util.Constants; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -18,24 +28,20 @@ import openblocks.Config; import openblocks.api.IFlimFlamAction; import openblocks.rubbish.LoreGenerator; import openmods.utils.ItemUtils; - +import openmods.utils.TranslationUtils; import org.lwjgl.input.Keyboard; -import com.google.common.base.Joiner; -import com.google.common.base.Splitter; -import com.google.common.collect.Lists; - public class LoreFlimFlam implements IFlimFlamAction { public static final String TAG_NAME = "SillyLore"; - public static final String LORE_FORMAT = EnumChatFormatting.GREEN + "" + EnumChatFormatting.ITALIC; + public static final String LORE_FORMAT = TextFormatting.GREEN + "" + TextFormatting.ITALIC; public static class DisplayHandler { @SubscribeEvent public void onItemTooltip(ItemTooltipEvent evt) { if (Config.loreDisplay > 0) { - final NBTTagCompound itemTag = evt.itemStack.getTagCompound(); + final NBTTagCompound itemTag = evt.getItemStack().getTagCompound(); if (itemTag != null) { if (itemTag.hasKey("display", Constants.NBT.TAG_COMPOUND)) { final NBTTagCompound displayTag = itemTag.getCompoundTag("display"); @@ -47,9 +53,9 @@ public class LoreFlimFlam implements IFlimFlamAction { Keyboard.isKeyDown(Keyboard.KEY_LMENU) || Keyboard.isKeyDown(Keyboard.KEY_RMENU)) { for (int i = 0; i < sillyLore.tagCount(); i++) - evt.toolTip.add(LORE_FORMAT + sillyLore.getStringTagAt(i)); + evt.getToolTip().add(LORE_FORMAT + sillyLore.getStringTagAt(i)); } else { - evt.toolTip.add(StatCollector.translateToLocal("openblocks.misc.hidden_lore")); + evt.getToolTip().add(TranslationUtils.translateToLocal("openblocks.misc.hidden_lore")); } } } @@ -60,20 +66,17 @@ public class LoreFlimFlam implements IFlimFlamAction { @Override public boolean execute(EntityPlayerMP target) { - List slots = Lists.newArrayList(0, 1, 2, 3, 4); + List slots = Lists.newArrayList(EntityEquipmentSlot.values()); Collections.shuffle(slots); - for (int slot : slots) + for (EntityEquipmentSlot slot : slots) if (tryAddLore(target, slot)) return true; return false; } - private static boolean tryAddLore(EntityPlayer target, int slot) { - final ItemStack item; - - if (slot == 4) item = target.getHeldItem(); - else item = target.inventory.armorInventory[slot]; + private static boolean tryAddLore(EntityPlayer target, EntityEquipmentSlot slot) { + final ItemStack item = target.getItemStackFromSlot(slot); if (item == null) return false; @@ -118,14 +121,16 @@ public class LoreFlimFlam implements IFlimFlamAction { Item item = stack.getItem(); if (item instanceof ItemArmor) { switch (((ItemArmor)item).armorType) { - case 0: + case HEAD: return "helmet"; - case 1: + case CHEST: return "chestplate"; - case 2: + case LEGS: return "leggings"; - case 3: + case FEET: return "boots"; + default: + break; } } else if (item instanceof ItemPickaxe) return "pickaxe"; else if (item instanceof ItemShears) return "shears"; diff --git a/src/main/java/openblocks/enchantments/flimflams/MountFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/MountFlimFlam.java index 739f9b03..bc3e3bf9 100644 --- a/src/main/java/openblocks/enchantments/flimflams/MountFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/MountFlimFlam.java @@ -1,18 +1,16 @@ package openblocks.enchantments.flimflams; +import com.google.common.base.Predicate; import java.util.List; - import net.minecraft.entity.EntityLiving; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.passive.EntitySquid; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import openblocks.api.IFlimFlamAction; import openmods.utils.CollectionUtils; -import com.google.common.base.Predicate; - public class MountFlimFlam implements IFlimFlamAction { private static final Predicate SAFE_SELECTOR = new Predicate() { @@ -30,8 +28,7 @@ public class MountFlimFlam implements IFlimFlamAction { List mobs = world.getEntitiesWithinAABB(EntityLiving.class, around, SAFE_SELECTOR); if (mobs.isEmpty()) return false; EntityLiving selected = CollectionUtils.getRandom(mobs); - target.mountEntity(selected); - return true; + return target.startRiding(selected); } } diff --git a/src/main/java/openblocks/enchantments/flimflams/RenameFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/RenameFlimFlam.java index da708225..2c5f177f 100644 --- a/src/main/java/openblocks/enchantments/flimflams/RenameFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/RenameFlimFlam.java @@ -1,20 +1,17 @@ package openblocks.enchantments.flimflams; +import com.google.common.base.Strings; import java.util.Collections; import java.util.List; - import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import openblocks.api.IFlimFlamAction; import openblocks.rubbish.LoreGenerator; import openmods.utils.WorldUtils; - import org.apache.commons.lang3.StringUtils; -import com.google.common.base.Strings; - public class RenameFlimFlam implements IFlimFlamAction { @Override diff --git a/src/main/java/openblocks/enchantments/flimflams/SheepDyeFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/SheepDyeFlimFlam.java index dadd0d7d..b2f92374 100644 --- a/src/main/java/openblocks/enchantments/flimflams/SheepDyeFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/SheepDyeFlimFlam.java @@ -3,11 +3,10 @@ package openblocks.enchantments.flimflams; import java.util.Arrays; import java.util.List; import java.util.Random; - import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import openblocks.api.IFlimFlamAction; import openmods.utils.CollectionUtils; diff --git a/src/main/java/openblocks/enchantments/flimflams/SkyblockFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/SkyblockFlimFlam.java index cd5a0670..192e456e 100644 --- a/src/main/java/openblocks/enchantments/flimflams/SkyblockFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/SkyblockFlimFlam.java @@ -3,8 +3,8 @@ package openblocks.enchantments.flimflams; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.api.IFlimFlamAction; @@ -27,7 +27,7 @@ public class SkyblockFlimFlam implements IFlimFlamAction { for (BlockPos pos : blocks) if (!world.isAirBlock(pos)) return false; - final IBlockState state = Blocks.ice.getDefaultState(); + final IBlockState state = Blocks.ICE.getDefaultState(); for (BlockPos pos : blocks) world.setBlockState(pos, state); diff --git a/src/main/java/openblocks/enchantments/flimflams/SnowballsFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/SnowballsFlimFlam.java index 80ac4a67..c69c35fe 100644 --- a/src/main/java/openblocks/enchantments/flimflams/SnowballsFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/SnowballsFlimFlam.java @@ -1,7 +1,6 @@ package openblocks.enchantments.flimflams; import java.util.Random; - import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntitySnowball; import net.minecraft.world.World; diff --git a/src/main/java/openblocks/enchantments/flimflams/SoundFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/SoundFlimFlam.java index 76c49a4d..4ac3b494 100644 --- a/src/main/java/openblocks/enchantments/flimflams/SoundFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/SoundFlimFlam.java @@ -1,35 +1,37 @@ package openblocks.enchantments.flimflams; +import com.google.common.collect.ImmutableList; import java.util.List; - import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.init.SoundEvents; +import net.minecraft.network.play.server.SPacketSoundEffect; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.SoundEvent; +import openblocks.OpenBlocks; import openblocks.api.IFlimFlamAction; import openmods.utils.CollectionUtils; -import com.google.common.collect.ImmutableList; - public class SoundFlimFlam implements IFlimFlamAction { - private static final List sounds = ImmutableList.of( - "openblocks:annoying.mosquito", - "openblocks:annoying.alarmclock", - "openblocks:annoying.vibrate", - "openblocks:best.feature.ever.fart", - "game.tnt.primed", - "random.explode", - "random.break", - "mob.blaze.breathe", - "mob.endermen.stare", - "mob.ghast.charge", - "mob.zombiepig.zpigangry", - "mob.creeper.say" - ); + private static final List sounds = ImmutableList.of( + OpenBlocks.Sounds.MISC_MOSQUITO, + OpenBlocks.Sounds.MISC_ALARM_CLOCK, + OpenBlocks.Sounds.MISC_VIBRATE, + OpenBlocks.Sounds.PLAYER_WHOOPS, + SoundEvents.ENTITY_TNT_PRIMED, + SoundEvents.ENTITY_GENERIC_EXPLODE, + SoundEvents.ENTITY_ELDER_GUARDIAN_CURSE, + SoundEvents.ENTITY_BLAZE_SHOOT, + SoundEvents.ENTITY_ENDERMEN_STARE, + SoundEvents.ENTITY_GHAST_SCREAM, + SoundEvents.ENTITY_GHAST_SHOOT, + SoundEvents.ENTITY_ZOMBIE_PIG_ANGRY, + SoundEvents.ENTITY_CREEPER_PRIMED); @Override public boolean execute(EntityPlayerMP target) { - String sound = CollectionUtils.getRandom(sounds); - target.playerNetServerHandler.sendPacket(new S29PacketSoundEffect(sound, target.posX, target.posY, target.posZ, 1, 1)); + SoundEvent sound = CollectionUtils.getRandom(sounds); + target.connection.sendPacket(new SPacketSoundEffect(sound, SoundCategory.MASTER, target.posX, target.posY, target.posZ, 1, 1)); return true; } diff --git a/src/main/java/openblocks/enchantments/flimflams/SquidFilmFlam.java b/src/main/java/openblocks/enchantments/flimflams/SquidFilmFlam.java index 27264e30..a0ac6909 100644 --- a/src/main/java/openblocks/enchantments/flimflams/SquidFilmFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/SquidFilmFlam.java @@ -1,14 +1,12 @@ package openblocks.enchantments.flimflams; +import com.google.common.collect.ImmutableList; import java.util.List; import java.util.Random; - import net.minecraft.entity.passive.EntitySquid; import net.minecraft.entity.player.EntityPlayerMP; import openblocks.api.IFlimFlamAction; -import com.google.common.collect.ImmutableList; - public class SquidFilmFlam implements IFlimFlamAction { private static final Random random = new Random(); @@ -23,7 +21,7 @@ public class SquidFilmFlam implements IFlimFlamAction { @Override public boolean execute(EntityPlayerMP target) { - if (target.riddenByEntity != null && !target.riddenByEntity.isDead) return false; + if (target.isBeingRidden()) return false; EntitySquid squid = new EntitySquid(target.worldObj); squid.moveEntity(target.posX, target.getEntityBoundingBox().minY, target.posZ); @@ -32,7 +30,7 @@ public class SquidFilmFlam implements IFlimFlamAction { squid.setCustomNameTag(names.get(selected)); target.worldObj.spawnEntityInWorld(squid); - squid.mountEntity(target); + squid.startRiding(target); return true; } diff --git a/src/main/java/openblocks/enchantments/flimflams/UselessToolFlimFlam.java b/src/main/java/openblocks/enchantments/flimflams/UselessToolFlimFlam.java index 4d41ffc6..9e522f4c 100644 --- a/src/main/java/openblocks/enchantments/flimflams/UselessToolFlimFlam.java +++ b/src/main/java/openblocks/enchantments/flimflams/UselessToolFlimFlam.java @@ -1,8 +1,7 @@ package openblocks.enchantments.flimflams; -import java.util.Map; +import java.util.List; import java.util.Random; - import net.minecraft.enchantment.EnchantmentData; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayerMP; @@ -20,86 +19,86 @@ public class UselessToolFlimFlam implements IFlimFlamAction { private static Item selectTool() { switch (random.nextInt(36)) { case 0: - return Items.diamond_pickaxe; + return Items.DIAMOND_PICKAXE; case 1: - return Items.golden_pickaxe; + return Items.GOLDEN_PICKAXE; case 2: - return Items.iron_pickaxe; + return Items.IRON_PICKAXE; case 3: - return Items.stone_pickaxe; + return Items.STONE_PICKAXE; case 4: - return Items.wooden_pickaxe; + return Items.WOODEN_PICKAXE; case 5: - return Items.diamond_shovel; + return Items.DIAMOND_SHOVEL; case 6: - return Items.golden_shovel; + return Items.GOLDEN_SHOVEL; case 7: - return Items.iron_shovel; + return Items.IRON_SHOVEL; case 8: - return Items.stone_shovel; + return Items.STONE_SHOVEL; case 9: - return Items.wooden_shovel; + return Items.WOODEN_SHOVEL; case 10: - return Items.diamond_axe; + return Items.DIAMOND_AXE; case 11: - return Items.golden_axe; + return Items.GOLDEN_AXE; case 12: - return Items.iron_axe; + return Items.IRON_AXE; case 13: - return Items.stone_axe; + return Items.STONE_AXE; case 14: - return Items.wooden_axe; + return Items.WOODEN_AXE; case 15: - return Items.shears; + return Items.SHEARS; case 16: - return Items.diamond_leggings; + return Items.DIAMOND_LEGGINGS; case 17: - return Items.golden_leggings; + return Items.GOLDEN_LEGGINGS; case 18: - return Items.iron_leggings; + return Items.IRON_LEGGINGS; case 19: - return Items.chainmail_leggings; + return Items.CHAINMAIL_LEGGINGS; case 20: - return Items.leather_leggings; + return Items.LEATHER_LEGGINGS; case 21: - return Items.diamond_boots; + return Items.DIAMOND_BOOTS; case 22: - return Items.golden_boots; + return Items.GOLDEN_BOOTS; case 23: - return Items.iron_boots; + return Items.IRON_BOOTS; case 24: - return Items.chainmail_boots; + return Items.CHAINMAIL_BOOTS; case 25: - return Items.leather_boots; + return Items.LEATHER_BOOTS; case 26: - return Items.diamond_chestplate; + return Items.DIAMOND_CHESTPLATE; case 27: - return Items.golden_chestplate; + return Items.GOLDEN_CHESTPLATE; case 28: - return Items.iron_chestplate; + return Items.IRON_CHESTPLATE; case 29: - return Items.chainmail_chestplate; + return Items.CHAINMAIL_CHESTPLATE; case 30: - return Items.leather_chestplate; + return Items.LEATHER_CHESTPLATE; case 31: - return Items.diamond_helmet; + return Items.DIAMOND_HELMET; case 32: - return Items.golden_helmet; + return Items.GOLDEN_HELMET; case 33: - return Items.iron_helmet; + return Items.IRON_HELMET; case 34: - return Items.chainmail_helmet; + return Items.CHAINMAIL_HELMET; case 35: - return Items.leather_helmet; + return Items.LEATHER_HELMET; default: - return Items.stick; + return Items.STICK; } } @@ -107,8 +106,8 @@ public class UselessToolFlimFlam implements IFlimFlamAction { public boolean execute(EntityPlayerMP target) { Item tool = selectTool(); ItemStack dropped = new ItemStack(tool); - Map enchantments = EnchantmentHelper.mapEnchantmentData(30, dropped); - EnchantmentData data = CollectionUtils.getRandom(enchantments.values()); + List enchantments = EnchantmentHelper.getEnchantmentDatas(30, dropped, true); + EnchantmentData data = CollectionUtils.getRandom(enchantments); if (data == null) return false; dropped.addEnchantment(data.enchantmentobj, random.nextInt(data.enchantmentLevel) + 1); diff --git a/src/main/java/openblocks/events/ElevatorActionEvent.java b/src/main/java/openblocks/events/ElevatorActionEvent.java index 5c79314c..d6bfb58d 100644 --- a/src/main/java/openblocks/events/ElevatorActionEvent.java +++ b/src/main/java/openblocks/events/ElevatorActionEvent.java @@ -1,7 +1,7 @@ package openblocks.events; import net.minecraft.network.PacketBuffer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import openmods.events.network.BlockEventPacket; import openmods.movement.PlayerMovementEvent; import openmods.network.event.EventDirection; diff --git a/src/main/java/openblocks/integration/AdapterCannon.java b/src/main/java/openblocks/integration/AdapterCannon.java index 21ebdfb2..a581c809 100644 --- a/src/main/java/openblocks/integration/AdapterCannon.java +++ b/src/main/java/openblocks/integration/AdapterCannon.java @@ -4,7 +4,9 @@ import openblocks.common.tileentity.TileEntityCannon; import openperipheral.api.adapter.IPeripheralAdapter; import openperipheral.api.adapter.method.Arg; import openperipheral.api.adapter.method.ScriptCallable; +import openperipheral.api.architecture.FeatureGroup; +@FeatureGroup("openblocks-cannon") public class AdapterCannon implements IPeripheralAdapter { @Override diff --git a/src/main/java/openblocks/integration/AdapterDonationStation.java b/src/main/java/openblocks/integration/AdapterDonationStation.java index 0ec5b91d..639f1095 100644 --- a/src/main/java/openblocks/integration/AdapterDonationStation.java +++ b/src/main/java/openblocks/integration/AdapterDonationStation.java @@ -5,8 +5,10 @@ import openperipheral.api.adapter.IPeripheralAdapter; import openperipheral.api.adapter.method.IMultiReturn; import openperipheral.api.adapter.method.ReturnType; import openperipheral.api.adapter.method.ScriptCallable; +import openperipheral.api.architecture.FeatureGroup; import openperipheral.api.helpers.MultiReturn; +@FeatureGroup("openblocks-donation-station") public class AdapterDonationStation implements IPeripheralAdapter { @Override diff --git a/src/main/java/openblocks/integration/AdapterProjector.java b/src/main/java/openblocks/integration/AdapterProjector.java index 277ceb90..6e0d3ae9 100644 --- a/src/main/java/openblocks/integration/AdapterProjector.java +++ b/src/main/java/openblocks/integration/AdapterProjector.java @@ -1,22 +1,25 @@ package openblocks.integration; +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import com.google.common.primitives.UnsignedBytes; import java.util.Map; - import net.minecraft.block.material.MapColor; import openblocks.common.HeightMapData; import openblocks.common.HeightMapData.LayerData; import openblocks.common.tileentity.TileEntityProjector; import openperipheral.api.adapter.Asynchronous; import openperipheral.api.adapter.IPeripheralAdapter; -import openperipheral.api.adapter.method.*; +import openperipheral.api.adapter.method.Arg; +import openperipheral.api.adapter.method.ArgType; +import openperipheral.api.adapter.method.IMultiReturn; +import openperipheral.api.adapter.method.ReturnType; +import openperipheral.api.adapter.method.ScriptCallable; +import openperipheral.api.architecture.FeatureGroup; import openperipheral.api.helpers.MultiReturn; - import org.apache.commons.lang3.ArrayUtils; -import com.google.common.base.Preconditions; -import com.google.common.collect.Maps; -import com.google.common.primitives.UnsignedBytes; - +@FeatureGroup("openblocks-projector") public class AdapterProjector implements IPeripheralAdapter { @Override @@ -138,7 +141,7 @@ public class AdapterProjector implements IPeripheralAdapter { Preconditions.checkElementIndex(row, 64, "row"); Preconditions.checkElementIndex(column, 64, "column"); Preconditions.checkElementIndex(height, 256, "height"); - Preconditions.checkElementIndex(color, MapColor.mapColorArray.length, "color"); + Preconditions.checkElementIndex(color, MapColor.COLORS.length, "color"); HeightMapData data = projector.getMap(); Preconditions.checkState(data != null && data.isValid(), "Map not loaded"); diff --git a/src/main/java/openblocks/integration/AdapterVillageHighlighter.java b/src/main/java/openblocks/integration/AdapterVillageHighlighter.java index 300352d9..f6f84328 100644 --- a/src/main/java/openblocks/integration/AdapterVillageHighlighter.java +++ b/src/main/java/openblocks/integration/AdapterVillageHighlighter.java @@ -1,16 +1,16 @@ package openblocks.integration; +import com.google.common.collect.Maps; import java.util.Map; - -import net.minecraft.util.Vec3i; +import net.minecraft.util.math.Vec3i; import net.minecraft.village.Village; import openblocks.common.tileentity.TileEntityVillageHighlighter; import openperipheral.api.adapter.IPeripheralAdapter; import openperipheral.api.adapter.method.ReturnType; import openperipheral.api.adapter.method.ScriptCallable; +import openperipheral.api.architecture.FeatureGroup; -import com.google.common.collect.Maps; - +@FeatureGroup("openblocks-village-highlighter") public class AdapterVillageHighlighter implements IPeripheralAdapter { @Override @@ -28,7 +28,7 @@ public class AdapterVillageHighlighter implements IPeripheralAdapter { Map map = Maps.newHashMap(); int i = 1; for (Village village : vh.getWorld().villageCollectionObj.getVillageList()) { - if (village.func_179866_a(vh.getPos())) { + if (village.isBlockPosWithinSqVillageRadius(vh.getPos())) { Map villageMap = Maps.newHashMap(); Vec3i d = village.getCenter().subtract(vh.getPos()); villageMap.put("x", d.getX()); diff --git a/src/main/java/openblocks/integration/MagnetControlAdapter.java b/src/main/java/openblocks/integration/MagnetControlAdapter.java index a5757272..1f23733b 100644 --- a/src/main/java/openblocks/integration/MagnetControlAdapter.java +++ b/src/main/java/openblocks/integration/MagnetControlAdapter.java @@ -1,10 +1,13 @@ package openblocks.integration; +import com.google.common.base.Preconditions; +import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.TurtleSide; import java.lang.ref.WeakReference; - -import net.minecraft.util.BlockPos; +import net.minecraft.init.SoundEvents; import net.minecraft.util.EnumFacing; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import openblocks.Config; @@ -16,35 +19,34 @@ import openmods.fakeplayer.FakePlayerPool; import openmods.fakeplayer.FakePlayerPool.PlayerUserReturning; import openmods.fakeplayer.OpenModsFakePlayer; import openperipheral.api.adapter.IWorldProvider; -import openperipheral.api.adapter.method.*; +import openperipheral.api.adapter.method.Alias; +import openperipheral.api.adapter.method.Arg; +import openperipheral.api.adapter.method.IMultiReturn; +import openperipheral.api.adapter.method.ReturnType; +import openperipheral.api.adapter.method.ScriptCallable; import openperipheral.api.architecture.IArchitectureAccess; import openperipheral.api.architecture.IAttachable; import openperipheral.api.helpers.MultiReturn; import openperipheral.api.peripheral.ExposeInterface; import openperipheral.api.peripheral.PeripheralTypeId; -import com.google.common.base.Preconditions; - -import dan200.computercraft.api.turtle.ITurtleAccess; -import dan200.computercraft.api.turtle.TurtleSide; - @PeripheralTypeId("openblocks_magnet") @ExposeInterface({ ITickingTurtle.class, IAttachable.class }) public class MagnetControlAdapter implements ITickingTurtle, IWorldProvider, IAttachable { public class Owner implements IOwner { - private Vec3 target; + private Vec3d target; public Owner() { - this.target = new Vec3(0, 0, 0); + this.target = new Vec3d(0, 0, 0); } public synchronized void setTargetPosition(double x, double y, double z) { - target = new Vec3(x, y, z); + target = new Vec3d(x, y, z); } - public synchronized Vec3 getTarget(Vec3 pos, EnumFacing side) { + public synchronized Vec3d getTarget(Vec3d pos, EnumFacing side) { double x = pos.xCoord + 0.5; double y = pos.yCoord + 0.5; double z = pos.zCoord + 0.5; @@ -71,7 +73,7 @@ public class MagnetControlAdapter implements ITickingTurtle, IWorldProvider, IAt break; } - return new Vec3(x, y, z); + return new Vec3d(x, y, z); } @Override @@ -80,8 +82,8 @@ public class MagnetControlAdapter implements ITickingTurtle, IWorldProvider, IAt } @Override - public Vec3 getTarget() { - return getTarget(new Vec3(turtle.getPosition()), turtle.getDirection()); + public Vec3d getTarget() { + return getTarget(new Vec3d(turtle.getPosition()), turtle.getDirection()); } @Override @@ -137,7 +139,7 @@ public class MagnetControlAdapter implements ITickingTurtle, IWorldProvider, IAt magnet = new EntityMagnet(world, magnetOwner, true); world.spawnEntityInWorld(magnet); - magnet.playSound("mob.endermen.portal", 1, 1); + magnet.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1, 1); this.magnet = new WeakReference(magnet); } @@ -159,7 +161,7 @@ public class MagnetControlAdapter implements ITickingTurtle, IWorldProvider, IAt description = "Get turtle position") public IMultiReturn getPosition() { EntityMagnet magnet = getMagnet(); - Vec3 rotated = getRelativeDistance(magnet); + Vec3d rotated = getRelativeDistance(magnet); return MultiReturn.wrap(rotated.xCoord, rotated.yCoord, rotated.zCoord); } @@ -183,8 +185,8 @@ public class MagnetControlAdapter implements ITickingTurtle, IWorldProvider, IAt @ScriptCallable(returnTypes = { ReturnType.NUMBER, ReturnType.NUMBER, ReturnType.NUMBER }) public IMultiReturn getDistanceToTarget() { EntityMagnet magnet = getMagnet(); - Vec3 current = getRelativeDistance(magnet); - Vec3 target = magnetOwner.target; + Vec3d current = getRelativeDistance(magnet); + Vec3d target = magnetOwner.target; return MultiReturn.wrap(current.xCoord - target.xCoord, current.yCoord - target.yCoord, current.zCoord - target.zCoord); @@ -209,23 +211,23 @@ public class MagnetControlAdapter implements ITickingTurtle, IWorldProvider, IAt && Math.abs(z) <= Config.turtleMagnetRange; } - private Vec3 getRelativeDistance(EntityMagnet magnet) { - Vec3 magnetPos = new Vec3(magnet.posX, magnet.posY, magnet.posZ); - Vec3 turtlePos = new Vec3(turtle.getPosition()).addVector(0.5, 0.5, 0.5); + private Vec3d getRelativeDistance(EntityMagnet magnet) { + Vec3d magnetPos = new Vec3d(magnet.posX, magnet.posY, magnet.posZ); + Vec3d turtlePos = new Vec3d(turtle.getPosition()).addVector(0.5, 0.5, 0.5); - Vec3 dist = turtlePos.subtract(magnetPos); + Vec3d dist = turtlePos.subtract(magnetPos); EnumFacing side = turtle.getDirection(); switch (side) { case NORTH: - return new Vec3(-dist.zCoord, dist.yCoord, dist.xCoord); + return new Vec3d(-dist.zCoord, dist.yCoord, dist.xCoord); case SOUTH: - return new Vec3(dist.zCoord, dist.yCoord, -dist.xCoord); + return new Vec3d(dist.zCoord, dist.yCoord, -dist.xCoord); case EAST: - return new Vec3(dist.xCoord, dist.yCoord, dist.zCoord); + return new Vec3d(dist.xCoord, dist.yCoord, dist.zCoord); case WEST: - return new Vec3(-dist.xCoord, dist.yCoord, -dist.zCoord); + return new Vec3d(-dist.xCoord, dist.yCoord, -dist.zCoord); default: return dist; } @@ -251,18 +253,18 @@ public class MagnetControlAdapter implements ITickingTurtle, IWorldProvider, IAt EntityMagnet magnet = this.magnet.get(); Preconditions.checkNotNull(magnet, "Magnet not active"); - Vec3 magnetPos = new Vec3(magnet.posX, magnet.posY, magnet.posZ); - Vec3 turtlePos = new Vec3(turtle.getPosition()).addVector(0.5, 0.5, 0.5); + Vec3d magnetPos = new Vec3d(magnet.posX, magnet.posY, magnet.posZ); + Vec3d turtlePos = new Vec3d(turtle.getPosition()).addVector(0.5, 0.5, 0.5); Preconditions.checkState(!checkPosition || canOperateOnMagnet(magnetPos, turtlePos), "Magnet too far"); - magnet.playSound("mob.endermen.portal", 1, 1); + magnet.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1, 1); magnet.setDead(); this.magnet.clear(); magnetOwner = null; } - private static boolean canOperateOnMagnet(Vec3 magnetPos, Vec3 turtlePos) { + private static boolean canOperateOnMagnet(Vec3d magnetPos, Vec3d turtlePos) { return magnetPos.squareDistanceTo(turtlePos) <= Config.turtleMagnetRangeDeactivate * Config.turtleMagnetRangeDeactivate; } diff --git a/src/main/java/openblocks/integration/MagnetTurtleUpgrade.java b/src/main/java/openblocks/integration/MagnetTurtleUpgrade.java index 4e7b08bb..7e1feead 100644 --- a/src/main/java/openblocks/integration/MagnetTurtleUpgrade.java +++ b/src/main/java/openblocks/integration/MagnetTurtleUpgrade.java @@ -1,11 +1,17 @@ package openblocks.integration; +import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; +import dan200.computercraft.api.turtle.TurtleCommandResult; +import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.turtle.TurtleUpgradeType; +import dan200.computercraft.api.turtle.TurtleVerb; import javax.vecmath.Matrix4f; - import net.minecraft.client.Minecraft; -import net.minecraft.client.resources.model.IBakedModel; -import net.minecraft.client.resources.model.ModelManager; -import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ModelManager; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; @@ -15,12 +21,8 @@ import openblocks.OpenBlocks; import openblocks.common.item.MetasGeneric; import openperipheral.api.ApiAccess; import openperipheral.api.architecture.cc.IComputerCraftObjectsFactory; - import org.apache.commons.lang3.tuple.Pair; -import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.api.turtle.*; - public class MagnetTurtleUpgrade implements ITurtleUpgrade { @Override diff --git a/src/main/java/openblocks/integration/ModuleAdapters.java b/src/main/java/openblocks/integration/ModuleAdapters.java index f7ce05c6..0e85f8d2 100644 --- a/src/main/java/openblocks/integration/ModuleAdapters.java +++ b/src/main/java/openblocks/integration/ModuleAdapters.java @@ -1,6 +1,7 @@ package openblocks.integration; import static openmods.integration.IntegrationConditions.modLoaded; + import openmods.Mods; import openmods.integration.IntegrationModule; import openperipheral.api.ApiHolder; diff --git a/src/main/java/openblocks/integration/ModuleTurtles.java b/src/main/java/openblocks/integration/ModuleTurtles.java index 2b52862c..e7d73c8c 100644 --- a/src/main/java/openblocks/integration/ModuleTurtles.java +++ b/src/main/java/openblocks/integration/ModuleTurtles.java @@ -3,9 +3,10 @@ package openblocks.integration; import static openmods.conditions.Conditions.all; import static openmods.integration.IntegrationConditions.classExists; import static openmods.integration.IntegrationConditions.modLoaded; + +import dan200.computercraft.api.ComputerCraftAPI; import openmods.Mods; import openmods.integration.IntegrationModule; -import dan200.computercraft.api.ComputerCraftAPI; public class ModuleTurtles extends IntegrationModule { diff --git a/src/main/java/openblocks/integration/TurtleUtils.java b/src/main/java/openblocks/integration/TurtleUtils.java index 8ee167a1..d8f262c1 100644 --- a/src/main/java/openblocks/integration/TurtleUtils.java +++ b/src/main/java/openblocks/integration/TurtleUtils.java @@ -1,7 +1,6 @@ package openblocks.integration; import java.util.List; - import net.minecraft.item.ItemStack; public class TurtleUtils { diff --git a/src/main/java/openblocks/integration/package-info.java b/src/main/java/openblocks/integration/package-info.java index 6a0f83f3..0710b2aa 100644 --- a/src/main/java/openblocks/integration/package-info.java +++ b/src/main/java/openblocks/integration/package-info.java @@ -1,2 +1 @@ package openblocks.integration; - diff --git a/src/main/java/openblocks/rpc/IGuideAnimationTrigger.java b/src/main/java/openblocks/rpc/IGuideAnimationTrigger.java index 7e8f1861..bd21ce78 100644 --- a/src/main/java/openblocks/rpc/IGuideAnimationTrigger.java +++ b/src/main/java/openblocks/rpc/IGuideAnimationTrigger.java @@ -1,6 +1,6 @@ package openblocks.rpc; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; public interface IGuideAnimationTrigger { public void trigger(BlockPos pos, int stateId); diff --git a/src/main/java/openblocks/rubbish/BrickManager.java b/src/main/java/openblocks/rubbish/BrickManager.java index 4cd3a7a5..8e6d56f8 100644 --- a/src/main/java/openblocks/rubbish/BrickManager.java +++ b/src/main/java/openblocks/rubbish/BrickManager.java @@ -1,14 +1,22 @@ package openblocks.rubbish; +import java.util.concurrent.Callable; +import javax.annotation.Nullable; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.IExtendedEntityProperties; -import net.minecraftforge.event.entity.EntityEvent; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import openblocks.OpenBlocks; @@ -20,60 +28,82 @@ public class BrickManager { public static final String BOWELS_PROPERTY = "Bowels"; - public static class BowelContents implements IExtendedEntityProperties { - + public static class BowelContents { public int brickCount; - - @Override - public void saveNBTData(NBTTagCompound entityTag) { - entityTag.setInteger("Bricks", brickCount); - } - - @Override - public void loadNBTData(NBTTagCompound entityTag) { - brickCount = entityTag.getInteger("Bricks"); - } - - @Override - public void init(Entity entity, World world) {} } + private static final ResourceLocation CAPABILITY_KEY = OpenBlocks.location("bowels"); + + @CapabilityInject(BowelContents.class) + private static Capability CAPABILITY; + public static BowelContents getProperty(Entity entity) { - IExtendedEntityProperties prop = entity.getExtendedProperties(BOWELS_PROPERTY); - return (prop instanceof BowelContents)? (BowelContents)prop : null; + return entity.getCapability(CAPABILITY, EnumFacing.UP); + } + + public static void registerCapability() { + CapabilityManager.INSTANCE.register(BowelContents.class, new Capability.IStorage() { + @Override + public NBTBase writeNBT(Capability capability, BowelContents instance, EnumFacing side) { + return new NBTTagInt(instance.brickCount); + } + + @Override + public void readNBT(Capability capability, BowelContents instance, EnumFacing side, NBTBase nbt) { + instance.brickCount = ((NBTTagInt)nbt).getInt(); + } + + }, new Callable() { + @Override + public BowelContents call() throws Exception { + return new BowelContents(); + } + }); } @SubscribeEvent - public void onEntityConstruct(EntityEvent.EntityConstructing evt) { - if (evt.entity instanceof EntityPlayer) evt.entity.registerExtendedProperties(BOWELS_PROPERTY, new BowelContents()); + public void attachCapability(AttachCapabilitiesEvent evt) { + if (evt.getObject() instanceof EntityPlayer) { + evt.addCapability(CAPABILITY_KEY, new ICapabilityProvider() { + + private final BowelContents state = new BowelContents(); + + @Override + public boolean hasCapability(Capability capability, @Nullable EnumFacing facing) { + return capability == CAPABILITY; + } + + @Override + @SuppressWarnings("unchecked") + public T getCapability(Capability capability, @Nullable EnumFacing facing) { + if (capability == CAPABILITY) return (T)state; + return null; + } + }); + } } @SubscribeEvent public void onEntityDeath(LivingDropsEvent evt) { - if (evt.entity.worldObj.isRemote) return; - IExtendedEntityProperties prop = evt.entity.getExtendedProperties(BOWELS_PROPERTY); + if (evt.getEntity().worldObj.isRemote) return; - if (prop instanceof BowelContents) { - BowelContents tag = (BowelContents)prop; + BowelContents tag = getProperty(evt.getEntity()); + if (tag != null) { for (int i = 0; i < Math.min(tag.brickCount, 16); i++) { - EntityItem entityItem = createBrick(evt.entity); - evt.drops.add(entityItem); + EntityItem entityItem = createBrick(evt.getEntity()); + evt.getDrops().add(entityItem); } } } - private static boolean canDropBrick(EntityPlayer player) { + private static boolean tryDecrementBrick(EntityPlayer player) { if (player.capabilities.isCreativeMode) return true; - IExtendedEntityProperties prop = player.getExtendedProperties(BOWELS_PROPERTY); - - if (prop instanceof BowelContents) { - BowelContents tag = (BowelContents)prop; - if (tag.brickCount > 0) { - tag.brickCount--; - return true; - } + BowelContents tag = getProperty(player); + if (tag != null && tag.brickCount > 0) { + tag.brickCount--; + return true; } return false; @@ -83,20 +113,20 @@ public class BrickManager { public void onPlayerScared(PlayerActionEvent evt) { if (evt.type == Type.BOO && evt.sender != null) { final EntityPlayer player = evt.sender; - player.worldObj.playSoundAtEntity(player, "openblocks:best.feature.ever.fart", 1, 1); + player.worldObj.playSound(null, player.getPosition(), OpenBlocks.Sounds.PLAYER_WHOOPS, SoundCategory.PLAYERS, 1, 1); - if (canDropBrick(player)) { + if (tryDecrementBrick(player)) { EntityItem drop = createBrick(player); drop.setDefaultPickupDelay(); player.worldObj.spawnEntityInWorld(drop); - player.triggerAchievement(OpenBlocks.brickAchievement); + player.addStat(OpenBlocks.brickAchievement); player.addStat(OpenBlocks.brickStat, 1); } } } private static EntityItem createBrick(Entity dropper) { - ItemStack brick = new ItemStack(Items.brick); + ItemStack brick = new ItemStack(Items.BRICK); EntityItem drop = ItemUtils.createDrop(dropper, brick); double rotation = Math.toRadians(dropper.rotationYaw) - Math.PI / 2; double dx = Math.cos(rotation); diff --git a/src/main/java/openblocks/rubbish/CommandFlimFlam.java b/src/main/java/openblocks/rubbish/CommandFlimFlam.java index 99d9a01e..a742cced 100644 --- a/src/main/java/openblocks/rubbish/CommandFlimFlam.java +++ b/src/main/java/openblocks/rubbish/CommandFlimFlam.java @@ -1,15 +1,19 @@ package openblocks.rubbish; -import static openmods.utils.CommandUtils.*; +import static openmods.utils.CommandUtils.error; +import static openmods.utils.CommandUtils.filterPrefixes; +import static openmods.utils.CommandUtils.fiterPlayerNames; +import static openmods.utils.CommandUtils.respond; import java.util.Collections; import java.util.List; - +import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.util.BlockPos; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.math.BlockPos; import openblocks.api.IFlimFlamDescription; import openblocks.enchantments.flimflams.FlimFlamRegistry; import openmods.utils.CollectionUtils; @@ -39,11 +43,11 @@ public class CommandFlimFlam implements ICommand { } @Override - public void processCommand(ICommandSender sender, String[] params) throws CommandException { + public void execute(MinecraftServer server, ICommandSender sender, String[] params) throws CommandException { if (params.length != 1 && params.length != 2) throw error("openblocks.misc.command.invalid"); String playerName = params[0]; - EntityPlayerMP player = getPlayer(sender, playerName); + EntityPlayerMP player = CommandBase.getPlayer(server, sender, playerName); String effectName = (params.length > 1)? params[1] : null; @@ -63,12 +67,12 @@ public class CommandFlimFlam implements ICommand { } @Override - public boolean canCommandSenderUseCommand(ICommandSender sender) { + public boolean checkPermission(MinecraftServer server, ICommandSender sender) { return sender.canCommandSenderUseCommand(4, NAME); // OP } @Override - public List addTabCompletionOptions(ICommandSender sender, String[] params, BlockPos pos) { + public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] params, BlockPos pos) { if (params.length == 1) { String playerPrefix = params[0]; return fiterPlayerNames(playerPrefix); diff --git a/src/main/java/openblocks/rubbish/CommandLuck.java b/src/main/java/openblocks/rubbish/CommandLuck.java index 41687d52..09343456 100644 --- a/src/main/java/openblocks/rubbish/CommandLuck.java +++ b/src/main/java/openblocks/rubbish/CommandLuck.java @@ -1,15 +1,18 @@ package openblocks.rubbish; -import static openmods.utils.CommandUtils.*; +import static openmods.utils.CommandUtils.error; +import static openmods.utils.CommandUtils.fiterPlayerNames; +import static openmods.utils.CommandUtils.respond; import java.util.Collections; import java.util.List; - +import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.math.BlockPos; import openblocks.enchantments.FlimFlamEnchantmentsHandler; public class CommandLuck implements ICommand { @@ -37,11 +40,11 @@ public class CommandLuck implements ICommand { } @Override - public void processCommand(ICommandSender sender, String[] params) throws CommandException { + public void execute(MinecraftServer server, ICommandSender sender, String[] params) throws CommandException { if (params.length < 1) throw error("openblocks.misc.command.invalid"); String playerName = params[0]; - EntityPlayer player = getPlayer(sender, playerName); + EntityPlayer player = CommandBase.getPlayer(server, sender, playerName); if (params.length == 1) { int result = FlimFlamEnchantmentsHandler.getLuck(player); @@ -60,12 +63,12 @@ public class CommandLuck implements ICommand { } @Override - public boolean canCommandSenderUseCommand(ICommandSender sender) { + public boolean checkPermission(MinecraftServer server, ICommandSender sender) { return sender.canCommandSenderUseCommand(4, NAME); // OP } @Override - public List addTabCompletionOptions(ICommandSender sender, String[] params, BlockPos pos) { + public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] params, BlockPos pos) { if (params.length == 1) { String playerPrefix = params[0]; return fiterPlayerNames(playerPrefix); diff --git a/src/main/java/openblocks/rubbish/LoreGenerator.java b/src/main/java/openblocks/rubbish/LoreGenerator.java index 1ddb1c1c..0e8133d5 100644 --- a/src/main/java/openblocks/rubbish/LoreGenerator.java +++ b/src/main/java/openblocks/rubbish/LoreGenerator.java @@ -1,15 +1,19 @@ package openblocks.rubbish; -import static openmods.words.Words.*; - -import java.util.Map; -import java.util.Random; - -import openmods.words.IGenerator; - -import org.apache.commons.lang3.StringUtils; +import static openmods.words.Words.alt; +import static openmods.words.Words.capitalize; +import static openmods.words.Words.capitalizeFully; +import static openmods.words.Words.opt; +import static openmods.words.Words.range; +import static openmods.words.Words.seq; +import static openmods.words.Words.sub; +import static openmods.words.Words.word; import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Random; +import openmods.words.IGenerator; +import org.apache.commons.lang3.StringUtils; public class LoreGenerator { diff --git a/src/main/java/openblocks/shapes/CoordShape.java b/src/main/java/openblocks/shapes/CoordShape.java new file mode 100644 index 00000000..c8cddc55 --- /dev/null +++ b/src/main/java/openblocks/shapes/CoordShape.java @@ -0,0 +1,52 @@ +package openblocks.shapes; + +import java.nio.ByteBuffer; +import java.util.List; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import openmods.renderer.shaders.BufferHelper; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL15; + +public class CoordShape { + + @SideOnly(Side.CLIENT) + private int vbo; + + private final List coords; + + public CoordShape(List coords) { + this.coords = coords; + } + + @SideOnly(Side.CLIENT) + public int bindVBO() { + if (vbo == 0) { + ByteBuffer data = BufferUtils.createByteBuffer(coords.size() * 3 * 4); + for (BlockPos c : coords) + data.putInt(c.getX()).putInt(c.getY()).putInt(c.getZ()); + data.flip(); + + vbo = BufferHelper.methods().glGenBuffers(); + BufferHelper.methods().glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo); + BufferHelper.methods().glBufferData(GL15.GL_ARRAY_BUFFER, data, GL15.GL_STATIC_DRAW); + } else BufferHelper.methods().glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo); + + return vbo; + } + + public List getCoords() { + return coords; + } + + public int size() { + return coords.size(); + } + + @SideOnly(Side.CLIENT) + public void destroy() { + if (vbo != 0) BufferHelper.methods().glDeleteBuffers(vbo); + vbo = 0; + } +} diff --git a/src/main/java/openblocks/shapes/GuideShape.java b/src/main/java/openblocks/shapes/GuideShape.java index c0908983..67aac147 100644 --- a/src/main/java/openblocks/shapes/GuideShape.java +++ b/src/main/java/openblocks/shapes/GuideShape.java @@ -1,7 +1,13 @@ package openblocks.shapes; -import net.minecraft.util.StatCollector; -import openmods.shapes.*; +import openmods.shapes.IShapeGenerator; +import openmods.shapes.ShapeAxesGenerator; +import openmods.shapes.ShapeCuboidGenerator; +import openmods.shapes.ShapeCylinderGenerator; +import openmods.shapes.ShapeEquilateral2dGenerator; +import openmods.shapes.ShapePlanesGenerator; +import openmods.shapes.ShapeSphereGenerator; +import openmods.utils.TranslationUtils; import openmods.utils.render.GeometryUtils.Octant; public enum GuideShape { @@ -9,7 +15,7 @@ public enum GuideShape { Cylinder(new ShapeCylinderGenerator(), "cylinder"), Cuboid(new ShapeCuboidGenerator(ShapeCuboidGenerator.Elements.EDGES), "cuboid"), FullCuboid(new ShapeCuboidGenerator(ShapeCuboidGenerator.Elements.WALLS), "full_cuboid"), - Dome(new ShapeSphereGenerator(Octant.TOP), "dome"), + Dome(new ShapeSphereGenerator(Octant.SOUTH), "dome"), Triangle(new ShapeEquilateral2dGenerator(3), "triangle"), Pentagon(new ShapeEquilateral2dGenerator(5), "pentagon"), Hexagon(new ShapeEquilateral2dGenerator(6), "hexagon"), @@ -26,7 +32,7 @@ public enum GuideShape { } public String getLocalizedName() { - return StatCollector.translateToLocal(unlocalizedName); + return TranslationUtils.translateToLocal(unlocalizedName); } public static final GuideShape[] VALUES = values(); diff --git a/src/main/java/openblocks/trophy/CaveSpiderBehavior.java b/src/main/java/openblocks/trophy/CaveSpiderBehavior.java index b5f16754..ad68293e 100644 --- a/src/main/java/openblocks/trophy/CaveSpiderBehavior.java +++ b/src/main/java/openblocks/trophy/CaveSpiderBehavior.java @@ -1,7 +1,7 @@ package openblocks.trophy; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; +import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; import openblocks.common.tileentity.TileEntityTrophy; @@ -9,7 +9,7 @@ public class CaveSpiderBehavior implements ITrophyBehavior { @Override public int executeActivateBehavior(TileEntityTrophy tile, EntityPlayer player) { - player.addPotionEffect(new PotionEffect(Potion.poison.id, 200, 3)); + player.addPotionEffect(new PotionEffect(MobEffects.POISON, 200, 3)); return 0; } diff --git a/src/main/java/openblocks/trophy/CreeperBehavior.java b/src/main/java/openblocks/trophy/CreeperBehavior.java index 6024d957..590a779d 100644 --- a/src/main/java/openblocks/trophy/CreeperBehavior.java +++ b/src/main/java/openblocks/trophy/CreeperBehavior.java @@ -1,7 +1,7 @@ package openblocks.trophy; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import openblocks.common.tileentity.TileEntityTrophy; public class CreeperBehavior implements ITrophyBehavior { diff --git a/src/main/java/openblocks/trophy/EndermanBehavior.java b/src/main/java/openblocks/trophy/EndermanBehavior.java index 548da0ad..8f15fa67 100644 --- a/src/main/java/openblocks/trophy/EndermanBehavior.java +++ b/src/main/java/openblocks/trophy/EndermanBehavior.java @@ -2,7 +2,7 @@ package openblocks.trophy; import net.minecraft.entity.item.EntityEnderPearl; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityTrophy; diff --git a/src/main/java/openblocks/trophy/GuardianBehavior.java b/src/main/java/openblocks/trophy/GuardianBehavior.java index 835cb443..353d0a84 100644 --- a/src/main/java/openblocks/trophy/GuardianBehavior.java +++ b/src/main/java/openblocks/trophy/GuardianBehavior.java @@ -2,7 +2,7 @@ package openblocks.trophy; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.SPacketChangeGameState; import openblocks.common.tileentity.TileEntityTrophy; public class GuardianBehavior implements ITrophyBehavior { @@ -10,7 +10,7 @@ public class GuardianBehavior implements ITrophyBehavior { @Override public int executeActivateBehavior(TileEntityTrophy tile, EntityPlayer player) { if (player instanceof EntityPlayerMP) { - ((EntityPlayerMP)player).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(10, 0.0F)); + ((EntityPlayerMP)player).connection.sendPacket(new SPacketChangeGameState(10, 0.0F)); } return 100; } diff --git a/src/main/java/openblocks/trophy/ItemDropBehavior.java b/src/main/java/openblocks/trophy/ItemDropBehavior.java index 6a00b0cc..badf5eae 100644 --- a/src/main/java/openblocks/trophy/ItemDropBehavior.java +++ b/src/main/java/openblocks/trophy/ItemDropBehavior.java @@ -2,21 +2,20 @@ package openblocks.trophy; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.SoundEvent; import openblocks.common.tileentity.TileEntityTrophy; -import com.google.common.base.Strings; - public class ItemDropBehavior implements ITrophyBehavior { private final int minTicks; - private final String sound; + private final SoundEvent sound; private final ItemStack drop; public ItemDropBehavior(int minTicks, ItemStack drop) { - this(minTicks, drop, ""); + this(minTicks, drop, null); } - public ItemDropBehavior(int minTicks, ItemStack drop, String sound) { + public ItemDropBehavior(int minTicks, ItemStack drop, SoundEvent sound) { this.minTicks = minTicks; this.sound = sound; this.drop = drop.copy(); @@ -24,7 +23,7 @@ public class ItemDropBehavior implements ITrophyBehavior { @Override public int executeActivateBehavior(TileEntityTrophy tile, EntityPlayer player) { - if (!Strings.isNullOrEmpty(sound)) { + if (sound != null) { player.playSound(sound, 1.0F, (tile.getWorld().rand.nextFloat() - tile.getWorld().rand.nextFloat()) * 0.2F + 1.0F); } diff --git a/src/main/java/openblocks/trophy/MooshroomBehavior.java b/src/main/java/openblocks/trophy/MooshroomBehavior.java index 4cc37129..856ee967 100644 --- a/src/main/java/openblocks/trophy/MooshroomBehavior.java +++ b/src/main/java/openblocks/trophy/MooshroomBehavior.java @@ -2,7 +2,7 @@ package openblocks.trophy; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityTrophy; @@ -16,9 +16,8 @@ public class MooshroomBehavior implements ITrophyBehavior { for (int x = -1; x <= 1; x++) for (int z = -1; z <= 1; z++) { final BlockPos pos = base.add(x, 0, z); - if (world.isAirBlock(pos) - && Blocks.brown_mushroom.canPlaceBlockAt(world, pos)) { - world.setBlockState(pos, Blocks.brown_mushroom.getDefaultState()); + if (world.isAirBlock(pos) && Blocks.BROWN_MUSHROOM.canPlaceBlockAt(world, pos)) { + world.setBlockState(pos, Blocks.BROWN_MUSHROOM.getDefaultState()); } } diff --git a/src/main/java/openblocks/trophy/SkeletonBehavior.java b/src/main/java/openblocks/trophy/SkeletonBehavior.java index 88a684b9..3362d150 100644 --- a/src/main/java/openblocks/trophy/SkeletonBehavior.java +++ b/src/main/java/openblocks/trophy/SkeletonBehavior.java @@ -2,7 +2,10 @@ package openblocks.trophy; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.util.BlockPos; +import net.minecraft.entity.projectile.EntityTippedArrow; +import net.minecraft.init.SoundEvents; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityTrophy; @@ -16,10 +19,10 @@ public class SkeletonBehavior implements ITrophyBehavior { double pY = pos.getZ() + 0.5; final World world = tile.getWorld(); - EntityArrow entityarrow = new EntityArrow(world, pX, pZ, pY); + EntityArrow entityarrow = new EntityTippedArrow(world, pX, pZ, pY); entityarrow.setDamage(0.1); entityarrow.setThrowableHeading(world.rand.nextInt(10) - 5, 40, world.rand.nextInt(10) - 5, 1.0f, 6.0f); - player.playSound("random.bow", 1.0F, 1.0F / (world.rand.nextFloat() * 0.4F + 0.8F)); + world.playSound((EntityPlayer)null, player.getPosition(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (world.rand.nextFloat() * 0.4F + 1.2F) + 0.5F); world.spawnEntityInWorld(entityarrow); return 0; diff --git a/src/main/java/openblocks/trophy/SnowmanBehavior.java b/src/main/java/openblocks/trophy/SnowmanBehavior.java index b6119eab..65173675 100644 --- a/src/main/java/openblocks/trophy/SnowmanBehavior.java +++ b/src/main/java/openblocks/trophy/SnowmanBehavior.java @@ -3,7 +3,7 @@ package openblocks.trophy; import net.minecraft.block.BlockSnow; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityTrophy; import openmods.utils.CollectionUtils; @@ -19,9 +19,9 @@ public class SnowmanBehavior implements ITrophyBehavior { for (int z = -1; z <= 1; z++) { final BlockPos pos = base.add(x, 0, z); - if (world.isAirBlock(pos) && Blocks.snow_layer.canPlaceBlockAt(world, pos)) { + if (world.isAirBlock(pos) && Blocks.SNOW_LAYER.canPlaceBlockAt(world, pos)) { final Integer snowLayers = CollectionUtils.getRandom(BlockSnow.LAYERS.getAllowedValues()); - world.setBlockState(pos, Blocks.snow_layer.getDefaultState().withProperty(BlockSnow.LAYERS, snowLayers)); + world.setBlockState(pos, Blocks.SNOW_LAYER.getDefaultState().withProperty(BlockSnow.LAYERS, snowLayers)); } } } diff --git a/src/main/java/openblocks/trophy/SquidBehavior.java b/src/main/java/openblocks/trophy/SquidBehavior.java index a284f465..d767afb8 100644 --- a/src/main/java/openblocks/trophy/SquidBehavior.java +++ b/src/main/java/openblocks/trophy/SquidBehavior.java @@ -2,7 +2,9 @@ package openblocks.trophy; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; +import net.minecraft.init.SoundEvents; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import openblocks.common.tileentity.TileEntityTrophy; @@ -13,8 +15,8 @@ public class SquidBehavior implements ITrophyBehavior { final BlockPos base = tile.getPos().up(); final World world = tile.getWorld(); - if (world.provider.doesWaterVaporize()) world.playSoundEffect(base.getX(), base.getY(), base.getZ(), "random.fizz", 0.5F, 2.6F); - else if (world.isAirBlock(base)) world.setBlockState(base, Blocks.flowing_water.getDefaultState()); + if (world.provider.doesWaterVaporize()) world.playSound(null, base, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F); + else if (world.isAirBlock(base)) world.setBlockState(base, Blocks.FLOWING_WATER.getDefaultState()); return 10; } diff --git a/src/main/java/openblocks/trophy/WitchBehavior.java b/src/main/java/openblocks/trophy/WitchBehavior.java index d01dc434..9b6b8902 100644 --- a/src/main/java/openblocks/trophy/WitchBehavior.java +++ b/src/main/java/openblocks/trophy/WitchBehavior.java @@ -1,17 +1,17 @@ package openblocks.trophy; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; +import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.text.TextComponentTranslation; import openblocks.common.tileentity.TileEntityTrophy; public class WitchBehavior implements ITrophyBehavior { @Override public int executeActivateBehavior(TileEntityTrophy tile, EntityPlayer player) { - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 70, 1)); - player.addChatMessage(new ChatComponentTranslation("openblocks.misc.get_witched")); + player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 70, 1)); + player.addChatMessage(new TextComponentTranslation("openblocks.misc.get_witched")); return 0; } diff --git a/src/main/resources/assets/openblocks/changelog.json b/src/main/resources/assets/openblocks/changelog.json index 79af8b7f..d8f782c0 100644 --- a/src/main/resources/assets/openblocks/changelog.json +++ b/src/main/resources/assets/openblocks/changelog.json @@ -1,4 +1,39 @@ [ + { + version : "1.6", + sections : + [ + { + title : "openblocks.gui.features", + lines : + [ + "Improve building guide rendering", + "More realistic hang glider mechanics", + "Vertical speed indication for hang-glider (variometer)" + ] + }, + { + title : "openblocks.gui.bugfixes", + lines : + [ + "Last Stand takes into account armor damage reduction", + "Block placers now properly orient placed blocks", + "XP shower no longer ignores redstone after game restart", + "/dev/null and sprinkler item duplications", + "Graves no longer spawn in bedrock layer (configurable)" + ] + }, + { + title : "openblocks.gui.tweaks", + lines : + [ + "Fancify map projector", + "This book now has page numbers in Table of Contents", + "Builder guide dome shape rotated to allow more orientations" + ] + } + ] + }, { version : "1.5.1", sections : diff --git a/src/main/resources/assets/openblocks/lang/de_DE.lang b/src/main/resources/assets/openblocks/lang/de_DE.lang index 82c46be8..63dd9320 100644 --- a/src/main/resources/assets/openblocks/lang/de_DE.lang +++ b/src/main/resources/assets/openblocks/lang/de_DE.lang @@ -6,6 +6,9 @@ achievement.openblocks.stackOverflow.desc=Es ist voller Sterne! openblocks.keybind.category=OpenBlocks openblocks.keybind.drop_brick=Sei albern +openblocks.keybind.vario_switch=Vario Ein/Aus +openblocks.keybind.vario_vol_up=Vario lauter +openblocks.keybind.vario_vol_down=Vario leiser enchantment.openblocks.explosive=Instabil enchantment.openblocks.laststand=Letzte Rettung @@ -92,6 +95,7 @@ openblocks.misc.page=Seite %d von %d openblocks.misc.oh_no_ceiling=Du kannst hier nicht schlafen. Die Decke beunruhigt dich zu sehr... openblocks.misc.oh_no_ground=Auf DEM Ding willst du schlafen?! openblocks.misc.sleeping_bag_broken=Item inaktiv wegen fehlerhafter Initialisierung +openblocks.misc.inverted=Invertiert openblocks.misc.grave_msg=%s (Tag: %.1f) @@ -121,7 +125,7 @@ openblocks.misc.pedometer.last_check_time=Zeit seit dem letzen Check: %d ticks openblocks.misc.pedometer.total_time=Gesamtdauer: %d ticks -openblocks.misc.shape=Form: % +openblocks.misc.shape=Form: %s openblocks.misc.shape.sphere=Kugel openblocks.misc.shape.cylinder=Zylinder openblocks.misc.shape.cuboid=Quader @@ -164,6 +168,8 @@ openblocks.misc.command.flim_flam_target=Jemand mag dich nicht. Jemand mit Macht openblocks.misc.command.flim_flam_failed=Der Blödsinn hat nicht funktioniert! openblocks.misc.command.luck_added=Glück von Spieler %s geändert, aktuell: %d openblocks.misc.command.luck_current=Glück von Spieler %s: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Etwas seltsames geschieht um dich herum... openblocks.turtle.magnet=Magnet @@ -201,6 +207,9 @@ tile.openblocks.sponge.description=Der Schwamm ist ein Ersatz für den Vanilla-S item.openblocks.spongeonastick.name=Schwamm item.openblocks.spongeonastick.description=Der Schwamm am Stiel ist ein Werkzeug zum Enfernen von Flüssigkeiten. Funktioniert wie der Schwamm, ist aber mobil und wird mit der Zeit aufgebraucht. +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Item-Kanone tile.openblocks.cannon.description=Wenn ein Redstone-Signal anliegt, wird die Item-Kannone Items, die es in einem benachbarten Inventar findet, schießen. Benutze den 'Zeiger', um die Kannone auszurichten. @@ -251,6 +260,7 @@ tile.openblocks.blockbreaker.description=Wenn er ein Redstone-Signal bekommt, br tile.openblocks.projector.name=Höhenkartenprojektor tile.openblocks.projector.description=Ich überlasse es boq, das hier zu schreiben! +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Auto-Zaubertisch tile.openblocks.autoenchantmenttable.description=Der Auto-Zaubertisch funktioniert ähnlich wie der Vanilla-Zaubertisch, außer dass er mit flüssigen XP arbeitet. Benutze die Tabs auf der rechten Seite des Interfaces, um auszuwählen, von wo Items und XP genommen werden sollen. Genau wie beim Vanilla-Zaubertisch brauchst du Bücherregale, wenn du mit höhere Leveln verzaubern willst. @@ -286,6 +296,7 @@ tile.openblocks.scaffolding.description=Wolltest du jemals irgendwo hochbauen, o tile.openblocks.goldenegg.name=Goldenes Ei tile.openblocks.digitalfuse.name=Digitalzünder + item.openblocks.cursor.name=Cursor item.openblocks.cursor.description=Der Cursor lässt dich aus der Ferne klicken.\nShift-klicke einfach auf einen Block um den Cursor zu verknüpfen, dann benutze ihn, wo immer du willst, um einen Klick auf das ausgewählte Ziel zu simulieren. Sei gewarnt, standardmäßig benutzt der Cursor XP abhängig davon, wie weit du vom Ziel entfernt bist. @@ -295,10 +306,10 @@ item.openblocks.devnull.description=Klicke mit /dev/null, um das Inventar zu öf item.openblocks.slimalyzer.name=Schleimalysierer item.openblocks.slimalyzer.description=Renne mit einem Schleimalysierer in deiner Hand herum, und er wird jedes Mal aufleuchten, wenn du dich in einem Schleime spawnenden Chunk befindest. -item.openblocks.hangglider.name=Gleitschirm -item.openblocks.hangglider.description=Der Gleitschirm ist selbsterklärend. Halte ihn in deiner Hand und klicke, um ihn auf deinem Rücken zu platzieren. Und jetzt spring!\nUm deine Geschwindigkeit zu erhöhen, kannst du Shift drücken, während du gleitest, aber pass auf, du wirst schneller sinken! +item.openblocks.hangglider.name=Hängegleiter +item.openblocks.hangglider.description=Der Hängegleiter ist selbsterklärend. Halte ihn in deiner Hand und klicke, um ihn auf deinem Rücken zu platzieren. Jetzt spring!\nDrücke Shift um während des Gleitens deine Geschwindigkeit zu erhöhen, doch pass auf, du wirst schneller sinken!\n\nDein Hängegleiter ist außerdem mit einem Variometer zur akustischen Indikation vertikaler Luftbewegungen ausgerüstet. Drücke V und bleibe für immer oben (oder bis die Sonne untergeht)! -item.openblocks.gliderwing.name=Gleitschirmflügel +item.openblocks.gliderwing.name=Gleiterflügel item.openblocks.sleepingbag.name=Schlafsack item.openblocks.sleepingbag.description=Mit dem Schlafsack kannst du in der Wildnis schlafen, ohne deine Spawn-Position zurückzusetzen. Um zu schlafen, trage ihn einfach auf dem Rücken. @@ -324,6 +335,9 @@ item.openblocks.crane_backpack.description="Magnet" in der Minecraftwelt ist ein item.openblocks.crane_control.name=Krankontrolle item.openblocks.crane_control.description=Dise drahtlose Hi-Tech-Fernbedienung wird für die Steuerung des Kranrucksacks verwendet.\n\nRechtsklick zum Anheben, Shift-Rechtsklick zum Absenken, Linksklick zum Aufheben/Fallenlassen.\nEine blinkende Leuchte signalisiert, das etwas unter dem Magneten ist. +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + item.openblocks.stencil.name=Schablone item.openblocks.crayon.name=Magischer Buntstift item.openblocks.pencil.name=Magischer Bleistift diff --git a/src/main/resources/assets/openblocks/lang/en_US.lang b/src/main/resources/assets/openblocks/lang/en_US.lang index 4ae298ee..b05d71f7 100644 --- a/src/main/resources/assets/openblocks/lang/en_US.lang +++ b/src/main/resources/assets/openblocks/lang/en_US.lang @@ -6,6 +6,9 @@ achievement.openblocks.stackOverflow.desc=It's full of stars! openblocks.keybind.category=OpenBlocks openblocks.keybind.drop_brick=Be silly +openblocks.keybind.vario_switch=Vario on/off +openblocks.keybind.vario_vol_up=Vario volume up +openblocks.keybind.vario_vol_down=Vario volume down enchantment.openblocks.explosive=Unstable enchantment.openblocks.laststand=Last Stand @@ -257,6 +260,7 @@ tile.openblocks.blockbreaker.description=When given a redstone pulse the block b tile.openblocks.projector.name=Height Map Projector tile.openblocks.projector.description=I'll let you write this one boq! +tile.openblocks.projector.working.name=Height Map Projector tile.openblocks.autoenchantmenttable.name=Auto Enchantment Table tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. @@ -303,7 +307,7 @@ item.openblocks.slimalyzer.name=Slimalyzer item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. item.openblocks.hangglider.name=Hang Glider -item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! +item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster!\n\nYour hang glider now also includes an acoustic variometer indicating vertical air movement. Press V to activate it and stay up forever (or until the sun goes down)! item.openblocks.gliderwing.name=Glider Wing diff --git a/src/main/resources/assets/openblocks/lang/es_AR.lang b/src/main/resources/assets/openblocks/lang/es_AR.lang index 70ded805..6e4ec668 100644 --- a/src/main/resources/assets/openblocks/lang/es_AR.lang +++ b/src/main/resources/assets/openblocks/lang/es_AR.lang @@ -1,12 +1,9 @@ -//** OPENBLOCKS **// - -// Traducido al español por @SamerNieve - achievement.openblocks.droppedBrick=Zoinks! achievement.openblocks.droppedBrick.desc=Lo siento, simplemente ocurrió. stat.openblocks.bricksDropped=Se han caído los ladrillos achievement.openblocks.stackOverflow=Desbordamientos de montones achievement.openblocks.stackOverflow.desc=¡Está lleno de estrellas! + openblocks.keybind.category=OpenBlocks openblocks.keybind.drop_brick=Sé idiota @@ -41,7 +38,6 @@ openblocks.gui.drawingtable=Mesa de Dibujo openblocks.gui.digitalfuse=Detonador Digital openblocks.gui.xp_outputs=Salidas de XP openblocks.gui.item_outputs=Salidas de Objetos -openblocks.gui.watch_video=Ver vídeo openblocks.gui.max_level=Nivel máx.: %d openblocks.gui.save_folder=Guardar carpeta @@ -89,12 +85,14 @@ openblocks.misc.selected_cannon=Cañón seleccionado para apuntar openblocks.misc.pointed_cannon=Cañón apuntado a %s, %s, %s openblocks.misc.change_mode=Cambiando a modo %s openblocks.misc.change_size=Cambiando tamaño a %sx%sx%s +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=Número Total de Bloques: %d openblocks.misc.get_witched=¡Embrújate! openblocks.misc.page=Página %d de %d openblocks.misc.oh_no_ceiling=No puedes dormirte aquí, el techo te inquieta demasiado. openblocks.misc.oh_no_ground=¿¡Quieres dormir encima de ESO!? openblocks.misc.sleeping_bag_broken=Objeto inactivo debido a una fallo en la inicialización. +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## openblocks.misc.grave_msg=%s (día: %.1f) @@ -128,12 +126,16 @@ openblocks.misc.shape=Forma: %s openblocks.misc.shape.sphere=Esfera openblocks.misc.shape.cylinder=Cilindro openblocks.misc.shape.cuboid=Cuboide +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=Cúpula openblocks.misc.shape.triangle=Triángulo openblocks.misc.shape.pentagon=Pentágono openblocks.misc.shape.hexagon=Hexágono openblocks.misc.shape.octagon=Octágono +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.width=Anchura: %d openblocks.misc.height=Altura: %d openblocks.misc.depth=Profundidad: %d @@ -163,6 +165,8 @@ openblocks.misc.command.flim_flam_target=No le gustas a alguien. Alguien con pod openblocks.misc.command.flim_flam_failed=¡La estafa ha fallado! openblocks.misc.command.luck_added=Al jugador %s le ha cambiado la suerte, actualmente: %d openblocks.misc.command.luck_current=Suerte del jugador %s: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Ha ocurrido algo extraño a tu alrededor openblocks.turtle.magnet=Imán @@ -170,12 +174,17 @@ openblocks.turtle.magnet=Imán tile.openblocks.elevator.name=Ascensor tile.openblocks.elevator.description=Coloca un ascensor justo arriba de 3 o más bloques arriba de otro sin ningún bloque entremedias y podrás saltar hacia arriba o agacharte para ir hacia abajo. Los ascensores pueden tintarse haciendo clic con un tinte, sin embargo, solo puedes teletransportarte entre ascensores del mismo color. +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=Curador tile.openblocks.heal.description=El bloque curativo es un bloque creativo que proporciona un leve efecto de curación a través del tiempo. tile.openblocks.guide.name=Guía de Construcción tile.openblocks.guide.description=La guía de construcción te dará un contorno de bloques fantasma de diferentes formas y tamaños que te ayudará a planear tus habitaciones.\nPuedes hacer shift+clic para cambiar el forma, o puedes darle a loas diferentes cara para aumentar o disminuir el tamaño.\nCuando estás en modo creativo puedes colocar un bloque de obsidiana encima, y entonces golpear la guía de construcción con cualquier bloque que quieras para crear una forma automáticamente. +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=Escalera Cansina tile.openblocks.ladder.description=La escalera cansina soluciona ese irritante problema de saltar a través de una trampilla al final de la escalera. La escalera cansina actúa como una trampilla y una escalera al mismo tiempo. @@ -195,6 +204,9 @@ tile.openblocks.sponge.description=Esta esponja es un recambio de la esponja cor item.openblocks.spongeonastick.name=Palo con Esponja item.openblocks.spongeonastick.description=El palo con esponja es una herramienta para limpiar líquidos. Funciona como la Esponja, pero es más móvil a expensas de cansar más. +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Cañón de Objetos tile.openblocks.cannon.description=Cuando se le aplique una señal de redstone, el cañon de objetos disparará los objetos que encuentre en un inventario adyacente. Usa el objeto 'apuntador' para apuntar el cañón. @@ -245,6 +257,7 @@ tile.openblocks.blockbreaker.description=Cuando se le aplique un pulso de redsto tile.openblocks.projector.name=Proyector de Mapas Topográficos tile.openblocks.projector.description=¡Te dejo escribir esta, boq! +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Mesa de Encantamiento Automática tile.openblocks.autoenchantmenttable.description=La mesa de encantamiento automática funciona de forma similar a la mesa de encantamiento corriente excepto por que funciona con XP líquida. Usa las pestañas en la parte derecha de la interfaz para seleccionar de donde se cogen los objetos o la XP. Se necesitan librerías para conseguir mejores encantamientos, justo como con la mesa corriente. @@ -280,6 +293,7 @@ tile.openblocks.scaffolding.description=¿Has querido alguna vez subir hacia el tile.openblocks.goldenegg.name=Huevo Dorado tile.openblocks.digitalfuse.name=Detonador Digital + item.openblocks.cursor.name=Cursor item.openblocks.cursor.description=El cursor te permitirá hacer clic en bloques de forma remota.\nHaz shift+clic en un bloque para enlazarlo al cursor y luego usa el cursor donde quieras para acceder al bloque. Ve con cuidado, por defecto el cursor usa tu XP en relación a cuan lejos estás del bloque enlazado. @@ -318,6 +332,9 @@ item.openblocks.crane_backpack.description=En el mundo Minecraft "imán" es una item.openblocks.crane_control.name=Control de Grúa item.openblocks.crane_control.description=Este mando inalámbrico de alta tecnología se usa para controlar las grúas portatiles.\n\nClic derecho para subir, shift+clic-derecho para bajar y clic izquierdo para coger o soltar.\nLuces intermitentes señalan que algo está en el imán. +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + item.openblocks.stencil.name=Plantilla item.openblocks.crayon.name=Cera Mágica item.openblocks.pencil.name=Lápiz Mágico diff --git a/src/main/resources/assets/openblocks/lang/es_ES.lang b/src/main/resources/assets/openblocks/lang/es_ES.lang index 70ded805..6e4ec668 100644 --- a/src/main/resources/assets/openblocks/lang/es_ES.lang +++ b/src/main/resources/assets/openblocks/lang/es_ES.lang @@ -1,12 +1,9 @@ -//** OPENBLOCKS **// - -// Traducido al español por @SamerNieve - achievement.openblocks.droppedBrick=Zoinks! achievement.openblocks.droppedBrick.desc=Lo siento, simplemente ocurrió. stat.openblocks.bricksDropped=Se han caído los ladrillos achievement.openblocks.stackOverflow=Desbordamientos de montones achievement.openblocks.stackOverflow.desc=¡Está lleno de estrellas! + openblocks.keybind.category=OpenBlocks openblocks.keybind.drop_brick=Sé idiota @@ -41,7 +38,6 @@ openblocks.gui.drawingtable=Mesa de Dibujo openblocks.gui.digitalfuse=Detonador Digital openblocks.gui.xp_outputs=Salidas de XP openblocks.gui.item_outputs=Salidas de Objetos -openblocks.gui.watch_video=Ver vídeo openblocks.gui.max_level=Nivel máx.: %d openblocks.gui.save_folder=Guardar carpeta @@ -89,12 +85,14 @@ openblocks.misc.selected_cannon=Cañón seleccionado para apuntar openblocks.misc.pointed_cannon=Cañón apuntado a %s, %s, %s openblocks.misc.change_mode=Cambiando a modo %s openblocks.misc.change_size=Cambiando tamaño a %sx%sx%s +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=Número Total de Bloques: %d openblocks.misc.get_witched=¡Embrújate! openblocks.misc.page=Página %d de %d openblocks.misc.oh_no_ceiling=No puedes dormirte aquí, el techo te inquieta demasiado. openblocks.misc.oh_no_ground=¿¡Quieres dormir encima de ESO!? openblocks.misc.sleeping_bag_broken=Objeto inactivo debido a una fallo en la inicialización. +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## openblocks.misc.grave_msg=%s (día: %.1f) @@ -128,12 +126,16 @@ openblocks.misc.shape=Forma: %s openblocks.misc.shape.sphere=Esfera openblocks.misc.shape.cylinder=Cilindro openblocks.misc.shape.cuboid=Cuboide +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=Cúpula openblocks.misc.shape.triangle=Triángulo openblocks.misc.shape.pentagon=Pentágono openblocks.misc.shape.hexagon=Hexágono openblocks.misc.shape.octagon=Octágono +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.width=Anchura: %d openblocks.misc.height=Altura: %d openblocks.misc.depth=Profundidad: %d @@ -163,6 +165,8 @@ openblocks.misc.command.flim_flam_target=No le gustas a alguien. Alguien con pod openblocks.misc.command.flim_flam_failed=¡La estafa ha fallado! openblocks.misc.command.luck_added=Al jugador %s le ha cambiado la suerte, actualmente: %d openblocks.misc.command.luck_current=Suerte del jugador %s: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Ha ocurrido algo extraño a tu alrededor openblocks.turtle.magnet=Imán @@ -170,12 +174,17 @@ openblocks.turtle.magnet=Imán tile.openblocks.elevator.name=Ascensor tile.openblocks.elevator.description=Coloca un ascensor justo arriba de 3 o más bloques arriba de otro sin ningún bloque entremedias y podrás saltar hacia arriba o agacharte para ir hacia abajo. Los ascensores pueden tintarse haciendo clic con un tinte, sin embargo, solo puedes teletransportarte entre ascensores del mismo color. +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=Curador tile.openblocks.heal.description=El bloque curativo es un bloque creativo que proporciona un leve efecto de curación a través del tiempo. tile.openblocks.guide.name=Guía de Construcción tile.openblocks.guide.description=La guía de construcción te dará un contorno de bloques fantasma de diferentes formas y tamaños que te ayudará a planear tus habitaciones.\nPuedes hacer shift+clic para cambiar el forma, o puedes darle a loas diferentes cara para aumentar o disminuir el tamaño.\nCuando estás en modo creativo puedes colocar un bloque de obsidiana encima, y entonces golpear la guía de construcción con cualquier bloque que quieras para crear una forma automáticamente. +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=Escalera Cansina tile.openblocks.ladder.description=La escalera cansina soluciona ese irritante problema de saltar a través de una trampilla al final de la escalera. La escalera cansina actúa como una trampilla y una escalera al mismo tiempo. @@ -195,6 +204,9 @@ tile.openblocks.sponge.description=Esta esponja es un recambio de la esponja cor item.openblocks.spongeonastick.name=Palo con Esponja item.openblocks.spongeonastick.description=El palo con esponja es una herramienta para limpiar líquidos. Funciona como la Esponja, pero es más móvil a expensas de cansar más. +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Cañón de Objetos tile.openblocks.cannon.description=Cuando se le aplique una señal de redstone, el cañon de objetos disparará los objetos que encuentre en un inventario adyacente. Usa el objeto 'apuntador' para apuntar el cañón. @@ -245,6 +257,7 @@ tile.openblocks.blockbreaker.description=Cuando se le aplique un pulso de redsto tile.openblocks.projector.name=Proyector de Mapas Topográficos tile.openblocks.projector.description=¡Te dejo escribir esta, boq! +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Mesa de Encantamiento Automática tile.openblocks.autoenchantmenttable.description=La mesa de encantamiento automática funciona de forma similar a la mesa de encantamiento corriente excepto por que funciona con XP líquida. Usa las pestañas en la parte derecha de la interfaz para seleccionar de donde se cogen los objetos o la XP. Se necesitan librerías para conseguir mejores encantamientos, justo como con la mesa corriente. @@ -280,6 +293,7 @@ tile.openblocks.scaffolding.description=¿Has querido alguna vez subir hacia el tile.openblocks.goldenegg.name=Huevo Dorado tile.openblocks.digitalfuse.name=Detonador Digital + item.openblocks.cursor.name=Cursor item.openblocks.cursor.description=El cursor te permitirá hacer clic en bloques de forma remota.\nHaz shift+clic en un bloque para enlazarlo al cursor y luego usa el cursor donde quieras para acceder al bloque. Ve con cuidado, por defecto el cursor usa tu XP en relación a cuan lejos estás del bloque enlazado. @@ -318,6 +332,9 @@ item.openblocks.crane_backpack.description=En el mundo Minecraft "imán" es una item.openblocks.crane_control.name=Control de Grúa item.openblocks.crane_control.description=Este mando inalámbrico de alta tecnología se usa para controlar las grúas portatiles.\n\nClic derecho para subir, shift+clic-derecho para bajar y clic izquierdo para coger o soltar.\nLuces intermitentes señalan que algo está en el imán. +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + item.openblocks.stencil.name=Plantilla item.openblocks.crayon.name=Cera Mágica item.openblocks.pencil.name=Lápiz Mágico diff --git a/src/main/resources/assets/openblocks/lang/es_MX.lang b/src/main/resources/assets/openblocks/lang/es_MX.lang index 70ded805..6e4ec668 100644 --- a/src/main/resources/assets/openblocks/lang/es_MX.lang +++ b/src/main/resources/assets/openblocks/lang/es_MX.lang @@ -1,12 +1,9 @@ -//** OPENBLOCKS **// - -// Traducido al español por @SamerNieve - achievement.openblocks.droppedBrick=Zoinks! achievement.openblocks.droppedBrick.desc=Lo siento, simplemente ocurrió. stat.openblocks.bricksDropped=Se han caído los ladrillos achievement.openblocks.stackOverflow=Desbordamientos de montones achievement.openblocks.stackOverflow.desc=¡Está lleno de estrellas! + openblocks.keybind.category=OpenBlocks openblocks.keybind.drop_brick=Sé idiota @@ -41,7 +38,6 @@ openblocks.gui.drawingtable=Mesa de Dibujo openblocks.gui.digitalfuse=Detonador Digital openblocks.gui.xp_outputs=Salidas de XP openblocks.gui.item_outputs=Salidas de Objetos -openblocks.gui.watch_video=Ver vídeo openblocks.gui.max_level=Nivel máx.: %d openblocks.gui.save_folder=Guardar carpeta @@ -89,12 +85,14 @@ openblocks.misc.selected_cannon=Cañón seleccionado para apuntar openblocks.misc.pointed_cannon=Cañón apuntado a %s, %s, %s openblocks.misc.change_mode=Cambiando a modo %s openblocks.misc.change_size=Cambiando tamaño a %sx%sx%s +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=Número Total de Bloques: %d openblocks.misc.get_witched=¡Embrújate! openblocks.misc.page=Página %d de %d openblocks.misc.oh_no_ceiling=No puedes dormirte aquí, el techo te inquieta demasiado. openblocks.misc.oh_no_ground=¿¡Quieres dormir encima de ESO!? openblocks.misc.sleeping_bag_broken=Objeto inactivo debido a una fallo en la inicialización. +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## openblocks.misc.grave_msg=%s (día: %.1f) @@ -128,12 +126,16 @@ openblocks.misc.shape=Forma: %s openblocks.misc.shape.sphere=Esfera openblocks.misc.shape.cylinder=Cilindro openblocks.misc.shape.cuboid=Cuboide +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=Cúpula openblocks.misc.shape.triangle=Triángulo openblocks.misc.shape.pentagon=Pentágono openblocks.misc.shape.hexagon=Hexágono openblocks.misc.shape.octagon=Octágono +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.width=Anchura: %d openblocks.misc.height=Altura: %d openblocks.misc.depth=Profundidad: %d @@ -163,6 +165,8 @@ openblocks.misc.command.flim_flam_target=No le gustas a alguien. Alguien con pod openblocks.misc.command.flim_flam_failed=¡La estafa ha fallado! openblocks.misc.command.luck_added=Al jugador %s le ha cambiado la suerte, actualmente: %d openblocks.misc.command.luck_current=Suerte del jugador %s: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Ha ocurrido algo extraño a tu alrededor openblocks.turtle.magnet=Imán @@ -170,12 +174,17 @@ openblocks.turtle.magnet=Imán tile.openblocks.elevator.name=Ascensor tile.openblocks.elevator.description=Coloca un ascensor justo arriba de 3 o más bloques arriba de otro sin ningún bloque entremedias y podrás saltar hacia arriba o agacharte para ir hacia abajo. Los ascensores pueden tintarse haciendo clic con un tinte, sin embargo, solo puedes teletransportarte entre ascensores del mismo color. +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=Curador tile.openblocks.heal.description=El bloque curativo es un bloque creativo que proporciona un leve efecto de curación a través del tiempo. tile.openblocks.guide.name=Guía de Construcción tile.openblocks.guide.description=La guía de construcción te dará un contorno de bloques fantasma de diferentes formas y tamaños que te ayudará a planear tus habitaciones.\nPuedes hacer shift+clic para cambiar el forma, o puedes darle a loas diferentes cara para aumentar o disminuir el tamaño.\nCuando estás en modo creativo puedes colocar un bloque de obsidiana encima, y entonces golpear la guía de construcción con cualquier bloque que quieras para crear una forma automáticamente. +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=Escalera Cansina tile.openblocks.ladder.description=La escalera cansina soluciona ese irritante problema de saltar a través de una trampilla al final de la escalera. La escalera cansina actúa como una trampilla y una escalera al mismo tiempo. @@ -195,6 +204,9 @@ tile.openblocks.sponge.description=Esta esponja es un recambio de la esponja cor item.openblocks.spongeonastick.name=Palo con Esponja item.openblocks.spongeonastick.description=El palo con esponja es una herramienta para limpiar líquidos. Funciona como la Esponja, pero es más móvil a expensas de cansar más. +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Cañón de Objetos tile.openblocks.cannon.description=Cuando se le aplique una señal de redstone, el cañon de objetos disparará los objetos que encuentre en un inventario adyacente. Usa el objeto 'apuntador' para apuntar el cañón. @@ -245,6 +257,7 @@ tile.openblocks.blockbreaker.description=Cuando se le aplique un pulso de redsto tile.openblocks.projector.name=Proyector de Mapas Topográficos tile.openblocks.projector.description=¡Te dejo escribir esta, boq! +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Mesa de Encantamiento Automática tile.openblocks.autoenchantmenttable.description=La mesa de encantamiento automática funciona de forma similar a la mesa de encantamiento corriente excepto por que funciona con XP líquida. Usa las pestañas en la parte derecha de la interfaz para seleccionar de donde se cogen los objetos o la XP. Se necesitan librerías para conseguir mejores encantamientos, justo como con la mesa corriente. @@ -280,6 +293,7 @@ tile.openblocks.scaffolding.description=¿Has querido alguna vez subir hacia el tile.openblocks.goldenegg.name=Huevo Dorado tile.openblocks.digitalfuse.name=Detonador Digital + item.openblocks.cursor.name=Cursor item.openblocks.cursor.description=El cursor te permitirá hacer clic en bloques de forma remota.\nHaz shift+clic en un bloque para enlazarlo al cursor y luego usa el cursor donde quieras para acceder al bloque. Ve con cuidado, por defecto el cursor usa tu XP en relación a cuan lejos estás del bloque enlazado. @@ -318,6 +332,9 @@ item.openblocks.crane_backpack.description=En el mundo Minecraft "imán" es una item.openblocks.crane_control.name=Control de Grúa item.openblocks.crane_control.description=Este mando inalámbrico de alta tecnología se usa para controlar las grúas portatiles.\n\nClic derecho para subir, shift+clic-derecho para bajar y clic izquierdo para coger o soltar.\nLuces intermitentes señalan que algo está en el imán. +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + item.openblocks.stencil.name=Plantilla item.openblocks.crayon.name=Cera Mágica item.openblocks.pencil.name=Lápiz Mágico diff --git a/src/main/resources/assets/openblocks/lang/es_UY.lang b/src/main/resources/assets/openblocks/lang/es_UY.lang index 70ded805..6e4ec668 100644 --- a/src/main/resources/assets/openblocks/lang/es_UY.lang +++ b/src/main/resources/assets/openblocks/lang/es_UY.lang @@ -1,12 +1,9 @@ -//** OPENBLOCKS **// - -// Traducido al español por @SamerNieve - achievement.openblocks.droppedBrick=Zoinks! achievement.openblocks.droppedBrick.desc=Lo siento, simplemente ocurrió. stat.openblocks.bricksDropped=Se han caído los ladrillos achievement.openblocks.stackOverflow=Desbordamientos de montones achievement.openblocks.stackOverflow.desc=¡Está lleno de estrellas! + openblocks.keybind.category=OpenBlocks openblocks.keybind.drop_brick=Sé idiota @@ -41,7 +38,6 @@ openblocks.gui.drawingtable=Mesa de Dibujo openblocks.gui.digitalfuse=Detonador Digital openblocks.gui.xp_outputs=Salidas de XP openblocks.gui.item_outputs=Salidas de Objetos -openblocks.gui.watch_video=Ver vídeo openblocks.gui.max_level=Nivel máx.: %d openblocks.gui.save_folder=Guardar carpeta @@ -89,12 +85,14 @@ openblocks.misc.selected_cannon=Cañón seleccionado para apuntar openblocks.misc.pointed_cannon=Cañón apuntado a %s, %s, %s openblocks.misc.change_mode=Cambiando a modo %s openblocks.misc.change_size=Cambiando tamaño a %sx%sx%s +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=Número Total de Bloques: %d openblocks.misc.get_witched=¡Embrújate! openblocks.misc.page=Página %d de %d openblocks.misc.oh_no_ceiling=No puedes dormirte aquí, el techo te inquieta demasiado. openblocks.misc.oh_no_ground=¿¡Quieres dormir encima de ESO!? openblocks.misc.sleeping_bag_broken=Objeto inactivo debido a una fallo en la inicialización. +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## openblocks.misc.grave_msg=%s (día: %.1f) @@ -128,12 +126,16 @@ openblocks.misc.shape=Forma: %s openblocks.misc.shape.sphere=Esfera openblocks.misc.shape.cylinder=Cilindro openblocks.misc.shape.cuboid=Cuboide +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=Cúpula openblocks.misc.shape.triangle=Triángulo openblocks.misc.shape.pentagon=Pentágono openblocks.misc.shape.hexagon=Hexágono openblocks.misc.shape.octagon=Octágono +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.width=Anchura: %d openblocks.misc.height=Altura: %d openblocks.misc.depth=Profundidad: %d @@ -163,6 +165,8 @@ openblocks.misc.command.flim_flam_target=No le gustas a alguien. Alguien con pod openblocks.misc.command.flim_flam_failed=¡La estafa ha fallado! openblocks.misc.command.luck_added=Al jugador %s le ha cambiado la suerte, actualmente: %d openblocks.misc.command.luck_current=Suerte del jugador %s: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Ha ocurrido algo extraño a tu alrededor openblocks.turtle.magnet=Imán @@ -170,12 +174,17 @@ openblocks.turtle.magnet=Imán tile.openblocks.elevator.name=Ascensor tile.openblocks.elevator.description=Coloca un ascensor justo arriba de 3 o más bloques arriba de otro sin ningún bloque entremedias y podrás saltar hacia arriba o agacharte para ir hacia abajo. Los ascensores pueden tintarse haciendo clic con un tinte, sin embargo, solo puedes teletransportarte entre ascensores del mismo color. +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=Curador tile.openblocks.heal.description=El bloque curativo es un bloque creativo que proporciona un leve efecto de curación a través del tiempo. tile.openblocks.guide.name=Guía de Construcción tile.openblocks.guide.description=La guía de construcción te dará un contorno de bloques fantasma de diferentes formas y tamaños que te ayudará a planear tus habitaciones.\nPuedes hacer shift+clic para cambiar el forma, o puedes darle a loas diferentes cara para aumentar o disminuir el tamaño.\nCuando estás en modo creativo puedes colocar un bloque de obsidiana encima, y entonces golpear la guía de construcción con cualquier bloque que quieras para crear una forma automáticamente. +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=Escalera Cansina tile.openblocks.ladder.description=La escalera cansina soluciona ese irritante problema de saltar a través de una trampilla al final de la escalera. La escalera cansina actúa como una trampilla y una escalera al mismo tiempo. @@ -195,6 +204,9 @@ tile.openblocks.sponge.description=Esta esponja es un recambio de la esponja cor item.openblocks.spongeonastick.name=Palo con Esponja item.openblocks.spongeonastick.description=El palo con esponja es una herramienta para limpiar líquidos. Funciona como la Esponja, pero es más móvil a expensas de cansar más. +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Cañón de Objetos tile.openblocks.cannon.description=Cuando se le aplique una señal de redstone, el cañon de objetos disparará los objetos que encuentre en un inventario adyacente. Usa el objeto 'apuntador' para apuntar el cañón. @@ -245,6 +257,7 @@ tile.openblocks.blockbreaker.description=Cuando se le aplique un pulso de redsto tile.openblocks.projector.name=Proyector de Mapas Topográficos tile.openblocks.projector.description=¡Te dejo escribir esta, boq! +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Mesa de Encantamiento Automática tile.openblocks.autoenchantmenttable.description=La mesa de encantamiento automática funciona de forma similar a la mesa de encantamiento corriente excepto por que funciona con XP líquida. Usa las pestañas en la parte derecha de la interfaz para seleccionar de donde se cogen los objetos o la XP. Se necesitan librerías para conseguir mejores encantamientos, justo como con la mesa corriente. @@ -280,6 +293,7 @@ tile.openblocks.scaffolding.description=¿Has querido alguna vez subir hacia el tile.openblocks.goldenegg.name=Huevo Dorado tile.openblocks.digitalfuse.name=Detonador Digital + item.openblocks.cursor.name=Cursor item.openblocks.cursor.description=El cursor te permitirá hacer clic en bloques de forma remota.\nHaz shift+clic en un bloque para enlazarlo al cursor y luego usa el cursor donde quieras para acceder al bloque. Ve con cuidado, por defecto el cursor usa tu XP en relación a cuan lejos estás del bloque enlazado. @@ -318,6 +332,9 @@ item.openblocks.crane_backpack.description=En el mundo Minecraft "imán" es una item.openblocks.crane_control.name=Control de Grúa item.openblocks.crane_control.description=Este mando inalámbrico de alta tecnología se usa para controlar las grúas portatiles.\n\nClic derecho para subir, shift+clic-derecho para bajar y clic izquierdo para coger o soltar.\nLuces intermitentes señalan que algo está en el imán. +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + item.openblocks.stencil.name=Plantilla item.openblocks.crayon.name=Cera Mágica item.openblocks.pencil.name=Lápiz Mágico diff --git a/src/main/resources/assets/openblocks/lang/es_VE.lang b/src/main/resources/assets/openblocks/lang/es_VE.lang index 70ded805..6e4ec668 100644 --- a/src/main/resources/assets/openblocks/lang/es_VE.lang +++ b/src/main/resources/assets/openblocks/lang/es_VE.lang @@ -1,12 +1,9 @@ -//** OPENBLOCKS **// - -// Traducido al español por @SamerNieve - achievement.openblocks.droppedBrick=Zoinks! achievement.openblocks.droppedBrick.desc=Lo siento, simplemente ocurrió. stat.openblocks.bricksDropped=Se han caído los ladrillos achievement.openblocks.stackOverflow=Desbordamientos de montones achievement.openblocks.stackOverflow.desc=¡Está lleno de estrellas! + openblocks.keybind.category=OpenBlocks openblocks.keybind.drop_brick=Sé idiota @@ -41,7 +38,6 @@ openblocks.gui.drawingtable=Mesa de Dibujo openblocks.gui.digitalfuse=Detonador Digital openblocks.gui.xp_outputs=Salidas de XP openblocks.gui.item_outputs=Salidas de Objetos -openblocks.gui.watch_video=Ver vídeo openblocks.gui.max_level=Nivel máx.: %d openblocks.gui.save_folder=Guardar carpeta @@ -89,12 +85,14 @@ openblocks.misc.selected_cannon=Cañón seleccionado para apuntar openblocks.misc.pointed_cannon=Cañón apuntado a %s, %s, %s openblocks.misc.change_mode=Cambiando a modo %s openblocks.misc.change_size=Cambiando tamaño a %sx%sx%s +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=Número Total de Bloques: %d openblocks.misc.get_witched=¡Embrújate! openblocks.misc.page=Página %d de %d openblocks.misc.oh_no_ceiling=No puedes dormirte aquí, el techo te inquieta demasiado. openblocks.misc.oh_no_ground=¿¡Quieres dormir encima de ESO!? openblocks.misc.sleeping_bag_broken=Objeto inactivo debido a una fallo en la inicialización. +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## openblocks.misc.grave_msg=%s (día: %.1f) @@ -128,12 +126,16 @@ openblocks.misc.shape=Forma: %s openblocks.misc.shape.sphere=Esfera openblocks.misc.shape.cylinder=Cilindro openblocks.misc.shape.cuboid=Cuboide +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=Cúpula openblocks.misc.shape.triangle=Triángulo openblocks.misc.shape.pentagon=Pentágono openblocks.misc.shape.hexagon=Hexágono openblocks.misc.shape.octagon=Octágono +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.width=Anchura: %d openblocks.misc.height=Altura: %d openblocks.misc.depth=Profundidad: %d @@ -163,6 +165,8 @@ openblocks.misc.command.flim_flam_target=No le gustas a alguien. Alguien con pod openblocks.misc.command.flim_flam_failed=¡La estafa ha fallado! openblocks.misc.command.luck_added=Al jugador %s le ha cambiado la suerte, actualmente: %d openblocks.misc.command.luck_current=Suerte del jugador %s: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Ha ocurrido algo extraño a tu alrededor openblocks.turtle.magnet=Imán @@ -170,12 +174,17 @@ openblocks.turtle.magnet=Imán tile.openblocks.elevator.name=Ascensor tile.openblocks.elevator.description=Coloca un ascensor justo arriba de 3 o más bloques arriba de otro sin ningún bloque entremedias y podrás saltar hacia arriba o agacharte para ir hacia abajo. Los ascensores pueden tintarse haciendo clic con un tinte, sin embargo, solo puedes teletransportarte entre ascensores del mismo color. +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=Curador tile.openblocks.heal.description=El bloque curativo es un bloque creativo que proporciona un leve efecto de curación a través del tiempo. tile.openblocks.guide.name=Guía de Construcción tile.openblocks.guide.description=La guía de construcción te dará un contorno de bloques fantasma de diferentes formas y tamaños que te ayudará a planear tus habitaciones.\nPuedes hacer shift+clic para cambiar el forma, o puedes darle a loas diferentes cara para aumentar o disminuir el tamaño.\nCuando estás en modo creativo puedes colocar un bloque de obsidiana encima, y entonces golpear la guía de construcción con cualquier bloque que quieras para crear una forma automáticamente. +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=Escalera Cansina tile.openblocks.ladder.description=La escalera cansina soluciona ese irritante problema de saltar a través de una trampilla al final de la escalera. La escalera cansina actúa como una trampilla y una escalera al mismo tiempo. @@ -195,6 +204,9 @@ tile.openblocks.sponge.description=Esta esponja es un recambio de la esponja cor item.openblocks.spongeonastick.name=Palo con Esponja item.openblocks.spongeonastick.description=El palo con esponja es una herramienta para limpiar líquidos. Funciona como la Esponja, pero es más móvil a expensas de cansar más. +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Cañón de Objetos tile.openblocks.cannon.description=Cuando se le aplique una señal de redstone, el cañon de objetos disparará los objetos que encuentre en un inventario adyacente. Usa el objeto 'apuntador' para apuntar el cañón. @@ -245,6 +257,7 @@ tile.openblocks.blockbreaker.description=Cuando se le aplique un pulso de redsto tile.openblocks.projector.name=Proyector de Mapas Topográficos tile.openblocks.projector.description=¡Te dejo escribir esta, boq! +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Mesa de Encantamiento Automática tile.openblocks.autoenchantmenttable.description=La mesa de encantamiento automática funciona de forma similar a la mesa de encantamiento corriente excepto por que funciona con XP líquida. Usa las pestañas en la parte derecha de la interfaz para seleccionar de donde se cogen los objetos o la XP. Se necesitan librerías para conseguir mejores encantamientos, justo como con la mesa corriente. @@ -280,6 +293,7 @@ tile.openblocks.scaffolding.description=¿Has querido alguna vez subir hacia el tile.openblocks.goldenegg.name=Huevo Dorado tile.openblocks.digitalfuse.name=Detonador Digital + item.openblocks.cursor.name=Cursor item.openblocks.cursor.description=El cursor te permitirá hacer clic en bloques de forma remota.\nHaz shift+clic en un bloque para enlazarlo al cursor y luego usa el cursor donde quieras para acceder al bloque. Ve con cuidado, por defecto el cursor usa tu XP en relación a cuan lejos estás del bloque enlazado. @@ -318,6 +332,9 @@ item.openblocks.crane_backpack.description=En el mundo Minecraft "imán" es una item.openblocks.crane_control.name=Control de Grúa item.openblocks.crane_control.description=Este mando inalámbrico de alta tecnología se usa para controlar las grúas portatiles.\n\nClic derecho para subir, shift+clic-derecho para bajar y clic izquierdo para coger o soltar.\nLuces intermitentes señalan que algo está en el imán. +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + item.openblocks.stencil.name=Plantilla item.openblocks.crayon.name=Cera Mágica item.openblocks.pencil.name=Lápiz Mágico diff --git a/src/main/resources/assets/openblocks/lang/et_EE.lang b/src/main/resources/assets/openblocks/lang/et_EE.lang index 52916352..839f5e0a 100644 --- a/src/main/resources/assets/openblocks/lang/et_EE.lang +++ b/src/main/resources/assets/openblocks/lang/et_EE.lang @@ -1,13 +1,25 @@ achievement.openblocks.droppedBrick=Zoinks! achievement.openblocks.droppedBrick.desc=Vabandust, see just juhtus... stat.openblocks.bricksDropped=Telliseid maha visatud +#achievement.openblocks.stackOverflow=Stack Overflow ## NEEDS TRANSLATION ## +#achievement.openblocks.stackOverflow.desc=It's full of stars! ## NEEDS TRANSLATION ## +#openblocks.keybind.category=OpenBlocks ## NEEDS TRANSLATION ## openblocks.keybind.drop_brick=Ole rumal enchantment.openblocks.explosive=Ebastabiilne enchantment.openblocks.laststand=Last Stand enchantment.openblocks.flimflam=Flim Flam +openblocks.gui.blocks=Plokid +openblocks.gui.items=Asjad +openblocks.gui.misc=Muu +#openblocks.gui.changelogs=Changelogs ## NEEDS TRANSLATION ## + +#openblocks.gui.features=Features ## NEEDS TRANSLATION ## +#openblocks.gui.bugfixes=Bugfixes ## NEEDS TRANSLATION ## +#openblocks.gui.tweaks=Tweaks ## NEEDS TRANSLATION ## + openblocks.gui.luggage=Kohver openblocks.gui.sprinkler=Vihmuti openblocks.gui.vacuumhopper=Vaakum Püüdja @@ -23,31 +35,35 @@ openblocks.gui.itemdropper=Asjade Heitja openblocks.gui.blockplacer=Ploki Asetaja openblocks.gui.paintmixer=Värvi Segaja openblocks.gui.drawingtable=Joonistus Laud -openblocks.gui.blocks=Plokid -openblocks.gui.items=Asjad -openblocks.gui.misc=Muu openblocks.gui.digitalfuse=Digital Fuse +#openblocks.gui.xp_outputs=XP Outputs ## NEEDS TRANSLATION ## +#openblocks.gui.item_outputs=Item Outputs ## NEEDS TRANSLATION ## +#openblocks.gui.max_level=Max. Level: %d ## NEEDS TRANSLATION ## +#openblocks.gui.save_folder=Save folder ## NEEDS TRANSLATION ## openblocks.gui.welcome.title=Tere tulemast! -openblocks.gui.welcome.content=OpenBlocks is a new open source mod that introduces a variety of ideas into Minecraft, including hang gliders, elevators, tanks, graves, paints, cranes, liquid XP, cartographers, trophies and more! +#openblocks.gui.welcome.content=OpenBlocks is a new open source mod that introduces a variety of ideas into Minecraft, including hang gliders, elevators, tanks, graves, paints, cranes, liquid XP, cartographers, trophies and more! ## NEEDS TRANSLATION ## openblocks.gui.credits.title=Autorid -openblocks.gui.credits.content=§LBoq, Mikee and NeverCast§R - Juhtivad OpenBlocksi arendajad (are we allowed to credit ourselves?)\n\n§LSinZ and Yoshi2§R - members of the OpenMods team from the start.\n\n§LVexatos and crafteverywhere§R - Regularly translating the mods.\n\nEveryone else who has contributed to the code over the past year.\n\n§LDirewolf20 and the rest of ForgeCraft§R - for putting up with the bugs and crashes before we release.\n\nEveryone who's done spotlights, lets plays and generally supported the mod since we started! +#openblocks.gui.credits.content=§LBoq, Mikee and NeverCast§R - Leading developers of OpenBlocks (are we allowed to credit ourselves?)\n\n§LSinZ and Yoshi2§R - members of the OpenMods team from the start.\n\n§LVexatos and crafteverywhere§R - Regularly translating the mods.\n\nEveryone else who has contributed to the code over the past two years.\n\n§LDirewolf20 and the rest of ForgeCraft§R - for putting up with the bugs and crashes before we release.\n\nEveryone who's done spotlights, lets plays and generally supported the mod since we started! ## NEEDS TRANSLATION ## -openblocks.gui.config.title=Easy Config Editing -openblocks.gui.config.content=OpenMods allow for both client and server config options to be changed from chat commands. Some don't even require restart!\n\nServer config settings can be changed using '§L/om_config_s§R' (op needed) and client config settings can be changed using '§L/om_config_c§R'\n\nFor example:\n\n§L/om_config_s set OpenBlocks dropblock elevatorDrainsXP false§R\n§L/om_config_s save§R\n\nFor a full list of commands type: §L/help om_config_s§R or §L/help om_config_c§R +#openblocks.gui.config.title=Easy Config Editing ## NEEDS TRANSLATION ## +#openblocks.gui.config.content=OpenMods allow for both client and server config options to be changed from chat commands. Some don't even require restart!\n\nServer config settings can be changed using '§L/om_config_s§R' (op needed) and client config settings can be changed using '§L/om_config_c§R'\n\nFor example:\n\n§L/om_config_s set OpenBlocks dropblock elevatorDrainsXP false§R\n§L/om_config_s save§R\n\nFor a full list of commands type: §L/help om_config_s§R or §L/help om_config_c§R ## NEEDS TRANSLATION ## -openblocks.gui.bkey.title=The Infamous 'B' Key -openblocks.gui.bkey.content=The 'B' key is a very special key in OpenBlocks.\n\nEnabling the 'weAreSeriousPeople' config option in the 'tomfoolery' category of both the client and server config files will give you your very own digestive system.\n\nTry eating some of that tasty clay and press 'B' to digest! +#openblocks.gui.restore_inv.title=Inventory backup ## NEEDS TRANSLATION ## +#openblocks.gui.restore_inv.content=Everyone can make mistake. But with §L/ob_inventory§R command you can fix some of them. This command can be used to restore inventory. Backup is created when:\n - player dies\n - grave is spawned \n - player issued command §L/ob_inventory store§R\n\nTo restore inventory you need backup name. Go to folder below or to saves folder on server and look for files named §Linventory-*.dat§R. Then restore inventory with §L/ob_inventory restore §R - where id is either full filename or just middle part, without §Linventory-§R and §L.dat§R. You can also use tab completion. Backups are normal NBT files and can be opened with any editor. ## NEEDS TRANSLATION ## -openblocks.gui.unstable.title=Unstable Enchantment -openblocks.gui.unstable.content=We've had unconfirmed reports that this enchantment causes any gunpowder you're carrying to become unstable when you're attacked or when you jump off something.\n\nUse at your own risk! +#openblocks.gui.bkey.title=The Infamous 'B' Key ## NEEDS TRANSLATION ## +#openblocks.gui.bkey.content=The 'B' key is a very special key in OpenBlocks.\n\nEnabling the 'weAreSeriousPeople' config option in the 'tomfoolery' category of both the client and server config files will give you your very own digestive system.\n\nTry eating some of that tasty clay and press 'B' to digest! ## NEEDS TRANSLATION ## -openblocks.gui.flimflam.title=Flim Flam Enchantment -openblocks.gui.flimflam.content=Scientists have yet to discover the properties of this enchantment. +#openblocks.gui.unstable.title=Unstable Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.unstable.content=We've had unconfirmed reports that this enchantment causes any gunpowder you're carrying to become unstable when you're attacked or when you jump off something.\n\nUse at your own risk! ## NEEDS TRANSLATION ## -openblocks.gui.laststand.title=Last Stand Enchantment -openblocks.gui.laststand.content=The last stand enchantment uses your XP bar as a final protection against dying.\n\nWhen you reach 0.5 hearts, the game will take XP from you whenever you're damaged instead of killing you. The higher number of enchantments you have the cheaper the XP cost will be. +#openblocks.gui.flimflam.title=Flim Flam Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.flimflam.content=Scientists have yet to discover the properties of this enchantment. ## NEEDS TRANSLATION ## + +#openblocks.gui.laststand.title=Last Stand Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.laststand.content=The last stand enchantment uses your XP bar as a final protection against dying.\n\nWhen you reach 0.5 hearts, the game will take XP from you whenever you're damaged instead of killing you. The higher number of enchantments you have the cheaper the XP cost will be. ## NEEDS TRANSLATION ## openblocks.changelog.title=Mida uut on OpenBlocks %s openblocks.misc.url=URL: %s @@ -57,28 +73,72 @@ openblocks.misc.color=Värv: %06X openblocks.misc.mode=Placement mode: %s openblocks.misc.mode.block=Plokk openblocks.misc.mode.panel=Paneel -openblocks.misc.mode.half_panel=Half-height panel +#openblocks.misc.mode.half_panel=Half-height panel ## NEEDS TRANSLATION ## openblocks.misc.mode.stairs=Trepid -openblocks.misc.mode.inverted_block=Inverted Block -openblocks.misc.mode.inverted_panel=Inverted Panel -openblocks.misc.mode.inverted_half_panel=Inverted Half-height panel -openblocks.misc.mode.inverted_stairs=Inverted Stairs -openblocks.misc.structure_pos=Debug: found structure %s at (%d,%d,%d) +#openblocks.misc.mode.inverted_block=Inverted Block ## NEEDS TRANSLATION ## +#openblocks.misc.mode.inverted_panel=Inverted Panel ## NEEDS TRANSLATION ## +#openblocks.misc.mode.inverted_half_panel=Inverted Half-height panel ## NEEDS TRANSLATION ## +#openblocks.misc.mode.inverted_stairs=Inverted Stairs ## NEEDS TRANSLATION ## +#openblocks.misc.structure_pos=Debug: found structure %s at (%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.locked=Lukustatud -openblocks.misc.selected_cannon=Selected cannon for targeting -openblocks.misc.pointed_cannon=Pointed cannon at %s, %s, %s -openblocks.misc.change_mode=Changing to %s mode -openblocks.misc.change_size=Changing size to %sx%sx%s -openblocks.misc.get_witched=Get witched! +#openblocks.misc.selected_cannon=Selected cannon for targeting ## NEEDS TRANSLATION ## +#openblocks.misc.pointed_cannon=Pointed cannon at %s, %s, %s ## NEEDS TRANSLATION ## +#openblocks.misc.change_mode=Changing to %s mode ## NEEDS TRANSLATION ## +#openblocks.misc.change_size=Changing size to %sx%sx%s ## NEEDS TRANSLATION ## +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.total_blocks=Total block count: %d ## NEEDS TRANSLATION ## +#openblocks.misc.get_witched=Get witched! ## NEEDS TRANSLATION ## +#openblocks.misc.page=Page %d of %d ## NEEDS TRANSLATION ## +#openblocks.misc.oh_no_ceiling=You can't fall asleep here. Ceiling disturbs you too much... ## NEEDS TRANSLATION ## +#openblocks.misc.oh_no_ground=You want to sleep on THAT!? ## NEEDS TRANSLATION ## +#openblocks.misc.sleeping_bag_broken=Item inactive due to failed initialization ## NEEDS TRANSLATION ## +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## +#openblocks.misc.grave_msg=%s (day: %.1f) ## NEEDS TRANSLATION ## + +#openblocks.misc.cant_restore_player=Can't restore inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.cant_restore_inventory=Can't restore inventory ## NEEDS TRANSLATION ## +#openblocks.misc.cant_store=Can't store player %s inventory ## NEEDS TRANSLATION ## +#openblocks.misc.invalid_sub_inventory=Can't restore sub inventory %s ## NEEDS TRANSLATION ## +#openblocks.misc.stored_inventory=Stored player inventory to %s ## NEEDS TRANSLATION ## +#openblocks.misc.restored_inventory=Restored inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.invalid_index=Invalid index ## NEEDS TRANSLATION ## +#openblocks.misc.empty_slot=No item in slot ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.tracking_reset=Tracking reset ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.tracking_started=Tracking started ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.start_point=Start point: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.speed=Speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.avg_speed=Average speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.total_distance=Total distance: %s ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.straght_line_distance=Straight line distance: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.straigh_line_speed=Straight line speed: %s ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.last_check_distance=Distance from last check: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.last_check_speed=Last check speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.last_check_time=Time from last check: %d ticks ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.total_time=Total time: %d ticks ## NEEDS TRANSLATION ## + +#openblocks.misc.shape=Shape: %s ## NEEDS TRANSLATION ## openblocks.misc.shape.sphere=Kera openblocks.misc.shape.cylinder=Silinder openblocks.misc.shape.cuboid=Risttahukas +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=Kuppel openblocks.misc.shape.triangle=Kolmnurk openblocks.misc.shape.pentagon=Viisnurk openblocks.misc.shape.hexagon=Kuusnurk openblocks.misc.shape.octagon=Kaheksanurk +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## + +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.width=Width: %d ## NEEDS TRANSLATION ## +#openblocks.misc.height=Height: %d ## NEEDS TRANSLATION ## +#openblocks.misc.depth=Depth: %d ## NEEDS TRANSLATION ## openblocks.misc.radio.too_many=Liiga palju raadioid mängib juba openblocks.misc.radio.invalid_stream=Kehtetu ülekanne @@ -99,184 +159,208 @@ openblocks.misc.side.up=Ülemine külg openblocks.misc.side.down=Alumine külg openblocks.misc.command.invalid=Kehtetud käsu argumendid -openblocks.misc.command.no_flim_flam=Invalid flim-flam name -openblocks.misc.command.flim_flam_source=Player %s had been successfully flim-flammed with %s +#openblocks.misc.command.no_flim_flam=Invalid flim-flam name ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_source=Player %s had been successfully flim-flammed with %s ## NEEDS TRANSLATION ## openblocks.misc.command.flim_flam_target=Sa ei meeldi kellelegi. Kellelegi kellel on võimu -openblocks.misc.command.flim_flam_failed=Flim-flamming failed! +#openblocks.misc.command.flim_flam_failed=Flim-flamming failed! ## NEEDS TRANSLATION ## openblocks.misc.command.luck_added=Luck changed for player %s, current: %d openblocks.misc.command.luck_current=Mängija %s luck: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Midagi veidrat juhtub ümber sinu openblocks.turtle.magnet=Magnet -tile.openblocks.elevator.name=Lift -tile.openblocks.elevator.description=Place one elevator directly three or more blocks above another with no blocks inbetween and you'll be able to either 'jump' to move up, or 'crouch' to move down. Elevators can be dyed by clicking on them with dye, however, you can only teleport between elevators of the same color. +#tile.openblocks.elevator.name=Elevator ## NEEDS TRANSLATION ## +#tile.openblocks.elevator.description=Place one elevator directly three or more blocks above another with no blocks inbetween and you'll be able to either 'jump' to move up, or 'crouch' to move down. Elevators can be dyed by clicking on them with dye, however, you can only teleport between elevators of the same color. ## NEEDS TRANSLATION ## + +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## tile.openblocks.heal.name=Tervendaja -tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. +#tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. ## NEEDS TRANSLATION ## tile.openblocks.guide.name=Ehitaja Juhend -tile.openblocks.guide.description=The building guide will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nYou can shift-click the guide to change the shape, or you can whack the different sides to increase or decrease the size.\nWhen in creative mode you can place an obsdian block above, then hit the building guide with any block you like to automatically create the shape. +#tile.openblocks.guide.description=The building guide, once powered with redstone, will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nUse touch-buttons on block to change outline dimensions and shapes.\nColor of markers can be changed by using dye on central block. ## NEEDS TRANSLATION ## -tile.openblocks.ladder.name=Jaded Ladder -tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## +#tile.openblocks.ladder.name=Jaded Ladder ## NEEDS TRANSLATION ## +#tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. ## NEEDS TRANSLATION ## + +#tile.openblocks.tank.filled.name=%s Tank ## NEEDS TRANSLATION ## tile.openblocks.tank.name=Paak -tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. +#tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. ## NEEDS TRANSLATION ## tile.openblocks.flag.name=Lipp -tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. +#tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. ## NEEDS TRANSLATION ## -tile.openblocks.beartrap.name=Bear Trap -tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! +#tile.openblocks.beartrap.name=Bear Trap ## NEEDS TRANSLATION ## +#tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! ## NEEDS TRANSLATION ## tile.openblocks.sponge.name=Käsn -tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. +#tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. ## NEEDS TRANSLATION ## -tile.openblocks.spongeonastick.name=Käsn -tile.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. +item.openblocks.spongeonastick.name=Käsn +#item.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. ## NEEDS TRANSLATION ## + +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## tile.openblocks.cannon.name=Asjade Kahur -tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. +#tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. ## NEEDS TRANSLATION ## tile.openblocks.ropeladder.name=Köis Redel -tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. +#tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. For every created ladder block it will use one item from stack. ## NEEDS TRANSLATION ## tile.openblocks.sprinkler.name=Vihmuti -tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! +#tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! ## NEEDS TRANSLATION ## tile.openblocks.paintmixer.name=Värvi Segaja -tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! +#tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! ## NEEDS TRANSLATION ## tile.openblocks.canvas.name=Lõuend -tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. +#tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. ## NEEDS TRANSLATION ## tile.openblocks.fan.name=Ventilaator -tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. +#tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. ## NEEDS TRANSLATION ## tile.openblocks.target.name=Sihtmärk -tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the players aim. Give the target a redstone signal to make it pop up! +#tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the player's aim. Give the target a redstone signal to make it pop up! ## NEEDS TRANSLATION ## tile.openblocks.path.name=Tee tile.openblocks.path.description=Tee ei tee midagi. See näeb lihtsalt välja ilus! tile.openblocks.itemDropper.name=Asjade Heitja -tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. +#tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. ## NEEDS TRANSLATION ## tile.openblocks.bigbutton.name=Suur Nupp -tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. +#tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. ## NEEDS TRANSLATION ## tile.openblocks.xpdrain.name=XP Drain -tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. +#tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. ## NEEDS TRANSLATION ## tile.openblocks.vacuumhopper.name=Vaakum Püüdja -tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. +#tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. ## NEEDS TRANSLATION ## tile.openblocks.village_highlighter.name=Village Highlighter -tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! +#tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! ## NEEDS TRANSLATION ## tile.openblocks.donationStation.name=Annetus Jaam -tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. +#tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. ## NEEDS TRANSLATION ## tile.openblocks.blockPlacer.name=Ploki Asetaja -tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. +#tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. ## NEEDS TRANSLATION ## tile.openblocks.blockbreaker.name=Ploki Lõhkuja -tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. +#tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. ## NEEDS TRANSLATION ## -tile.openblocks.projector.name=Height Map Projector -tile.openblocks.projector.description=I'll let you write this one boq! +#tile.openblocks.projector.name=Height Map Projector ## NEEDS TRANSLATION ## +#tile.openblocks.projector.description=I'll let you write this one boq! ## NEEDS TRANSLATION ## +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Automaatne Loitsimislaud -tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. +#tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. ## NEEDS TRANSLATION ## tile.openblocks.xpbottler.name=XP Pudeldaja -tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. +#tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. ## NEEDS TRANSLATION ## tile.openblocks.autoanvil.name=Automaatne Alasi -tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! +#tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! ## NEEDS TRANSLATION ## tile.openblocks.drawingtable.name=Joonistus Laud -tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! +#tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! ## NEEDS TRANSLATION ## tile.openblocks.grave.name=Haud tile.openblocks.trophy.name=Trofee +#tile.openblocks.trophy.entity.name=%s Trophy ## NEEDS TRANSLATION ## tile.openblocks.canvasglass.name=Klaas Lõuend -tile.openblocks.paintcan.name=Paint Can +#tile.openblocks.paintcan.name=Paint Can ## NEEDS TRANSLATION ## -tile.openblocks.sky.normal.name=Sky Block -tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. -tile.openblocks.sky.inverted.name=Inverted Sky Block +#tile.openblocks.sky.normal.name=Sky Block ## NEEDS TRANSLATION ## +#tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. ## NEEDS TRANSLATION ## +#tile.openblocks.sky.inverted.name=Inverted Sky Block ## NEEDS TRANSLATION ## tile.openblocks.radio.name=Raadio -tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. +#tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. ## NEEDS TRANSLATION ## -tile.openblocks.xpshower.name=XP Shower -tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. +#tile.openblocks.xpshower.name=XP Shower ## NEEDS TRANSLATION ## +#tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. ## NEEDS TRANSLATION ## + +#tile.openblocks.scaffolding.name=Scaffolding ## NEEDS TRANSLATION ## +#tile.openblocks.scaffolding.description=Have you ever wanted to pillar up somewhere without leaving an ugly tower behind? Well, now you can! Simply build with scaffolding blocks and they will automatically despawn when you are done. ## NEEDS TRANSLATION ## tile.openblocks.goldenegg.name=Kuldne Muna -tile.openblocks.digitalfuse.name=Digital Fuse +#tile.openblocks.digitalfuse.name=Digital Fuse ## NEEDS TRANSLATION ## + item.openblocks.cursor.name=Kursor -item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. +#item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. ## NEEDS TRANSLATION ## -item.openblocks.devnull.name=/dev/null -item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! +#item.openblocks.devnull.name=/dev/null ## NEEDS TRANSLATION ## +#item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! ## NEEDS TRANSLATION ## -item.openblocks.slimalyzer.name=Slimalyzer -item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. +#item.openblocks.slimalyzer.name=Slimalyzer ## NEEDS TRANSLATION ## +#item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. ## NEEDS TRANSLATION ## item.openblocks.hangglider.name=Deltaplaan -item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! +#item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! ## NEEDS TRANSLATION ## item.openblocks.gliderwing.name=Deltaplaani Tiib item.openblocks.sleepingbag.name=Magamiskott -item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. +#item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. ## NEEDS TRANSLATION ## item.openblocks.luggage.name=Kohver -item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! +#item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! ## NEEDS TRANSLATION ## -item.openblocks.sonicglasses.name=Sonic Glasses -item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! +#item.openblocks.sonicglasses.name=Sonic Glasses ## NEEDS TRANSLATION ## +#item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! ## NEEDS TRANSLATION ## -item.openblocks.squeegee.name=Squeegee -item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! +#item.openblocks.squeegee.name=Squeegee ## NEEDS TRANSLATION ## +#item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! ## NEEDS TRANSLATION ## item.openblocks.paintbrush.name=Pintsel -item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! +#item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! ## NEEDS TRANSLATION ## -item.openblocks.unprepared_stencil.name=Unprepared Stencil -item.openblocks.unprepared_stencil.description="What are these pesky stencils I keep finding in chests?"\n\nStencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. +#item.openblocks.unprepared_stencil.name=Unprepared Stencil ## NEEDS TRANSLATION ## +#item.openblocks.unprepared_stencil.description=Stencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. ## NEEDS TRANSLATION ## -item.openblocks.stencil.name=Stencil -item.openblocks.crayon.name=Magic Crayon -item.openblocks.pencil.name=Magic Pencil -item.openblocks.glasses.pencil.name=Pencil Glasses -item.openblocks.glasses.crayon.name=Crayon Glasses -item.openblocks.glasses.technicolor.name=Amazing Technicolor Glasses -item.openblocks.glasses.admin.name=Badass Glasses -item.openblocks.crane_backpack.name=Crane Backpack -item.openblocks.crane_control.name=Crane Control -item.openblocks.crane_engine.name=Crane Engine -item.openblocks.crane_magnet.name=Crane Magnet -item.openblocks.beam.name=Beam +#item.openblocks.crane_backpack.name=Crane Backpack ## NEEDS TRANSLATION ## +#item.openblocks.crane_backpack.description=In Minecraft world "magnet" is ancient word for "how do this works?".\n\nThis particular piece of very equipment allows you to pick and carry mobs, players, items and blocks. Can be controlled with magnet control. ## NEEDS TRANSLATION ## + +#item.openblocks.crane_control.name=Crane Control ## NEEDS TRANSLATION ## +#item.openblocks.crane_control.description=This hi-tech wireless remote is used for controlling magnet backpacks.\n\nRight click to raise, Sneak + right click to lower, left click to pick/release.\nBlinking light signals something is under magnet. ## NEEDS TRANSLATION ## + +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + +#item.openblocks.stencil.name=Stencil ## NEEDS TRANSLATION ## +#item.openblocks.crayon.name=Magic Crayon ## NEEDS TRANSLATION ## +#item.openblocks.pencil.name=Magic Pencil ## NEEDS TRANSLATION ## +#item.openblocks.glasses.pencil.name=Pencil Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.crayon.name=Crayon Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.technicolor.name=Amazing Technicolor Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.admin.name=Badass Glasses ## NEEDS TRANSLATION ## +#item.openblocks.crane_engine.name=Crane Engine ## NEEDS TRANSLATION ## +#item.openblocks.crane_magnet.name=Crane Magnet ## NEEDS TRANSLATION ## +#item.openblocks.beam.name=Beam ## NEEDS TRANSLATION ## item.openblocks.line.name=Joon -item.openblocks.miracle_magnet.name=§5Ime Magnet§r - +#item.openblocks.miracle_magnet.name=§5Miracle Magnet§r ## NEEDS TRANSLATION ## item.openblocks.info_book.name=Maailma valitsemine OpenBlocksiga item.openblocks.xpbucket.name=XP Ämber item.openblocks.height_map.name=Kõrguse Kaart item.openblocks.empty_map.name=Tühi Kaart -item.openblocks.map_controller.name=Map Controller Module -item.openblocks.map_memory.name=Map Memory Module +#item.openblocks.map_controller.name=Map Controller Module ## NEEDS TRANSLATION ## +#item.openblocks.map_memory.name=Map Memory Module ## NEEDS TRANSLATION ## item.openblocks.cartographer.name=Kartograaf -item.openblocks.assistant_base.name=Assistant's base -item.openblocks.sketching_pencil.name=Sketching Pencil +#item.openblocks.assistant_base.name=Assistant's base ## NEEDS TRANSLATION ## +#item.openblocks.sketching_pencil.name=Sketching Pencil ## NEEDS TRANSLATION ## item.openblocks.tasty_clay.name=Maitsev Savi item.openblocks.golden_eye.name=Kuldne silm item.openblocks.pointer.name=Osutaja -item.openblocks.tuned_crystal.name=Tuned Crystal +#item.openblocks.tuned_crystal.name=Tuned Crystal ## NEEDS TRANSLATION ## +#item.openblocks.pedometer.name=Pedometer ## NEEDS TRANSLATION ## item.openblocks.wallpaper.name=Tapeet @@ -284,7 +368,7 @@ itemGroup.tabOpenBlocks=OpenBlocks entity.OpenBlocks.Luggage.name=Kohver entity.OpenBlocks.Cartographer.name=Kartograaf -entity.OpenBlocks.Block.name=Floating Block +#entity.OpenBlocks.Block.name=Floating Block ## NEEDS TRANSLATION ## entity.OpenBlocks.MiniMe.name=Mini Mina fluid.OpenBlocks.xpjuice=Vedel XP diff --git a/src/main/resources/assets/openblocks/lang/fr_FR.lang b/src/main/resources/assets/openblocks/lang/fr_FR.lang index bf02825c..d72f2ed4 100644 --- a/src/main/resources/assets/openblocks/lang/fr_FR.lang +++ b/src/main/resources/assets/openblocks/lang/fr_FR.lang @@ -38,7 +38,6 @@ openblocks.gui.drawingtable=Table à dessin openblocks.gui.digitalfuse=Fusible numérique openblocks.gui.xp_outputs=Sorties d'XP openblocks.gui.item_outputs=Sorties d'élément -openblocks.gui.watch_video=Regardez la vidéo openblocks.gui.max_level=Niveau maxi. : %d openblocks.gui.save_folder=Dossier de sauvegarde @@ -46,11 +45,14 @@ openblocks.gui.welcome.title=Bienvenu ! openblocks.gui.welcome.content=OpenBlocks est un nouveau mod open source qui introduit une variété d'idées dans Minecraft, dont les planneurs, les ascenceurs, les réservoir, les tombes, les paintures, Les grues, l'XP liquide, les cartographes, les trophées et plus ! openblocks.gui.credits.title=Crédits -openblocks.gui.credits.content=§LBoq, Mikee et NeverCast§R - Développeur principaux d'OpenBlocks (Nous nous permet-on ?)\n\n§LSinZ et Yoshi2§R - membres de OpenMods team depuis le début.\n\n§LVexatos et crafteverywhere§R - Traducteur réguliers du mod.\n\nTous les autres qui ont contribué au code au cours de l'année passée.\n\n§LDirewolf20 et le reste de ForgeCraft§R - Pour supporter les bogues et les accidents avant que nous ne sortions.\n\Tout le monde qui met en lumière, fait des présentation et, généralement, supporte le mod depuis que nous avons commencé ! +openblocks.gui.credits.content=§LBoq, Mikee et NeverCast§R - Développeur principaux d'OpenBlocks (Nous nous permet-on ?)\n\n§LSinZ et Yoshi2§R - membres de OpenMods team depuis le début.\n\n§LVexatos et crafteverywhere§R - Traducteur réguliers du mod.\n\nTous les autres qui ont contribué au code au cours de l'année passée.\n\n§LDirewolf20 et le reste de ForgeCraft§R - Pour supporter les bogues et les accidents avant que nous ne sortions.\nTout le monde qui met en lumière, fait des présentation et, généralement, supporte le mod depuis que nous avons commencé ! openblocks.gui.config.title=Easy Config Editing openblocks.gui.config.content=OpenMods allow for both client and server config options to be changed from chat commands. Some don't even require restart!\n\nServer config settings can be changed using '§L/om_config_s§R' (op needed) and client config settings can be changed using '§L/om_config_c§R'\n\nFor example:\n\n§L/om_config_s set OpenBlocks dropblock elevatorDrainsXP false§R\n§L/om_config_s save§R\n\nFor a full list of commands type: §L/help om_config_s§R or §L/help om_config_c§R +#openblocks.gui.restore_inv.title=Inventory backup ## NEEDS TRANSLATION ## +#openblocks.gui.restore_inv.content=Everyone can make mistake. But with §L/ob_inventory§R command you can fix some of them. This command can be used to restore inventory. Backup is created when:\n - player dies\n - grave is spawned \n - player issued command §L/ob_inventory store§R\n\nTo restore inventory you need backup name. Go to folder below or to saves folder on server and look for files named §Linventory-*.dat§R. Then restore inventory with §L/ob_inventory restore §R - where id is either full filename or just middle part, without §Linventory-§R and §L.dat§R. You can also use tab completion. Backups are normal NBT files and can be opened with any editor. ## NEEDS TRANSLATION ## + openblocks.gui.bkey.title=The Infamous 'B' Key openblocks.gui.bkey.content=The 'B' key is a very special key in OpenBlocks.\n\nEnabling the 'weAreSeriousPeople' config option in the 'tomfoolery' category of both the client and server config files will give you your very own digestive system.\n\nTry eating some of that tasty clay and press 'B' to digest! @@ -83,15 +85,25 @@ openblocks.misc.selected_cannon=Selected cannon for targeting openblocks.misc.pointed_cannon=Pointed cannon at %s, %s, %s openblocks.misc.change_mode=Changing to %s mode openblocks.misc.change_size=Changing size to %sx%sx%s +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=Total block count: %d openblocks.misc.get_witched=Get witched! openblocks.misc.page=Page %d of %d openblocks.misc.oh_no_ceiling=You can't fall asleep here. Ceiling disturbs you too much... +#openblocks.misc.oh_no_ground=You want to sleep on THAT!? ## NEEDS TRANSLATION ## +#openblocks.misc.sleeping_bag_broken=Item inactive due to failed initialization ## NEEDS TRANSLATION ## +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## -openblocks.misc.cant_restore=Can't restore inventory for player %s +#openblocks.misc.grave_msg=%s (day: %.1f) ## NEEDS TRANSLATION ## + +#openblocks.misc.cant_restore_player=Can't restore inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.cant_restore_inventory=Can't restore inventory ## NEEDS TRANSLATION ## openblocks.misc.cant_store=Can't store player %s inventory +#openblocks.misc.invalid_sub_inventory=Can't restore sub inventory %s ## NEEDS TRANSLATION ## openblocks.misc.stored_inventory=Stored player inventory to %s openblocks.misc.restored_inventory=Restored inventory for player %s +#openblocks.misc.invalid_index=Invalid index ## NEEDS TRANSLATION ## +#openblocks.misc.empty_slot=No item in slot ## NEEDS TRANSLATION ## openblocks.misc.pedometer.tracking_reset=Tracking reset openblocks.misc.pedometer.tracking_started=Tracking started @@ -110,14 +122,23 @@ openblocks.misc.pedometer.last_check_time=Time from last check %d ticks openblocks.misc.pedometer.total_time=Total time: %d ticks +#openblocks.misc.shape=Shape: %s ## NEEDS TRANSLATION ## openblocks.misc.shape.sphere=Sphere openblocks.misc.shape.cylinder=Cylinder openblocks.misc.shape.cuboid=Cuboid +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=Dome openblocks.misc.shape.triangle=Triangle openblocks.misc.shape.pentagon=Pentagon openblocks.misc.shape.hexagon=Hexagon openblocks.misc.shape.octagon=Octagon +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## + +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.width=Width: %d ## NEEDS TRANSLATION ## +#openblocks.misc.height=Height: %d ## NEEDS TRANSLATION ## +#openblocks.misc.depth=Depth: %d ## NEEDS TRANSLATION ## openblocks.misc.radio.too_many=Too many radios already playing openblocks.misc.radio.invalid_stream=Invalid stream @@ -144,163 +165,187 @@ openblocks.misc.command.flim_flam_target=Someone doesn't like you. Someone with openblocks.misc.command.flim_flam_failed=Flim-flamming failed! openblocks.misc.command.luck_added=Luck changed for player %s, current: %d openblocks.misc.command.luck_current=Player %s luck: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Something weird happens around you openblocks.turtle.magnet=Magnet -tile.openblocks.elevator.name=Elevator -tile.openblocks.elevator.description=Place one elevator directly three or more blocks above another with no blocks inbetween and you'll be able to either 'jump' to move up, or 'crouch' to move down. Elevators can be dyed by clicking on them with dye, however, you can only teleport between elevators of the same color. +#tile.openblocks.elevator.name=Elevator ## NEEDS TRANSLATION ## +#tile.openblocks.elevator.description=Place one elevator directly three or more blocks above another with no blocks inbetween and you'll be able to either 'jump' to move up, or 'crouch' to move down. Elevators can be dyed by clicking on them with dye, however, you can only teleport between elevators of the same color. ## NEEDS TRANSLATION ## -tile.openblocks.heal.name=Healer -tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## -tile.openblocks.guide.name=Building Guide -tile.openblocks.guide.description=The building guide will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nYou can shift-click the guide to change the shape, or you can whack the different sides to increase or decrease the size.\nWhen in creative mode you can place an obsdian block above, then hit the building guide with any block you like to automatically create the shape. +#tile.openblocks.heal.name=Healer ## NEEDS TRANSLATION ## +#tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. ## NEEDS TRANSLATION ## -tile.openblocks.ladder.name=Jaded Ladder -tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. +#tile.openblocks.guide.name=Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.guide.description=The building guide, once powered with redstone, will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nUse touch-buttons on block to change outline dimensions and shapes.\nColor of markers can be changed by using dye on central block. ## NEEDS TRANSLATION ## -tile.openblocks.tank.name=Tank -tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## -tile.openblocks.flag.name=Flag -tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. +#tile.openblocks.ladder.name=Jaded Ladder ## NEEDS TRANSLATION ## +#tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. ## NEEDS TRANSLATION ## -tile.openblocks.beartrap.name=Bear Trap -tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! +#tile.openblocks.tank.filled.name=%s Tank ## NEEDS TRANSLATION ## +#tile.openblocks.tank.name=Tank ## NEEDS TRANSLATION ## +#tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. ## NEEDS TRANSLATION ## -tile.openblocks.sponge.name=Sponge -tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. +#tile.openblocks.flag.name=Flag ## NEEDS TRANSLATION ## +#tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. ## NEEDS TRANSLATION ## -item.openblocks.spongeonastick.name=Sponge -item.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. +#tile.openblocks.beartrap.name=Bear Trap ## NEEDS TRANSLATION ## +#tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! ## NEEDS TRANSLATION ## -tile.openblocks.cannon.name=Item Cannon -tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. +#tile.openblocks.sponge.name=Sponge ## NEEDS TRANSLATION ## +#tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. ## NEEDS TRANSLATION ## -tile.openblocks.ropeladder.name=Rope Ladder -tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. +#item.openblocks.spongeonastick.name=Sponge ## NEEDS TRANSLATION ## +#item.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. ## NEEDS TRANSLATION ## -tile.openblocks.sprinkler.name=Sprinkler -tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## -tile.openblocks.paintmixer.name=Paint Mixer -tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! +#tile.openblocks.cannon.name=Item Cannon ## NEEDS TRANSLATION ## +#tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. ## NEEDS TRANSLATION ## -tile.openblocks.canvas.name=Canvas -tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. +#tile.openblocks.ropeladder.name=Rope Ladder ## NEEDS TRANSLATION ## +#tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. For every created ladder block it will use one item from stack. ## NEEDS TRANSLATION ## -tile.openblocks.fan.name=Fan -tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. +#tile.openblocks.sprinkler.name=Sprinkler ## NEEDS TRANSLATION ## +#tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! ## NEEDS TRANSLATION ## -tile.openblocks.target.name=Target -tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the players aim. Give the target a redstone signal to make it pop up! +#tile.openblocks.paintmixer.name=Paint Mixer ## NEEDS TRANSLATION ## +#tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! ## NEEDS TRANSLATION ## -tile.openblocks.path.name=Path -tile.openblocks.path.description=The path doesn't do anything. It just looks nice! +#tile.openblocks.canvas.name=Canvas ## NEEDS TRANSLATION ## +#tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. ## NEEDS TRANSLATION ## -tile.openblocks.itemDropper.name=Item Dropper -tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. +#tile.openblocks.fan.name=Fan ## NEEDS TRANSLATION ## +#tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. ## NEEDS TRANSLATION ## -tile.openblocks.bigbutton.name=Big Button -tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. +#tile.openblocks.target.name=Target ## NEEDS TRANSLATION ## +#tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the player's aim. Give the target a redstone signal to make it pop up! ## NEEDS TRANSLATION ## -tile.openblocks.xpdrain.name=XP Drain -tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. +#tile.openblocks.path.name=Path ## NEEDS TRANSLATION ## +#tile.openblocks.path.description=The path doesn't do anything. It just looks nice! ## NEEDS TRANSLATION ## -tile.openblocks.vacuumhopper.name=Vacuum Hopper -tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. +#tile.openblocks.itemDropper.name=Item Dropper ## NEEDS TRANSLATION ## +#tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. ## NEEDS TRANSLATION ## -tile.openblocks.village_highlighter.name=Village Highlighter -tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! +#tile.openblocks.bigbutton.name=Big Button ## NEEDS TRANSLATION ## +#tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. ## NEEDS TRANSLATION ## -tile.openblocks.donationStation.name=Donation Station -tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. +#tile.openblocks.xpdrain.name=XP Drain ## NEEDS TRANSLATION ## +#tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. ## NEEDS TRANSLATION ## -tile.openblocks.blockPlacer.name=Block Placer -tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. +#tile.openblocks.vacuumhopper.name=Vacuum Hopper ## NEEDS TRANSLATION ## +#tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. ## NEEDS TRANSLATION ## -tile.openblocks.blockbreaker.name=Block Breaker -tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. +#tile.openblocks.village_highlighter.name=Village Highlighter ## NEEDS TRANSLATION ## +#tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! ## NEEDS TRANSLATION ## -tile.openblocks.projector.name=Height Map Projector -tile.openblocks.projector.description=I'll let you write this one boq! +#tile.openblocks.donationStation.name=Donation Station ## NEEDS TRANSLATION ## +#tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. ## NEEDS TRANSLATION ## -tile.openblocks.autoenchantmenttable.name=Auto Enchantment Table -tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. +#tile.openblocks.blockPlacer.name=Block Placer ## NEEDS TRANSLATION ## +#tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. ## NEEDS TRANSLATION ## -tile.openblocks.xpbottler.name=XP Bottler -tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. +#tile.openblocks.blockbreaker.name=Block Breaker ## NEEDS TRANSLATION ## +#tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. ## NEEDS TRANSLATION ## -tile.openblocks.autoanvil.name=Auto Anvil -tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! +#tile.openblocks.projector.name=Height Map Projector ## NEEDS TRANSLATION ## +#tile.openblocks.projector.description=I'll let you write this one boq! ## NEEDS TRANSLATION ## +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## -tile.openblocks.drawingtable.name=Drawing Table -tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! +#tile.openblocks.autoenchantmenttable.name=Auto Enchantment Table ## NEEDS TRANSLATION ## +#tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. ## NEEDS TRANSLATION ## -tile.openblocks.grave.name=Grave -tile.openblocks.trophy.name=Trophy -tile.openblocks.canvasglass.name=Glass Canvas -tile.openblocks.paintcan.name=Paint Can +#tile.openblocks.xpbottler.name=XP Bottler ## NEEDS TRANSLATION ## +#tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. ## NEEDS TRANSLATION ## -tile.openblocks.sky.normal.name=Sky Block -tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. -tile.openblocks.sky.inverted.name=Inverted Sky Block +#tile.openblocks.autoanvil.name=Auto Anvil ## NEEDS TRANSLATION ## +#tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! ## NEEDS TRANSLATION ## -tile.openblocks.radio.name=Radio -tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. +#tile.openblocks.drawingtable.name=Drawing Table ## NEEDS TRANSLATION ## +#tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! ## NEEDS TRANSLATION ## -tile.openblocks.xpshower.name=XP Shower -tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. +#tile.openblocks.grave.name=Grave ## NEEDS TRANSLATION ## +#tile.openblocks.trophy.name=Trophy ## NEEDS TRANSLATION ## +#tile.openblocks.trophy.entity.name=%s Trophy ## NEEDS TRANSLATION ## +#tile.openblocks.canvasglass.name=Glass Canvas ## NEEDS TRANSLATION ## +#tile.openblocks.paintcan.name=Paint Can ## NEEDS TRANSLATION ## -tile.openblocks.goldenegg.name=Golden Egg +#tile.openblocks.sky.normal.name=Sky Block ## NEEDS TRANSLATION ## +#tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. ## NEEDS TRANSLATION ## +#tile.openblocks.sky.inverted.name=Inverted Sky Block ## NEEDS TRANSLATION ## -tile.openblocks.digitalfuse.name=Digital Fuse -item.openblocks.cursor.name=Cursor -item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. +#tile.openblocks.radio.name=Radio ## NEEDS TRANSLATION ## +#tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. ## NEEDS TRANSLATION ## -item.openblocks.devnull.name=/dev/null -item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! +#tile.openblocks.xpshower.name=XP Shower ## NEEDS TRANSLATION ## +#tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. ## NEEDS TRANSLATION ## -item.openblocks.slimalyzer.name=Slimalyzer -item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. +#tile.openblocks.scaffolding.name=Scaffolding ## NEEDS TRANSLATION ## +#tile.openblocks.scaffolding.description=Have you ever wanted to pillar up somewhere without leaving an ugly tower behind? Well, now you can! Simply build with scaffolding blocks and they will automatically despawn when you are done. ## NEEDS TRANSLATION ## -item.openblocks.hangglider.name=Hang Glider -item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! +#tile.openblocks.goldenegg.name=Golden Egg ## NEEDS TRANSLATION ## -item.openblocks.gliderwing.name=Glider Wing +#tile.openblocks.digitalfuse.name=Digital Fuse ## NEEDS TRANSLATION ## -item.openblocks.sleepingbag.name=Sleeping Bag -item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. +#item.openblocks.cursor.name=Cursor ## NEEDS TRANSLATION ## +#item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. ## NEEDS TRANSLATION ## -item.openblocks.luggage.name=Luggage -item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! +#item.openblocks.devnull.name=/dev/null ## NEEDS TRANSLATION ## +#item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! ## NEEDS TRANSLATION ## -item.openblocks.sonicglasses.name=Sonic Glasses -item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! +#item.openblocks.slimalyzer.name=Slimalyzer ## NEEDS TRANSLATION ## +#item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. ## NEEDS TRANSLATION ## -item.openblocks.squeegee.name=Squeegee -item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! +#item.openblocks.hangglider.name=Hang Glider ## NEEDS TRANSLATION ## +#item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! ## NEEDS TRANSLATION ## -item.openblocks.paintbrush.name=Paint Brush -item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! +#item.openblocks.gliderwing.name=Glider Wing ## NEEDS TRANSLATION ## -item.openblocks.unprepared_stencil.name=Unprepared Stencil -item.openblocks.unprepared_stencil.description="What are these pesky stencils I keep finding in chests?"\n\nStencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. +#item.openblocks.sleepingbag.name=Sleeping Bag ## NEEDS TRANSLATION ## +#item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. ## NEEDS TRANSLATION ## -item.openblocks.stencil.name=Stencil -item.openblocks.crayon.name=Magic Crayon -item.openblocks.pencil.name=Magic Pencil -item.openblocks.glasses.pencil.name=Pencil Glasses -item.openblocks.glasses.crayon.name=Crayon Glasses -item.openblocks.glasses.technicolor.name=Amazing Technicolor Glasses -item.openblocks.glasses.admin.name=Badass Glasses -item.openblocks.crane_backpack.name=Crane Backpack -item.openblocks.crane_control.name=Crane Control -item.openblocks.crane_engine.name=Crane Engine -item.openblocks.crane_magnet.name=Crane Magnet -item.openblocks.beam.name=Beam -item.openblocks.line.name=Line +#item.openblocks.luggage.name=Luggage ## NEEDS TRANSLATION ## +#item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! ## NEEDS TRANSLATION ## + +#item.openblocks.sonicglasses.name=Sonic Glasses ## NEEDS TRANSLATION ## +#item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! ## NEEDS TRANSLATION ## + +#item.openblocks.squeegee.name=Squeegee ## NEEDS TRANSLATION ## +#item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! ## NEEDS TRANSLATION ## + +#item.openblocks.paintbrush.name=Paint Brush ## NEEDS TRANSLATION ## +#item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! ## NEEDS TRANSLATION ## + +#item.openblocks.unprepared_stencil.name=Unprepared Stencil ## NEEDS TRANSLATION ## +#item.openblocks.unprepared_stencil.description=Stencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. ## NEEDS TRANSLATION ## + +#item.openblocks.crane_backpack.name=Crane Backpack ## NEEDS TRANSLATION ## +#item.openblocks.crane_backpack.description=In Minecraft world "magnet" is ancient word for "how do this works?".\n\nThis particular piece of very equipment allows you to pick and carry mobs, players, items and blocks. Can be controlled with magnet control. ## NEEDS TRANSLATION ## + +#item.openblocks.crane_control.name=Crane Control ## NEEDS TRANSLATION ## +#item.openblocks.crane_control.description=This hi-tech wireless remote is used for controlling magnet backpacks.\n\nRight click to raise, Sneak + right click to lower, left click to pick/release.\nBlinking light signals something is under magnet. ## NEEDS TRANSLATION ## + +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + +#item.openblocks.stencil.name=Stencil ## NEEDS TRANSLATION ## +#item.openblocks.crayon.name=Magic Crayon ## NEEDS TRANSLATION ## +#item.openblocks.pencil.name=Magic Pencil ## NEEDS TRANSLATION ## +#item.openblocks.glasses.pencil.name=Pencil Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.crayon.name=Crayon Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.technicolor.name=Amazing Technicolor Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.admin.name=Badass Glasses ## NEEDS TRANSLATION ## +#item.openblocks.crane_engine.name=Crane Engine ## NEEDS TRANSLATION ## +#item.openblocks.crane_magnet.name=Crane Magnet ## NEEDS TRANSLATION ## +#item.openblocks.beam.name=Beam ## NEEDS TRANSLATION ## +#item.openblocks.line.name=Line ## NEEDS TRANSLATION ## item.openblocks.miracle_magnet.name=§5Aimant de Miracle§r item.openblocks.info_book.name=Domination du monde avec OpenBlocks item.openblocks.xpbucket.name=XP Seau @@ -314,16 +359,16 @@ item.openblocks.sketching_pencil.name=Esquisse Crayon item.openblocks.tasty_clay.name=Savoureux Argile item.openblocks.golden_eye.name=D'or œil item.openblocks.pointer.name=Aiguille -item.openblocks.tuned_crystal.name=Tuned Crystal -item.openblocks.pedometer.name=Pedometer +#item.openblocks.tuned_crystal.name=Tuned Crystal ## NEEDS TRANSLATION ## +#item.openblocks.pedometer.name=Pedometer ## NEEDS TRANSLATION ## -item.openblocks.wallpaper.name=Wallpaper +#item.openblocks.wallpaper.name=Wallpaper ## NEEDS TRANSLATION ## itemGroup.tabOpenBlocks=OpenBlocks -entity.OpenBlocks.Luggage.name=Luggage -entity.OpenBlocks.Cartographer.name=Cartographer -entity.OpenBlocks.Block.name=Floating Block -entity.OpenBlocks.MiniMe.name=Mini Me +#entity.OpenBlocks.Luggage.name=Luggage ## NEEDS TRANSLATION ## +#entity.OpenBlocks.Cartographer.name=Cartographer ## NEEDS TRANSLATION ## +#entity.OpenBlocks.Block.name=Floating Block ## NEEDS TRANSLATION ## +#entity.OpenBlocks.MiniMe.name=Mini Me ## NEEDS TRANSLATION ## -fluid.OpenBlocks.xpjuice=Liquid XP +#fluid.OpenBlocks.xpjuice=Liquid XP ## NEEDS TRANSLATION ## diff --git a/src/main/resources/assets/openblocks/lang/it_IT.lang b/src/main/resources/assets/openblocks/lang/it_IT.lang index 5230c8cc..76cded4c 100644 --- a/src/main/resources/assets/openblocks/lang/it_IT.lang +++ b/src/main/resources/assets/openblocks/lang/it_IT.lang @@ -38,7 +38,6 @@ openblocks.gui.drawingtable=Tavolo da Disegno openblocks.gui.digitalfuse=Innesco digitale openblocks.gui.xp_outputs=Emissione di Punti Esperienza openblocks.gui.item_outputs=Emissione di Oggetti -openblocks.gui.watch_video=Guarda video openblocks.gui.max_level=Livello massimo: %d openblocks.gui.save_folder=Cartella di salvataggio @@ -52,7 +51,7 @@ openblocks.gui.config.title=Facili Modifiche della Configurazione openblocks.gui.config.content=OpenMods permette sia alle opzioni di configurazione del client sia a quelle del server di essere modificate da comandi in chat. Alcune non hanno nemmeno bisogno di un riavvio!\n\nLe impostazioni di configurazione del server possono essere modificate usando '§l/om_config_s§r' (OP necessario) e le impostazioni di configurazione del client possono essere modificate con '§l/om_config_c§r'\n\nPer esempio:\n\n§l/om_config_s set OpenBlocks dropblock elevatorDrainsXP false§r\n§l/om_config_s save§r\n\nPer una lista completa dei comandi scrivi: §l/help om_config_s§r or §l/help om_config_c§r openblocks.gui.restore_inv.title=Backup dell'Inventario -openblocks.gui.restore_inv.content=Ognuno può fare degli errori. Ma con il comando §l/ob_inventory§r si può rimediare ad alcuni. Questo comando può essere usato per ripristinare l'inventario. Il backup viene creato quando:\n - un giocatore muore\n - una tomba appare \n\ - un giocatore esegue il comando §l/ob_inventory store§r\n\nPer ripristinare l'inventario si ha bisogno del nome del backup. Vai nella cartella sotto o nella cartella dei salvataggi sul server e cerca dei file chiamati §linventory-*.dat§r. Poi ripristina l'inventario con §l/ob_inventory restore §r - dove id è o il nome del file completo o solo la parte centrale, senza §linventory-§r e §l.dat§r. Si può anche usare il completamento automatico (TAB). I backup sono dei normali file NBT e possono essere aperti con ogni editor. +openblocks.gui.restore_inv.content=Ognuno può fare degli errori. Ma con il comando §l/ob_inventory§r si può rimediare ad alcuni. Questo comando può essere usato per ripristinare l'inventario. Il backup viene creato quando:\n - un giocatore muore\n - una tomba appare \n - un giocatore esegue il comando §l/ob_inventory store§r\n\nPer ripristinare l'inventario si ha bisogno del nome del backup. Vai nella cartella sotto o nella cartella dei salvataggi sul server e cerca dei file chiamati §linventory-*.dat§r. Poi ripristina l'inventario con §l/ob_inventory restore §r - dove id è o il nome del file completo o solo la parte centrale, senza §linventory-§r e §l.dat§r. Si può anche usare il completamento automatico (TAB). I backup sono dei normali file NBT e possono essere aperti con ogni editor. openblocks.gui.bkey.title=L'infamante tasto 'B' openblocks.gui.bkey.content=Il tasto 'B' è un tasto molto speciale in OpenBlocks.\n\nL'abilitazione dell'opzione di configurazione 'weAreSeriousPeople' nella categoria 'tomfoolery' sia nel file di configurazione del client sia in quello del server ti darà il tuo personale sistema digestivo.\n\nProva a mangiare un po' di quella gustosa argilla e poi premi 'B' per digerire! @@ -93,6 +92,7 @@ openblocks.misc.page=Pagina %d di %d openblocks.misc.oh_no_ceiling=Non ti puoi addormentare lì. Il soffitto ti disturba troppo... openblocks.misc.oh_no_ground=Vuoi dormire su QUEL COSO!? openblocks.misc.sleeping_bag_broken=Oggetto disattivato in quanto l'inizializzazione è fallita +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## openblocks.misc.grave_msg=%s (Giorno: %.1f) @@ -257,6 +257,7 @@ tile.openblocks.blockbreaker.description=Quando gli viene fornito un impulso di tile.openblocks.projector.name=Proiettore della Mappa di Altitudine tile.openblocks.projector.description=Ti lascio scrivere questa, boq! +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Tavolo da Incantamento Automatico tile.openblocks.autoenchantmenttable.description=Il tavolo da incantamento automatico funziona in una maniera simile al tavolo da incantamento Vanilla, eccetto che funziona con l'Esperienza Liquida. Usa le schede sul lato destro dell'interfaccia per selezionare dove gli oggetti o i punti esperienza verranno presi. Esattamente come il tavolo da incantamento Vanilla, sono richieste le librerie per avere livelli di incantamento maggiori. @@ -323,7 +324,7 @@ item.openblocks.paintbrush.name=Pennello item.openblocks.paintbrush.description=I pennelli ti permettono di dipingere i blocchi con ogni colore che vuoi!\n\nPicchietta il tuo pennello su una Lattina di Pittura fatta nel Miscelatore di Pittura, poi clicca su un blocco per dipingerlo.\n\nI blocchi di Tela sono perfetti per dipingere, ma puoi anche dipingere un bel po' di blocchi Vanilla e anche alcuni blocchi di altre mod. Puoi anche piazzare degli stampi sui blocchi e poi dipingere sullo stampo! item.openblocks.unprepared_stencil.name=Stampo non Preparato -item.openblocks.unprepared_stencil.description=Gli stampi possono essere piazzati sui blocchi e poi dipinti sui blocchi usando i pennello!\n\nPuoi dipingere un blocco usando stampi multipli e puoi cliccare su di essi con una mano vuota per ruotarli.\b\bPiazza uno Stampo non Preparato in un Tavolo da Disegno per creare diversi motivi. +item.openblocks.unprepared_stencil.description=Gli stampi possono essere piazzati sui blocchi e poi dipinti sui blocchi usando i pennello!\n\nPuoi dipingere un blocco usando stampi multipli e puoi cliccare su di essi con una mano vuota per ruotarli. Piazza uno Stampo non Preparato in un Tavolo da Disegno per creare diversi motivi. item.openblocks.crane_backpack.name=Zaino della Gru item.openblocks.crane_backpack.description=Nel mondo di Minecraft, "magnete" è un'antica parola per "questo come funzionano?".\n\nQuesto particolare pezzo di vero equipaggiamento ti permette di prendere e trasportare mob, giocatori, oggetti e blocchi. Può essere controllato con il controllore del magnete. @@ -334,7 +335,6 @@ item.openblocks.crane_control.description=Questo telecomando wireless ad alta te item.openblocks.wrench.name=Grande Barra di Metallo item.openblocks.wrench.description=Questo strumento estremamente sofisticato è usato per trasformare oggetti con simmetria ottaedra.\n\n\nO semplicemente un grande e stupido pezzo di metallo che puoi usare per ruotare cubi e altre cose.\n\nQuinfi sì, è semplicemente un'altra chiave inglese. Sto solo cercando di essere originale, ok? - item.openblocks.stencil.name=Stampo item.openblocks.crayon.name=Pastello Magico item.openblocks.pencil.name=Matita Magica diff --git a/src/main/resources/assets/openblocks/lang/ko_KR.lang b/src/main/resources/assets/openblocks/lang/ko_KR.lang index ec12ffb0..619c9742 100644 --- a/src/main/resources/assets/openblocks/lang/ko_KR.lang +++ b/src/main/resources/assets/openblocks/lang/ko_KR.lang @@ -1,6 +1,8 @@ achievement.openblocks.droppedBrick=Zoinks! achievement.openblocks.droppedBrick.desc=Sorry, it just happened... stat.openblocks.bricksDropped=Bricks dropped +#achievement.openblocks.stackOverflow=Stack Overflow ## NEEDS TRANSLATION ## +#achievement.openblocks.stackOverflow.desc=It's full of stars! ## NEEDS TRANSLATION ## openblocks.keybind.category=오픈블럭 openblocks.keybind.drop_brick=바보 @@ -36,8 +38,8 @@ openblocks.gui.drawingtable=Drawing Table openblocks.gui.digitalfuse=Digital Fuse openblocks.gui.xp_outputs=경험치 추출 openblocks.gui.item_outputs=아이템 추출 -openblocks.gui.watch_video=비디오 보기 openblocks.gui.max_level=최대 레벨: %d +#openblocks.gui.save_folder=Save folder ## NEEDS TRANSLATION ## openblocks.gui.welcome.title=어서오세요! openblocks.gui.welcome.content=OpenBlocks는 행글라이더, 엘리베이터, 탱크, 무덤, 페인트, 크레인, 액체 XP, 지도, 트로피 등외에도 많은것들을 추가하는 오픈 소스 모드입니다! @@ -48,6 +50,9 @@ openblocks.gui.credits.content=§LBoq, Mikee and NeverCast§R - 오픈블럭 매 openblocks.gui.config.title=쉬운 설정 변경 openblocks.gui.config.content=OpenMods커맨드로 설정을 재로드 할수 있으며 마인크래프트를 재실행할 필요가 없습니다!\n\n서버 설정은 '§L/om_config_s§R'에서 할 수 있습니다 (op권한 필요) 클라이언트 설정은 '§L/om_config_c§R'에서 하실 수 있습니다.\n\n예제:\n\n§L/om_config_s set OpenBlocks dropblock elevatorDrainsXP false§R\n§L/om_config_s save§R\n\nFor a full list of commands type: §L/help om_config_s§R or §L/help om_config_c§R +#openblocks.gui.restore_inv.title=Inventory backup ## NEEDS TRANSLATION ## +#openblocks.gui.restore_inv.content=Everyone can make mistake. But with §L/ob_inventory§R command you can fix some of them. This command can be used to restore inventory. Backup is created when:\n - player dies\n - grave is spawned \n - player issued command §L/ob_inventory store§R\n\nTo restore inventory you need backup name. Go to folder below or to saves folder on server and look for files named §Linventory-*.dat§R. Then restore inventory with §L/ob_inventory restore §R - where id is either full filename or just middle part, without §Linventory-§R and §L.dat§R. You can also use tab completion. Backups are normal NBT files and can be opened with any editor. ## NEEDS TRANSLATION ## + openblocks.gui.bkey.title=특수키 'B(ㅠ)' openblocks.gui.bkey.content=오픈블럭에서 'B(ㅠ)'키는 정말 특별한 키입니다.\n\n모든 서버/클라이언트 설정파일의 'weAreSeriousPeople' 부분의 옵션을 'tomfoolery' 로 설정하실경우 자신에게 소화시스템을 제공합니다.\n\n점토를 먹은후 'B(ㅠ)'키를 눌러보세요! @@ -58,7 +63,7 @@ openblocks.gui.flimflam.title=허튼소리 마법부여 openblocks.gui.flimflam.content=과학자들은 마법부여의 속성을 발견하지 못하고있어요 openblocks.gui.laststand.title=최후의안정 마법부여 -openblocks.gui.laststand.content최후의안정 마법부여는 당신의 죽지 않도록 도와줍니다. 체력이 0.5하트이하 일때 당신의 XP를 사용하여 채력을 회복합니다. +openblocks.gui.laststand.content=최후의안정 마법부여는 당신의 죽지 않도록 도와줍니다. 체력이 0.5하트이하 일때 당신의 XP를 사용하여 채력을 회복합니다. openblocks.changelog.title=새로운 오픈블럭에는 무엇이 있을까? %s openblocks.misc.url=URL: %s @@ -80,15 +85,25 @@ openblocks.misc.selected_cannon=대포가 쏠 위치를 결정 openblocks.misc.pointed_cannon=대포의 발사위치 %s, %s, %s openblocks.misc.change_mode=%s 모드로 변경 openblocks.misc.change_size=%sx%sx%s크기로 변경 +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=총 블럭 갯수: %d openblocks.misc.get_witched=마녀를 얻었다! openblocks.misc.page=%d 중 %d 페이지 openblocks.misc.oh_no_ceiling=이곳에서 잠들 수 없습니다. 윗부분의 블럭이 방해합니다. +#openblocks.misc.oh_no_ground=You want to sleep on THAT!? ## NEEDS TRANSLATION ## +#openblocks.misc.sleeping_bag_broken=Item inactive due to failed initialization ## NEEDS TRANSLATION ## +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## -openblocks.misc.cant_restore=플레이어의 인벤토리를 복원할 수 없습니다. : %s +#openblocks.misc.grave_msg=%s (day: %.1f) ## NEEDS TRANSLATION ## + +#openblocks.misc.cant_restore_player=Can't restore inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.cant_restore_inventory=Can't restore inventory ## NEEDS TRANSLATION ## openblocks.misc.cant_store=%s플레이어의 인벤토리를 복원할 수 없습니다. +#openblocks.misc.invalid_sub_inventory=Can't restore sub inventory %s ## NEEDS TRANSLATION ## openblocks.misc.stored_inventory=플레이어의 인벤토리를 복원했습니다. : %s openblocks.misc.restored_inventory=%s플레이어의 인벤토리를 복원했습니다. +#openblocks.misc.invalid_index=Invalid index ## NEEDS TRANSLATION ## +#openblocks.misc.empty_slot=No item in slot ## NEEDS TRANSLATION ## openblocks.misc.pedometer.tracking_reset=추적 리셋 openblocks.misc.pedometer.tracking_started=추적 시작 @@ -107,14 +122,23 @@ openblocks.misc.pedometer.last_check_time=%d틱 전에 마지막으로 속도를 openblocks.misc.pedometer.total_time=총 시간: %d 틱 +#openblocks.misc.shape=Shape: %s ## NEEDS TRANSLATION ## openblocks.misc.shape.sphere=구체 openblocks.misc.shape.cylinder=실린더 openblocks.misc.shape.cuboid=큐브 +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=돔 openblocks.misc.shape.triangle=삼각형 openblocks.misc.shape.pentagon=오각형 openblocks.misc.shape.hexagon=육각형 openblocks.misc.shape.octagon=8각형 +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## + +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.width=Width: %d ## NEEDS TRANSLATION ## +#openblocks.misc.height=Height: %d ## NEEDS TRANSLATION ## +#openblocks.misc.depth=Depth: %d ## NEEDS TRANSLATION ## openblocks.misc.radio.too_many=Too many radios already playing openblocks.misc.radio.invalid_stream=잘못된 스트림 @@ -141,6 +165,8 @@ openblocks.misc.command.flim_flam_target=Someone doesn't like you. Someone with openblocks.misc.command.flim_flam_failed=Flim-flamming failed! openblocks.misc.command.luck_added=Luck changed for player %s, current: %d openblocks.misc.command.luck_current=Player %s luck: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Something weird happens around you openblocks.turtle.magnet=자석 @@ -148,171 +174,193 @@ openblocks.turtle.magnet=자석 tile.openblocks.elevator.name=엘레베이터 tile.openblocks.elevator.description=엘레베이터를 놓은 자리에서 위에 1블럭 아래1블럭이 없고 2블럭 이상(이하)에 엘레베이터 블럭이 있는경우 그곳으로 이동 할 수 있습니다. 올라가기위해선 '점프' 내려가기 위해선 '웅크리기'를 하시면 됩니다. +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=힐러 -tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. +#tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. ## NEEDS TRANSLATION ## tile.openblocks.guide.name=건축 가이드 -tile.openblocks.guide.description=The building guide will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nYou can shift-click the guide to change the shape, or you can whack the different sides to increase or decrease the size.\nWhen in creative mode you can place an obsdian block above, then hit the building guide with any block you like to automatically create the shape. +#tile.openblocks.guide.description=The building guide, once powered with redstone, will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nUse touch-buttons on block to change outline dimensions and shapes.\nColor of markers can be changed by using dye on central block. ## NEEDS TRANSLATION ## + +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## tile.openblocks.ladder.name=물린 사다리 -tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. +#tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. ## NEEDS TRANSLATION ## +#tile.openblocks.tank.filled.name=%s Tank ## NEEDS TRANSLATION ## tile.openblocks.tank.name=탱크 -tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. +#tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. ## NEEDS TRANSLATION ## tile.openblocks.flag.name=깃발 -tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. +#tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. ## NEEDS TRANSLATION ## tile.openblocks.beartrap.name=곰 덫 -tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! +#tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! ## NEEDS TRANSLATION ## tile.openblocks.sponge.name=스폰지 -tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. +#tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. ## NEEDS TRANSLATION ## item.openblocks.spongeonastick.name=스폰지 -item.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. +#item.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. ## NEEDS TRANSLATION ## + +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## tile.openblocks.cannon.name=아이템 대포 -tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. +#tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. ## NEEDS TRANSLATION ## tile.openblocks.ropeladder.name=로프 사다리 -tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. +#tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. For every created ladder block it will use one item from stack. ## NEEDS TRANSLATION ## tile.openblocks.sprinkler.name=스프링쿨러 -tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! +#tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! ## NEEDS TRANSLATION ## tile.openblocks.paintmixer.name=패인트 믹서 -tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! +#tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! ## NEEDS TRANSLATION ## tile.openblocks.canvas.name=캔버스 -tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. +#tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. ## NEEDS TRANSLATION ## tile.openblocks.fan.name=선풍기 -tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. +#tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. ## NEEDS TRANSLATION ## -tile.openblocks.target.name=Target -tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the players aim. Give the target a redstone signal to make it pop up! +#tile.openblocks.target.name=Target ## NEEDS TRANSLATION ## +#tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the player's aim. Give the target a redstone signal to make it pop up! ## NEEDS TRANSLATION ## -tile.openblocks.path.name=Path -tile.openblocks.path.description=The path doesn't do anything. It just looks nice! +#tile.openblocks.path.name=Path ## NEEDS TRANSLATION ## +#tile.openblocks.path.description=The path doesn't do anything. It just looks nice! ## NEEDS TRANSLATION ## -tile.openblocks.itemDropper.name=Item Dropper -tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. +#tile.openblocks.itemDropper.name=Item Dropper ## NEEDS TRANSLATION ## +#tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. ## NEEDS TRANSLATION ## tile.openblocks.bigbutton.name=큰 버튼 -tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. +#tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. ## NEEDS TRANSLATION ## tile.openblocks.xpdrain.name=XP 흡수기 -tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. +#tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. ## NEEDS TRANSLATION ## tile.openblocks.vacuumhopper.name=진공 깔때기 -tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. +#tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. ## NEEDS TRANSLATION ## tile.openblocks.village_highlighter.name=마을 표시기 -tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! +#tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! ## NEEDS TRANSLATION ## -tile.openblocks.donationStation.name=Donation Station -tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. +#tile.openblocks.donationStation.name=Donation Station ## NEEDS TRANSLATION ## +#tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. ## NEEDS TRANSLATION ## tile.openblocks.blockPlacer.name=블럭 설치기 -tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. +#tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. ## NEEDS TRANSLATION ## tile.openblocks.blockbreaker.name=블럭 파괴기 -tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. +#tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. ## NEEDS TRANSLATION ## -tile.openblocks.projector.name=Height Map Projector -tile.openblocks.projector.description=I'll let you write this one boq! +#tile.openblocks.projector.name=Height Map Projector ## NEEDS TRANSLATION ## +#tile.openblocks.projector.description=I'll let you write this one boq! ## NEEDS TRANSLATION ## +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=자동 인첸트테이블 -tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. +#tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. ## NEEDS TRANSLATION ## tile.openblocks.xpbottler.name=경험치병 제조기 -tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. +#tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. ## NEEDS TRANSLATION ## tile.openblocks.autoanvil.name=자동 모루 -tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! +#tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! ## NEEDS TRANSLATION ## tile.openblocks.drawingtable.name=제도용 책상 -tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! +#tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! ## NEEDS TRANSLATION ## tile.openblocks.grave.name=묘지 tile.openblocks.trophy.name=트로피 +#tile.openblocks.trophy.entity.name=%s Trophy ## NEEDS TRANSLATION ## tile.openblocks.canvasglass.name=유리 캔버스 tile.openblocks.paintcan.name=패인트 통 tile.openblocks.sky.normal.name=하늘 블럭 -tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. -tile.openblocks.sky.inverted.name=Inverted Sky Block +#tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. ## NEEDS TRANSLATION ## +#tile.openblocks.sky.inverted.name=Inverted Sky Block ## NEEDS TRANSLATION ## tile.openblocks.radio.name=라디오 -tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. +#tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. ## NEEDS TRANSLATION ## tile.openblocks.xpshower.name=XP 샤워기 -tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. +#tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. ## NEEDS TRANSLATION ## + +#tile.openblocks.scaffolding.name=Scaffolding ## NEEDS TRANSLATION ## +#tile.openblocks.scaffolding.description=Have you ever wanted to pillar up somewhere without leaving an ugly tower behind? Well, now you can! Simply build with scaffolding blocks and they will automatically despawn when you are done. ## NEEDS TRANSLATION ## tile.openblocks.goldenegg.name=금 알 -tile.openblocks.digitalfuse.name=Digital Fuse -item.openblocks.cursor.name=커서 -item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. +#tile.openblocks.digitalfuse.name=Digital Fuse ## NEEDS TRANSLATION ## -item.openblocks.devnull.name=/dev/null -item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! +item.openblocks.cursor.name=커서 +#item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. ## NEEDS TRANSLATION ## + +#item.openblocks.devnull.name=/dev/null ## NEEDS TRANSLATION ## +#item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! ## NEEDS TRANSLATION ## item.openblocks.slimalyzer.name=슬라임 탐지기 -item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. +#item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. ## NEEDS TRANSLATION ## item.openblocks.hangglider.name=행글라이더 -item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! +#item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! ## NEEDS TRANSLATION ## item.openblocks.gliderwing.name=행글라이더 날개 item.openblocks.sleepingbag.name=침낭 -item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. +#item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. ## NEEDS TRANSLATION ## item.openblocks.luggage.name=여행용 짐가방 -item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! +#item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! ## NEEDS TRANSLATION ## -item.openblocks.sonicglasses.name=Sonic Glasses -item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! +#item.openblocks.sonicglasses.name=Sonic Glasses ## NEEDS TRANSLATION ## +#item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! ## NEEDS TRANSLATION ## -item.openblocks.squeegee.name=Squeegee -item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! +#item.openblocks.squeegee.name=Squeegee ## NEEDS TRANSLATION ## +#item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! ## NEEDS TRANSLATION ## item.openblocks.paintbrush.name=패인트 붓 -item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! +#item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! ## NEEDS TRANSLATION ## -item.openblocks.unprepared_stencil.name=Unprepared Stencil -item.openblocks.unprepared_stencil.description="What are these pesky stencils I keep finding in chests?"\n\nStencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. +#item.openblocks.unprepared_stencil.name=Unprepared Stencil ## NEEDS TRANSLATION ## +#item.openblocks.unprepared_stencil.description=Stencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. ## NEEDS TRANSLATION ## + +item.openblocks.crane_backpack.name=크레인 가방 +#item.openblocks.crane_backpack.description=In Minecraft world "magnet" is ancient word for "how do this works?".\n\nThis particular piece of very equipment allows you to pick and carry mobs, players, items and blocks. Can be controlled with magnet control. ## NEEDS TRANSLATION ## + +item.openblocks.crane_control.name=크레인 조작기 +#item.openblocks.crane_control.description=This hi-tech wireless remote is used for controlling magnet backpacks.\n\nRight click to raise, Sneak + right click to lower, left click to pick/release.\nBlinking light signals something is under magnet. ## NEEDS TRANSLATION ## + +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## item.openblocks.stencil.name=형판 item.openblocks.crayon.name=마법의 크래용 item.openblocks.pencil.name=마법의 연필 item.openblocks.glasses.pencil.name=연필 안경 item.openblocks.glasses.crayon.name=크래용 안경 -item.openblocks.glasses.technicolor.name=Amazing Technicolor Glasses -item.openblocks.glasses.admin.name=Badass Glasses -item.openblocks.crane_backpack.name=크레인 가방 -item.openblocks.crane_control.name=크레인 조작기 +#item.openblocks.glasses.technicolor.name=Amazing Technicolor Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.admin.name=Badass Glasses ## NEEDS TRANSLATION ## item.openblocks.crane_engine.name=크레인 엔진 item.openblocks.crane_magnet.name=크레인 자석 -item.openblocks.beam.name=Beam -item.openblocks.line.name=Line +#item.openblocks.beam.name=Beam ## NEEDS TRANSLATION ## +#item.openblocks.line.name=Line ## NEEDS TRANSLATION ## item.openblocks.miracle_magnet.name=§5기적의 자석§r item.openblocks.info_book.name=Openblocks는 세계를 지배한다!! item.openblocks.xpbucket.name=XP 양동이 -item.openblocks.height_map.name=Height Map +#item.openblocks.height_map.name=Height Map ## NEEDS TRANSLATION ## item.openblocks.empty_map.name=비어있는 맵 item.openblocks.map_controller.name=맵 조작 모듈 item.openblocks.map_memory.name=맵 메모리 모듈 item.openblocks.cartographer.name=제작자 -item.openblocks.assistant_base.name=Assistant's base -item.openblocks.sketching_pencil.name=Sketching Pencil +#item.openblocks.assistant_base.name=Assistant's base ## NEEDS TRANSLATION ## +#item.openblocks.sketching_pencil.name=Sketching Pencil ## NEEDS TRANSLATION ## item.openblocks.tasty_clay.name=맛있는 점토 item.openblocks.golden_eye.name=금눈 item.openblocks.pointer.name=포인터 -item.openblocks.tuned_crystal.name=Tuned Crystal -item.openblocks.pedometer.name=Pedometer +#item.openblocks.tuned_crystal.name=Tuned Crystal ## NEEDS TRANSLATION ## +#item.openblocks.pedometer.name=Pedometer ## NEEDS TRANSLATION ## item.openblocks.wallpaper.name=달력 diff --git a/src/main/resources/assets/openblocks/lang/nl_NL.lang b/src/main/resources/assets/openblocks/lang/nl_NL.lang index 26b88caa..999c1cb6 100644 --- a/src/main/resources/assets/openblocks/lang/nl_NL.lang +++ b/src/main/resources/assets/openblocks/lang/nl_NL.lang @@ -1,21 +1,374 @@ -#nl_NL +#achievement.openblocks.droppedBrick=Zoinks! ## NEEDS TRANSLATION ## +#achievement.openblocks.droppedBrick.desc=Sorry, it just happened... ## NEEDS TRANSLATION ## +#stat.openblocks.bricksDropped=Bricks dropped ## NEEDS TRANSLATION ## +#achievement.openblocks.stackOverflow=Stack Overflow ## NEEDS TRANSLATION ## +#achievement.openblocks.stackOverflow.desc=It's full of stars! ## NEEDS TRANSLATION ## + +#openblocks.keybind.category=OpenBlocks ## NEEDS TRANSLATION ## +#openblocks.keybind.drop_brick=Be silly ## NEEDS TRANSLATION ## + +#enchantment.openblocks.explosive=Unstable ## NEEDS TRANSLATION ## +#enchantment.openblocks.laststand=Last Stand ## NEEDS TRANSLATION ## +#enchantment.openblocks.flimflam=Flim Flam ## NEEDS TRANSLATION ## + +#openblocks.gui.blocks=Blocks ## NEEDS TRANSLATION ## +#openblocks.gui.items=Items ## NEEDS TRANSLATION ## +#openblocks.gui.misc=Miscellanea ## NEEDS TRANSLATION ## +#openblocks.gui.changelogs=Changelogs ## NEEDS TRANSLATION ## + +#openblocks.gui.features=Features ## NEEDS TRANSLATION ## +#openblocks.gui.bugfixes=Bugfixes ## NEEDS TRANSLATION ## +#openblocks.gui.tweaks=Tweaks ## NEEDS TRANSLATION ## + openblocks.gui.luggage=Bagage openblocks.gui.sprinkler=Sproeier +#openblocks.gui.vacuumhopper=Vacuum Hopper ## NEEDS TRANSLATION ## +#openblocks.gui.bigbutton=Big Button ## NEEDS TRANSLATION ## +#openblocks.gui.xpbottler=XP Bottler ## NEEDS TRANSLATION ## +#openblocks.gui.autoanvil=Auto Anvil ## NEEDS TRANSLATION ## +#openblocks.gui.autoeject=Auto eject ## NEEDS TRANSLATION ## +#openblocks.gui.autoextract=Auto extract ## NEEDS TRANSLATION ## +#openblocks.gui.autodrink=Auto drink ## NEEDS TRANSLATION ## +#openblocks.gui.autoenchantmenttable=Auto Enchantment Table ## NEEDS TRANSLATION ## +#openblocks.gui.donationstation=Donation Station ## NEEDS TRANSLATION ## +#openblocks.gui.itemdropper=Item Dropper ## NEEDS TRANSLATION ## +#openblocks.gui.blockplacer=Block Placer ## NEEDS TRANSLATION ## +#openblocks.gui.paintmixer=Paint Mixer ## NEEDS TRANSLATION ## +#openblocks.gui.drawingtable=Drawing Table ## NEEDS TRANSLATION ## +#openblocks.gui.digitalfuse=Digital Fuse ## NEEDS TRANSLATION ## +#openblocks.gui.xp_outputs=XP Outputs ## NEEDS TRANSLATION ## +#openblocks.gui.item_outputs=Item Outputs ## NEEDS TRANSLATION ## +#openblocks.gui.max_level=Max. Level: %d ## NEEDS TRANSLATION ## +#openblocks.gui.save_folder=Save folder ## NEEDS TRANSLATION ## + +#openblocks.gui.welcome.title=Welcome! ## NEEDS TRANSLATION ## +#openblocks.gui.welcome.content=OpenBlocks is a new open source mod that introduces a variety of ideas into Minecraft, including hang gliders, elevators, tanks, graves, paints, cranes, liquid XP, cartographers, trophies and more! ## NEEDS TRANSLATION ## + +#openblocks.gui.credits.title=Credits ## NEEDS TRANSLATION ## +#openblocks.gui.credits.content=§LBoq, Mikee and NeverCast§R - Leading developers of OpenBlocks (are we allowed to credit ourselves?)\n\n§LSinZ and Yoshi2§R - members of the OpenMods team from the start.\n\n§LVexatos and crafteverywhere§R - Regularly translating the mods.\n\nEveryone else who has contributed to the code over the past two years.\n\n§LDirewolf20 and the rest of ForgeCraft§R - for putting up with the bugs and crashes before we release.\n\nEveryone who's done spotlights, lets plays and generally supported the mod since we started! ## NEEDS TRANSLATION ## + +#openblocks.gui.config.title=Easy Config Editing ## NEEDS TRANSLATION ## +#openblocks.gui.config.content=OpenMods allow for both client and server config options to be changed from chat commands. Some don't even require restart!\n\nServer config settings can be changed using '§L/om_config_s§R' (op needed) and client config settings can be changed using '§L/om_config_c§R'\n\nFor example:\n\n§L/om_config_s set OpenBlocks dropblock elevatorDrainsXP false§R\n§L/om_config_s save§R\n\nFor a full list of commands type: §L/help om_config_s§R or §L/help om_config_c§R ## NEEDS TRANSLATION ## + +#openblocks.gui.restore_inv.title=Inventory backup ## NEEDS TRANSLATION ## +#openblocks.gui.restore_inv.content=Everyone can make mistake. But with §L/ob_inventory§R command you can fix some of them. This command can be used to restore inventory. Backup is created when:\n - player dies\n - grave is spawned \n - player issued command §L/ob_inventory store§R\n\nTo restore inventory you need backup name. Go to folder below or to saves folder on server and look for files named §Linventory-*.dat§R. Then restore inventory with §L/ob_inventory restore §R - where id is either full filename or just middle part, without §Linventory-§R and §L.dat§R. You can also use tab completion. Backups are normal NBT files and can be opened with any editor. ## NEEDS TRANSLATION ## + +#openblocks.gui.bkey.title=The Infamous 'B' Key ## NEEDS TRANSLATION ## +#openblocks.gui.bkey.content=The 'B' key is a very special key in OpenBlocks.\n\nEnabling the 'weAreSeriousPeople' config option in the 'tomfoolery' category of both the client and server config files will give you your very own digestive system.\n\nTry eating some of that tasty clay and press 'B' to digest! ## NEEDS TRANSLATION ## + +#openblocks.gui.unstable.title=Unstable Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.unstable.content=We've had unconfirmed reports that this enchantment causes any gunpowder you're carrying to become unstable when you're attacked or when you jump off something.\n\nUse at your own risk! ## NEEDS TRANSLATION ## + +#openblocks.gui.flimflam.title=Flim Flam Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.flimflam.content=Scientists have yet to discover the properties of this enchantment. ## NEEDS TRANSLATION ## + +#openblocks.gui.laststand.title=Last Stand Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.laststand.content=The last stand enchantment uses your XP bar as a final protection against dying.\n\nWhen you reach 0.5 hearts, the game will take XP from you whenever you're damaged instead of killing you. The higher number of enchantments you have the cheaper the XP cost will be. ## NEEDS TRANSLATION ## + +#openblocks.changelog.title=What's new in OpenBlocks %s ## NEEDS TRANSLATION ## +#openblocks.misc.url=URL: %s ## NEEDS TRANSLATION ## +#openblocks.misc.type=Type: %s ## NEEDS TRANSLATION ## +#openblocks.misc.uses=Uses: %.2f ## NEEDS TRANSLATION ## +#openblocks.misc.color=Color: %06X ## NEEDS TRANSLATION ## +#openblocks.misc.mode=Placement mode: %s ## NEEDS TRANSLATION ## +#openblocks.misc.mode.block=Block ## NEEDS TRANSLATION ## +#openblocks.misc.mode.panel=Panel ## NEEDS TRANSLATION ## +#openblocks.misc.mode.half_panel=Half-height panel ## NEEDS TRANSLATION ## +#openblocks.misc.mode.stairs=Stairs ## NEEDS TRANSLATION ## +#openblocks.misc.mode.inverted_block=Inverted Block ## NEEDS TRANSLATION ## +#openblocks.misc.mode.inverted_panel=Inverted Panel ## NEEDS TRANSLATION ## +#openblocks.misc.mode.inverted_half_panel=Inverted Half-height panel ## NEEDS TRANSLATION ## +#openblocks.misc.mode.inverted_stairs=Inverted Stairs ## NEEDS TRANSLATION ## +#openblocks.misc.structure_pos=Debug: found structure %s at (%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.locked=Locked ## NEEDS TRANSLATION ## +#openblocks.misc.selected_cannon=Selected cannon for targeting ## NEEDS TRANSLATION ## +#openblocks.misc.pointed_cannon=Pointed cannon at %s, %s, %s ## NEEDS TRANSLATION ## +#openblocks.misc.change_mode=Changing to %s mode ## NEEDS TRANSLATION ## +#openblocks.misc.change_size=Changing size to %sx%sx%s ## NEEDS TRANSLATION ## +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.total_blocks=Total block count: %d ## NEEDS TRANSLATION ## +#openblocks.misc.get_witched=Get witched! ## NEEDS TRANSLATION ## +#openblocks.misc.page=Page %d of %d ## NEEDS TRANSLATION ## +#openblocks.misc.oh_no_ceiling=You can't fall asleep here. Ceiling disturbs you too much... ## NEEDS TRANSLATION ## +#openblocks.misc.oh_no_ground=You want to sleep on THAT!? ## NEEDS TRANSLATION ## +#openblocks.misc.sleeping_bag_broken=Item inactive due to failed initialization ## NEEDS TRANSLATION ## +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## + +#openblocks.misc.grave_msg=%s (day: %.1f) ## NEEDS TRANSLATION ## + +#openblocks.misc.cant_restore_player=Can't restore inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.cant_restore_inventory=Can't restore inventory ## NEEDS TRANSLATION ## +#openblocks.misc.cant_store=Can't store player %s inventory ## NEEDS TRANSLATION ## +#openblocks.misc.invalid_sub_inventory=Can't restore sub inventory %s ## NEEDS TRANSLATION ## +#openblocks.misc.stored_inventory=Stored player inventory to %s ## NEEDS TRANSLATION ## +#openblocks.misc.restored_inventory=Restored inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.invalid_index=Invalid index ## NEEDS TRANSLATION ## +#openblocks.misc.empty_slot=No item in slot ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.tracking_reset=Tracking reset ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.tracking_started=Tracking started ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.start_point=Start point: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.speed=Speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.avg_speed=Average speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.total_distance=Total distance: %s ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.straght_line_distance=Straight line distance: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.straigh_line_speed=Straight line speed: %s ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.last_check_distance=Distance from last check: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.last_check_speed=Last check speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.last_check_time=Time from last check: %d ticks ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.total_time=Total time: %d ticks ## NEEDS TRANSLATION ## + +#openblocks.misc.shape=Shape: %s ## NEEDS TRANSLATION ## +#openblocks.misc.shape.sphere=Sphere ## NEEDS TRANSLATION ## +#openblocks.misc.shape.cylinder=Cylinder ## NEEDS TRANSLATION ## +#openblocks.misc.shape.cuboid=Cuboid ## NEEDS TRANSLATION ## +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## +#openblocks.misc.shape.dome=Dome ## NEEDS TRANSLATION ## +#openblocks.misc.shape.triangle=Triangle ## NEEDS TRANSLATION ## +#openblocks.misc.shape.pentagon=Pentagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.hexagon=Hexagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.octagon=Octagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## + +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.width=Width: %d ## NEEDS TRANSLATION ## +#openblocks.misc.height=Height: %d ## NEEDS TRANSLATION ## +#openblocks.misc.depth=Depth: %d ## NEEDS TRANSLATION ## + +#openblocks.misc.radio.too_many=Too many radios already playing ## NEEDS TRANSLATION ## +#openblocks.misc.radio.invalid_stream=Invalid stream ## NEEDS TRANSLATION ## +#openblocks.misc.radio.invalid_url=Invalid URL ## NEEDS TRANSLATION ## +#openblocks.misc.radio.url_not_found=URL not found ## NEEDS TRANSLATION ## +#openblocks.misc.radio.unknown_stream_type=Unknown stream type ## NEEDS TRANSLATION ## +#openblocks.misc.radio.malformed_data=Malformed data in stream ## NEEDS TRANSLATION ## +#openblocks.misc.radio.not_ready=Stream not ready, try again later ## NEEDS TRANSLATION ## +#openblocks.misc.radio.cant_connect=Can't connect ## NEEDS TRANSLATION ## +#openblocks.misc.radio.unknown_error=Unknown error ## NEEDS TRANSLATION ## +#openblocks.misc.radio.muted=Sounds are muted! ## NEEDS TRANSLATION ## + +#openblocks.misc.side.east=East side ## NEEDS TRANSLATION ## +#openblocks.misc.side.west=West side ## NEEDS TRANSLATION ## +#openblocks.misc.side.north=North side ## NEEDS TRANSLATION ## +#openblocks.misc.side.south=South side ## NEEDS TRANSLATION ## +#openblocks.misc.side.up=Top side ## NEEDS TRANSLATION ## +#openblocks.misc.side.down=Bottom side ## NEEDS TRANSLATION ## + +#openblocks.misc.command.invalid=Invalid command arguments ## NEEDS TRANSLATION ## +#openblocks.misc.command.no_flim_flam=Invalid flim-flam name ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_source=Player %s had been successfully flim-flammed with %s ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_target=Someone doesn't like you. Someone with power ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_failed=Flim-flamming failed! ## NEEDS TRANSLATION ## +#openblocks.misc.command.luck_added=Luck changed for player %s, current: %d ## NEEDS TRANSLATION ## +#openblocks.misc.command.luck_current=Player %s luck: %d ## NEEDS TRANSLATION ## + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## +#openblocks.flim_flammed=Something weird happens around you ## NEEDS TRANSLATION ## + +#openblocks.turtle.magnet=Magnet ## NEEDS TRANSLATION ## tile.openblocks.elevator.name=Lift +#tile.openblocks.elevator.description=Place one elevator directly three or more blocks above another with no blocks inbetween and you'll be able to either 'jump' to move up, or 'crouch' to move down. Elevators can be dyed by clicking on them with dye, however, you can only teleport between elevators of the same color. ## NEEDS TRANSLATION ## + +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=Verbanddoos +#tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. ## NEEDS TRANSLATION ## + tile.openblocks.guide.name=Bouwplanner +#tile.openblocks.guide.description=The building guide, once powered with redstone, will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nUse touch-buttons on block to change outline dimensions and shapes.\nColor of markers can be changed by using dye on central block. ## NEEDS TRANSLATION ## + +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=Jaded Ladder +#tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. ## NEEDS TRANSLATION ## + +#tile.openblocks.tank.filled.name=%s Tank ## NEEDS TRANSLATION ## tile.openblocks.tank.name=Tank -tile.openblocks.target.name=Doel -tile.openblocks.grave.name=Graf +#tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. ## NEEDS TRANSLATION ## + tile.openblocks.flag.name=Vlag -tile.openblocks.trophy.name=Troffee +#tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. ## NEEDS TRANSLATION ## + tile.openblocks.beartrap.name=Berenval +#tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! ## NEEDS TRANSLATION ## + +#tile.openblocks.sponge.name=Sponge ## NEEDS TRANSLATION ## +#tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. ## NEEDS TRANSLATION ## + +#item.openblocks.spongeonastick.name=Sponge ## NEEDS TRANSLATION ## +#item.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. ## NEEDS TRANSLATION ## + +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + +#tile.openblocks.cannon.name=Item Cannon ## NEEDS TRANSLATION ## +#tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. ## NEEDS TRANSLATION ## + +#tile.openblocks.ropeladder.name=Rope Ladder ## NEEDS TRANSLATION ## +#tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. For every created ladder block it will use one item from stack. ## NEEDS TRANSLATION ## + tile.openblocks.sprinkler.name=Sproeier +#tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! ## NEEDS TRANSLATION ## + +#tile.openblocks.paintmixer.name=Paint Mixer ## NEEDS TRANSLATION ## +#tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! ## NEEDS TRANSLATION ## + +#tile.openblocks.canvas.name=Canvas ## NEEDS TRANSLATION ## +#tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. ## NEEDS TRANSLATION ## + +#tile.openblocks.fan.name=Fan ## NEEDS TRANSLATION ## +#tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. ## NEEDS TRANSLATION ## + +tile.openblocks.target.name=Doel +#tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the player's aim. Give the target a redstone signal to make it pop up! ## NEEDS TRANSLATION ## + +#tile.openblocks.path.name=Path ## NEEDS TRANSLATION ## +#tile.openblocks.path.description=The path doesn't do anything. It just looks nice! ## NEEDS TRANSLATION ## + +#tile.openblocks.itemDropper.name=Item Dropper ## NEEDS TRANSLATION ## +#tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. ## NEEDS TRANSLATION ## + +#tile.openblocks.bigbutton.name=Big Button ## NEEDS TRANSLATION ## +#tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. ## NEEDS TRANSLATION ## + +#tile.openblocks.xpdrain.name=XP Drain ## NEEDS TRANSLATION ## +#tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. ## NEEDS TRANSLATION ## + +#tile.openblocks.vacuumhopper.name=Vacuum Hopper ## NEEDS TRANSLATION ## +#tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. ## NEEDS TRANSLATION ## + +#tile.openblocks.village_highlighter.name=Village Highlighter ## NEEDS TRANSLATION ## +#tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! ## NEEDS TRANSLATION ## + +#tile.openblocks.donationStation.name=Donation Station ## NEEDS TRANSLATION ## +#tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. ## NEEDS TRANSLATION ## + +#tile.openblocks.blockPlacer.name=Block Placer ## NEEDS TRANSLATION ## +#tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. ## NEEDS TRANSLATION ## + +#tile.openblocks.blockbreaker.name=Block Breaker ## NEEDS TRANSLATION ## +#tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. ## NEEDS TRANSLATION ## + +#tile.openblocks.projector.name=Height Map Projector ## NEEDS TRANSLATION ## +#tile.openblocks.projector.description=I'll let you write this one boq! ## NEEDS TRANSLATION ## +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## + +#tile.openblocks.autoenchantmenttable.name=Auto Enchantment Table ## NEEDS TRANSLATION ## +#tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. ## NEEDS TRANSLATION ## + +#tile.openblocks.xpbottler.name=XP Bottler ## NEEDS TRANSLATION ## +#tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. ## NEEDS TRANSLATION ## + +#tile.openblocks.autoanvil.name=Auto Anvil ## NEEDS TRANSLATION ## +#tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! ## NEEDS TRANSLATION ## + +#tile.openblocks.drawingtable.name=Drawing Table ## NEEDS TRANSLATION ## +#tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! ## NEEDS TRANSLATION ## + +tile.openblocks.grave.name=Graf +tile.openblocks.trophy.name=Troffee +#tile.openblocks.trophy.entity.name=%s Trophy ## NEEDS TRANSLATION ## +#tile.openblocks.canvasglass.name=Glass Canvas ## NEEDS TRANSLATION ## +#tile.openblocks.paintcan.name=Paint Can ## NEEDS TRANSLATION ## + +#tile.openblocks.sky.normal.name=Sky Block ## NEEDS TRANSLATION ## +#tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. ## NEEDS TRANSLATION ## +#tile.openblocks.sky.inverted.name=Inverted Sky Block ## NEEDS TRANSLATION ## + +#tile.openblocks.radio.name=Radio ## NEEDS TRANSLATION ## +#tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. ## NEEDS TRANSLATION ## + +#tile.openblocks.xpshower.name=XP Shower ## NEEDS TRANSLATION ## +#tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. ## NEEDS TRANSLATION ## + +#tile.openblocks.scaffolding.name=Scaffolding ## NEEDS TRANSLATION ## +#tile.openblocks.scaffolding.description=Have you ever wanted to pillar up somewhere without leaving an ugly tower behind? Well, now you can! Simply build with scaffolding blocks and they will automatically despawn when you are done. ## NEEDS TRANSLATION ## + +#tile.openblocks.goldenegg.name=Golden Egg ## NEEDS TRANSLATION ## + +#tile.openblocks.digitalfuse.name=Digital Fuse ## NEEDS TRANSLATION ## + +#item.openblocks.cursor.name=Cursor ## NEEDS TRANSLATION ## +#item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. ## NEEDS TRANSLATION ## + +#item.openblocks.devnull.name=/dev/null ## NEEDS TRANSLATION ## +#item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! ## NEEDS TRANSLATION ## + +#item.openblocks.slimalyzer.name=Slimalyzer ## NEEDS TRANSLATION ## +#item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. ## NEEDS TRANSLATION ## item.openblocks.hangglider.name=Deltavlieger -item.openblocks.gliderwing.name=Vleugel -item.openblocks.luggage.name=Bagage +#item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! ## NEEDS TRANSLATION ## -itemGroup.tabOpenBlocks=OpenBlocks \ No newline at end of file +item.openblocks.gliderwing.name=Vleugel + +#item.openblocks.sleepingbag.name=Sleeping Bag ## NEEDS TRANSLATION ## +#item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. ## NEEDS TRANSLATION ## + +item.openblocks.luggage.name=Bagage +#item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! ## NEEDS TRANSLATION ## + +#item.openblocks.sonicglasses.name=Sonic Glasses ## NEEDS TRANSLATION ## +#item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! ## NEEDS TRANSLATION ## + +#item.openblocks.squeegee.name=Squeegee ## NEEDS TRANSLATION ## +#item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! ## NEEDS TRANSLATION ## + +#item.openblocks.paintbrush.name=Paint Brush ## NEEDS TRANSLATION ## +#item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! ## NEEDS TRANSLATION ## + +#item.openblocks.unprepared_stencil.name=Unprepared Stencil ## NEEDS TRANSLATION ## +#item.openblocks.unprepared_stencil.description=Stencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. ## NEEDS TRANSLATION ## + +#item.openblocks.crane_backpack.name=Crane Backpack ## NEEDS TRANSLATION ## +#item.openblocks.crane_backpack.description=In Minecraft world "magnet" is ancient word for "how do this works?".\n\nThis particular piece of very equipment allows you to pick and carry mobs, players, items and blocks. Can be controlled with magnet control. ## NEEDS TRANSLATION ## + +#item.openblocks.crane_control.name=Crane Control ## NEEDS TRANSLATION ## +#item.openblocks.crane_control.description=This hi-tech wireless remote is used for controlling magnet backpacks.\n\nRight click to raise, Sneak + right click to lower, left click to pick/release.\nBlinking light signals something is under magnet. ## NEEDS TRANSLATION ## + +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + +#item.openblocks.stencil.name=Stencil ## NEEDS TRANSLATION ## +#item.openblocks.crayon.name=Magic Crayon ## NEEDS TRANSLATION ## +#item.openblocks.pencil.name=Magic Pencil ## NEEDS TRANSLATION ## +#item.openblocks.glasses.pencil.name=Pencil Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.crayon.name=Crayon Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.technicolor.name=Amazing Technicolor Glasses ## NEEDS TRANSLATION ## +#item.openblocks.glasses.admin.name=Badass Glasses ## NEEDS TRANSLATION ## +#item.openblocks.crane_engine.name=Crane Engine ## NEEDS TRANSLATION ## +#item.openblocks.crane_magnet.name=Crane Magnet ## NEEDS TRANSLATION ## +#item.openblocks.beam.name=Beam ## NEEDS TRANSLATION ## +#item.openblocks.line.name=Line ## NEEDS TRANSLATION ## +#item.openblocks.miracle_magnet.name=§5Miracle Magnet§r ## NEEDS TRANSLATION ## +#item.openblocks.info_book.name=World Domination with OpenBlocks ## NEEDS TRANSLATION ## +#item.openblocks.xpbucket.name=XP Bucket ## NEEDS TRANSLATION ## +#item.openblocks.height_map.name=Height Map ## NEEDS TRANSLATION ## +#item.openblocks.empty_map.name=Empty Map ## NEEDS TRANSLATION ## +#item.openblocks.map_controller.name=Map Controller Module ## NEEDS TRANSLATION ## +#item.openblocks.map_memory.name=Map Memory Module ## NEEDS TRANSLATION ## +#item.openblocks.cartographer.name=Cartographer ## NEEDS TRANSLATION ## +#item.openblocks.assistant_base.name=Assistant's base ## NEEDS TRANSLATION ## +#item.openblocks.sketching_pencil.name=Sketching Pencil ## NEEDS TRANSLATION ## +#item.openblocks.tasty_clay.name=Tasty Clay ## NEEDS TRANSLATION ## +#item.openblocks.golden_eye.name=Golden eye ## NEEDS TRANSLATION ## +#item.openblocks.pointer.name=Pointer ## NEEDS TRANSLATION ## +#item.openblocks.tuned_crystal.name=Tuned Crystal ## NEEDS TRANSLATION ## +#item.openblocks.pedometer.name=Pedometer ## NEEDS TRANSLATION ## + +#item.openblocks.wallpaper.name=Wallpaper ## NEEDS TRANSLATION ## + +itemGroup.tabOpenBlocks=OpenBlocks + +#entity.OpenBlocks.Luggage.name=Luggage ## NEEDS TRANSLATION ## +#entity.OpenBlocks.Cartographer.name=Cartographer ## NEEDS TRANSLATION ## +#entity.OpenBlocks.Block.name=Floating Block ## NEEDS TRANSLATION ## +#entity.OpenBlocks.MiniMe.name=Mini Me ## NEEDS TRANSLATION ## + +#fluid.OpenBlocks.xpjuice=Liquid XP ## NEEDS TRANSLATION ## diff --git a/src/main/resources/assets/openblocks/lang/pl_PL.lang b/src/main/resources/assets/openblocks/lang/pl_PL.lang index 44b1afc1..d9bb05c1 100644 --- a/src/main/resources/assets/openblocks/lang/pl_PL.lang +++ b/src/main/resources/assets/openblocks/lang/pl_PL.lang @@ -1,10 +1,24 @@ achievement.openblocks.droppedBrick=Zonk! achievement.openblocks.droppedBrick.desc=Przykro mi, tak się zdarza... stat.openblocks.bricksDropped=Rzucone cegły +#achievement.openblocks.stackOverflow=Stack Overflow ## NEEDS TRANSLATION ## +#achievement.openblocks.stackOverflow.desc=It's full of stars! ## NEEDS TRANSLATION ## +#openblocks.keybind.category=OpenBlocks ## NEEDS TRANSLATION ## openblocks.keybind.drop_brick=Bądź głupi enchantment.openblocks.explosive=Niestabilny +#enchantment.openblocks.laststand=Last Stand ## NEEDS TRANSLATION ## +#enchantment.openblocks.flimflam=Flim Flam ## NEEDS TRANSLATION ## + +#openblocks.gui.blocks=Blocks ## NEEDS TRANSLATION ## +#openblocks.gui.items=Items ## NEEDS TRANSLATION ## +#openblocks.gui.misc=Miscellanea ## NEEDS TRANSLATION ## +#openblocks.gui.changelogs=Changelogs ## NEEDS TRANSLATION ## + +#openblocks.gui.features=Features ## NEEDS TRANSLATION ## +#openblocks.gui.bugfixes=Bugfixes ## NEEDS TRANSLATION ## +#openblocks.gui.tweaks=Tweaks ## NEEDS TRANSLATION ## openblocks.gui.luggage=Bagaż openblocks.gui.sprinkler=Zraszacz @@ -21,7 +35,38 @@ openblocks.gui.itemdropper=Podajnik przedmiotów openblocks.gui.blockplacer=Wykładacz blokowy openblocks.gui.paintmixer=Mikser farby openblocks.gui.drawingtable=Stół do rysowania +#openblocks.gui.digitalfuse=Digital Fuse ## NEEDS TRANSLATION ## +#openblocks.gui.xp_outputs=XP Outputs ## NEEDS TRANSLATION ## +#openblocks.gui.item_outputs=Item Outputs ## NEEDS TRANSLATION ## +#openblocks.gui.max_level=Max. Level: %d ## NEEDS TRANSLATION ## +#openblocks.gui.save_folder=Save folder ## NEEDS TRANSLATION ## +#openblocks.gui.welcome.title=Welcome! ## NEEDS TRANSLATION ## +#openblocks.gui.welcome.content=OpenBlocks is a new open source mod that introduces a variety of ideas into Minecraft, including hang gliders, elevators, tanks, graves, paints, cranes, liquid XP, cartographers, trophies and more! ## NEEDS TRANSLATION ## + +#openblocks.gui.credits.title=Credits ## NEEDS TRANSLATION ## +#openblocks.gui.credits.content=§LBoq, Mikee and NeverCast§R - Leading developers of OpenBlocks (are we allowed to credit ourselves?)\n\n§LSinZ and Yoshi2§R - members of the OpenMods team from the start.\n\n§LVexatos and crafteverywhere§R - Regularly translating the mods.\n\nEveryone else who has contributed to the code over the past two years.\n\n§LDirewolf20 and the rest of ForgeCraft§R - for putting up with the bugs and crashes before we release.\n\nEveryone who's done spotlights, lets plays and generally supported the mod since we started! ## NEEDS TRANSLATION ## + +#openblocks.gui.config.title=Easy Config Editing ## NEEDS TRANSLATION ## +#openblocks.gui.config.content=OpenMods allow for both client and server config options to be changed from chat commands. Some don't even require restart!\n\nServer config settings can be changed using '§L/om_config_s§R' (op needed) and client config settings can be changed using '§L/om_config_c§R'\n\nFor example:\n\n§L/om_config_s set OpenBlocks dropblock elevatorDrainsXP false§R\n§L/om_config_s save§R\n\nFor a full list of commands type: §L/help om_config_s§R or §L/help om_config_c§R ## NEEDS TRANSLATION ## + +#openblocks.gui.restore_inv.title=Inventory backup ## NEEDS TRANSLATION ## +#openblocks.gui.restore_inv.content=Everyone can make mistake. But with §L/ob_inventory§R command you can fix some of them. This command can be used to restore inventory. Backup is created when:\n - player dies\n - grave is spawned \n - player issued command §L/ob_inventory store§R\n\nTo restore inventory you need backup name. Go to folder below or to saves folder on server and look for files named §Linventory-*.dat§R. Then restore inventory with §L/ob_inventory restore §R - where id is either full filename or just middle part, without §Linventory-§R and §L.dat§R. You can also use tab completion. Backups are normal NBT files and can be opened with any editor. ## NEEDS TRANSLATION ## + +#openblocks.gui.bkey.title=The Infamous 'B' Key ## NEEDS TRANSLATION ## +#openblocks.gui.bkey.content=The 'B' key is a very special key in OpenBlocks.\n\nEnabling the 'weAreSeriousPeople' config option in the 'tomfoolery' category of both the client and server config files will give you your very own digestive system.\n\nTry eating some of that tasty clay and press 'B' to digest! ## NEEDS TRANSLATION ## + +#openblocks.gui.unstable.title=Unstable Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.unstable.content=We've had unconfirmed reports that this enchantment causes any gunpowder you're carrying to become unstable when you're attacked or when you jump off something.\n\nUse at your own risk! ## NEEDS TRANSLATION ## + +#openblocks.gui.flimflam.title=Flim Flam Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.flimflam.content=Scientists have yet to discover the properties of this enchantment. ## NEEDS TRANSLATION ## + +#openblocks.gui.laststand.title=Last Stand Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.laststand.content=The last stand enchantment uses your XP bar as a final protection against dying.\n\nWhen you reach 0.5 hearts, the game will take XP from you whenever you're damaged instead of killing you. The higher number of enchantments you have the cheaper the XP cost will be. ## NEEDS TRANSLATION ## + +#openblocks.changelog.title=What's new in OpenBlocks %s ## NEEDS TRANSLATION ## +#openblocks.misc.url=URL: %s ## NEEDS TRANSLATION ## openblocks.misc.type=Typ: %s openblocks.misc.uses=Uses: %.2f openblocks.misc.color=Kolor: %06X @@ -36,76 +81,294 @@ openblocks.misc.mode.inverted_half_panel=Odwrócony połowiczny panel openblocks.misc.mode.inverted_stairs=Odwrócone schody openblocks.misc.structure_pos=Debug: znaleziono strukturę %s na koordynatach (%d,%d,%d) openblocks.misc.locked=Zablokowany +#openblocks.misc.selected_cannon=Selected cannon for targeting ## NEEDS TRANSLATION ## +#openblocks.misc.pointed_cannon=Pointed cannon at %s, %s, %s ## NEEDS TRANSLATION ## +#openblocks.misc.change_mode=Changing to %s mode ## NEEDS TRANSLATION ## +#openblocks.misc.change_size=Changing size to %sx%sx%s ## NEEDS TRANSLATION ## +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.total_blocks=Total block count: %d ## NEEDS TRANSLATION ## +#openblocks.misc.get_witched=Get witched! ## NEEDS TRANSLATION ## +#openblocks.misc.page=Page %d of %d ## NEEDS TRANSLATION ## +#openblocks.misc.oh_no_ceiling=You can't fall asleep here. Ceiling disturbs you too much... ## NEEDS TRANSLATION ## +#openblocks.misc.oh_no_ground=You want to sleep on THAT!? ## NEEDS TRANSLATION ## +#openblocks.misc.sleeping_bag_broken=Item inactive due to failed initialization ## NEEDS TRANSLATION ## +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## + +#openblocks.misc.grave_msg=%s (day: %.1f) ## NEEDS TRANSLATION ## + +#openblocks.misc.cant_restore_player=Can't restore inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.cant_restore_inventory=Can't restore inventory ## NEEDS TRANSLATION ## +#openblocks.misc.cant_store=Can't store player %s inventory ## NEEDS TRANSLATION ## +#openblocks.misc.invalid_sub_inventory=Can't restore sub inventory %s ## NEEDS TRANSLATION ## +#openblocks.misc.stored_inventory=Stored player inventory to %s ## NEEDS TRANSLATION ## +#openblocks.misc.restored_inventory=Restored inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.invalid_index=Invalid index ## NEEDS TRANSLATION ## +#openblocks.misc.empty_slot=No item in slot ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.tracking_reset=Tracking reset ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.tracking_started=Tracking started ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.start_point=Start point: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.speed=Speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.avg_speed=Average speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.total_distance=Total distance: %s ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.straght_line_distance=Straight line distance: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.straigh_line_speed=Straight line speed: %s ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.last_check_distance=Distance from last check: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.last_check_speed=Last check speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.last_check_time=Time from last check: %d ticks ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.total_time=Total time: %d ticks ## NEEDS TRANSLATION ## + +#openblocks.misc.shape=Shape: %s ## NEEDS TRANSLATION ## +#openblocks.misc.shape.sphere=Sphere ## NEEDS TRANSLATION ## +#openblocks.misc.shape.cylinder=Cylinder ## NEEDS TRANSLATION ## +#openblocks.misc.shape.cuboid=Cuboid ## NEEDS TRANSLATION ## +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## +#openblocks.misc.shape.dome=Dome ## NEEDS TRANSLATION ## +#openblocks.misc.shape.triangle=Triangle ## NEEDS TRANSLATION ## +#openblocks.misc.shape.pentagon=Pentagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.hexagon=Hexagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.octagon=Octagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## + +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.width=Width: %d ## NEEDS TRANSLATION ## +#openblocks.misc.height=Height: %d ## NEEDS TRANSLATION ## +#openblocks.misc.depth=Depth: %d ## NEEDS TRANSLATION ## + +#openblocks.misc.radio.too_many=Too many radios already playing ## NEEDS TRANSLATION ## +#openblocks.misc.radio.invalid_stream=Invalid stream ## NEEDS TRANSLATION ## +#openblocks.misc.radio.invalid_url=Invalid URL ## NEEDS TRANSLATION ## +#openblocks.misc.radio.url_not_found=URL not found ## NEEDS TRANSLATION ## +#openblocks.misc.radio.unknown_stream_type=Unknown stream type ## NEEDS TRANSLATION ## +#openblocks.misc.radio.malformed_data=Malformed data in stream ## NEEDS TRANSLATION ## +#openblocks.misc.radio.not_ready=Stream not ready, try again later ## NEEDS TRANSLATION ## +#openblocks.misc.radio.cant_connect=Can't connect ## NEEDS TRANSLATION ## +#openblocks.misc.radio.unknown_error=Unknown error ## NEEDS TRANSLATION ## +#openblocks.misc.radio.muted=Sounds are muted! ## NEEDS TRANSLATION ## + +#openblocks.misc.side.east=East side ## NEEDS TRANSLATION ## +#openblocks.misc.side.west=West side ## NEEDS TRANSLATION ## +#openblocks.misc.side.north=North side ## NEEDS TRANSLATION ## +#openblocks.misc.side.south=South side ## NEEDS TRANSLATION ## +#openblocks.misc.side.up=Top side ## NEEDS TRANSLATION ## +#openblocks.misc.side.down=Bottom side ## NEEDS TRANSLATION ## + +#openblocks.misc.command.invalid=Invalid command arguments ## NEEDS TRANSLATION ## +#openblocks.misc.command.no_flim_flam=Invalid flim-flam name ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_source=Player %s had been successfully flim-flammed with %s ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_target=Someone doesn't like you. Someone with power ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_failed=Flim-flamming failed! ## NEEDS TRANSLATION ## +#openblocks.misc.command.luck_added=Luck changed for player %s, current: %d ## NEEDS TRANSLATION ## +#openblocks.misc.command.luck_current=Player %s luck: %d ## NEEDS TRANSLATION ## + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## +#openblocks.flim_flammed=Something weird happens around you ## NEEDS TRANSLATION ## openblocks.turtle.magnet=magnesowy tile.openblocks.elevator.name=Winda +#tile.openblocks.elevator.description=Place one elevator directly three or more blocks above another with no blocks inbetween and you'll be able to either 'jump' to move up, or 'crouch' to move down. Elevators can be dyed by clicking on them with dye, however, you can only teleport between elevators of the same color. ## NEEDS TRANSLATION ## + +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=Uzdrawiacz +#tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. ## NEEDS TRANSLATION ## + tile.openblocks.guide.name=Pomocnik budowania +#tile.openblocks.guide.description=The building guide, once powered with redstone, will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nUse touch-buttons on block to change outline dimensions and shapes.\nColor of markers can be changed by using dye on central block. ## NEEDS TRANSLATION ## + +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=Właz z drabiną +#tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. ## NEEDS TRANSLATION ## + +#tile.openblocks.tank.filled.name=%s Tank ## NEEDS TRANSLATION ## tile.openblocks.tank.name=Zbiornik -tile.openblocks.target.name=Tarcza strzelnicza -tile.openblocks.grave.name=Grób +#tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. ## NEEDS TRANSLATION ## + tile.openblocks.flag.name=Flaga -tile.openblocks.trophy.name=Trofeum +#tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. ## NEEDS TRANSLATION ## + tile.openblocks.beartrap.name=Pułapka na stworzenia -tile.openblocks.sprinkler.name=Zraszacz -tile.openblocks.vacuumhopper.name=Lej próżniowy +#tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! ## NEEDS TRANSLATION ## + tile.openblocks.sponge.name=Gąbka +#tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. ## NEEDS TRANSLATION ## + +#item.openblocks.spongeonastick.name=Sponge ## NEEDS TRANSLATION ## +#item.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. ## NEEDS TRANSLATION ## + +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Armatka przedmiotów -tile.openblocks.bigbutton.name=Duży przycisk -tile.openblocks.fan.name=Wiatrak -tile.openblocks.xpbottler.name=Rozlewnia XP -tile.openblocks.village_highlighter.name=Przyciągacz osadników -tile.openblocks.path.name=Ścieżka -tile.openblocks.autoanvil.name=Kowadło automatyczne -tile.openblocks.autoenchantmenttable.name=Automatyczny stół do zaklęć -tile.openblocks.xpdrain.name=Dren XP +#tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. ## NEEDS TRANSLATION ## + tile.openblocks.ropeladder.name=Drabina linowa -tile.openblocks.donationStation.name=Stacja darowizn -tile.openblocks.blockbreaker.name=Burzyciel blokowy -tile.openblocks.blockPlacer.name=Wykładacz blokowy -tile.openblocks.itemDropper.name=Podajnik przedmiotów -tile.openblocks.canvas.name=Płótno -tile.openblocks.canvasglass.name=Szklane płótno +#tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. For every created ladder block it will use one item from stack. ## NEEDS TRANSLATION ## + +tile.openblocks.sprinkler.name=Zraszacz +#tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! ## NEEDS TRANSLATION ## + tile.openblocks.paintmixer.name=Mikser farby -tile.openblocks.paintcan.name=Puszka farby +#tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! ## NEEDS TRANSLATION ## + +tile.openblocks.canvas.name=Płótno +#tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. ## NEEDS TRANSLATION ## + +tile.openblocks.fan.name=Wiatrak +#tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. ## NEEDS TRANSLATION ## + +tile.openblocks.target.name=Tarcza strzelnicza +#tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the player's aim. Give the target a redstone signal to make it pop up! ## NEEDS TRANSLATION ## + +tile.openblocks.path.name=Ścieżka +#tile.openblocks.path.description=The path doesn't do anything. It just looks nice! ## NEEDS TRANSLATION ## + +tile.openblocks.itemDropper.name=Podajnik przedmiotów +#tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. ## NEEDS TRANSLATION ## + +tile.openblocks.bigbutton.name=Duży przycisk +#tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. ## NEEDS TRANSLATION ## + +tile.openblocks.xpdrain.name=Dren XP +#tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. ## NEEDS TRANSLATION ## + +tile.openblocks.vacuumhopper.name=Lej próżniowy +#tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. ## NEEDS TRANSLATION ## + +tile.openblocks.village_highlighter.name=Przyciągacz osadników +#tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! ## NEEDS TRANSLATION ## + +tile.openblocks.donationStation.name=Stacja darowizn +#tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. ## NEEDS TRANSLATION ## + +tile.openblocks.blockPlacer.name=Wykładacz blokowy +#tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. ## NEEDS TRANSLATION ## + +tile.openblocks.blockbreaker.name=Burzyciel blokowy +#tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. ## NEEDS TRANSLATION ## + tile.openblocks.projector.name=Projektor mapy wysokościowej +#tile.openblocks.projector.description=I'll let you write this one boq! ## NEEDS TRANSLATION ## +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## + +tile.openblocks.autoenchantmenttable.name=Automatyczny stół do zaklęć +#tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. ## NEEDS TRANSLATION ## + +tile.openblocks.xpbottler.name=Rozlewnia XP +#tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. ## NEEDS TRANSLATION ## + +tile.openblocks.autoanvil.name=Kowadło automatyczne +#tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! ## NEEDS TRANSLATION ## + tile.openblocks.drawingtable.name=Stół do rysowania +#tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! ## NEEDS TRANSLATION ## + +tile.openblocks.grave.name=Grób +tile.openblocks.trophy.name=Trofeum +#tile.openblocks.trophy.entity.name=%s Trophy ## NEEDS TRANSLATION ## +tile.openblocks.canvasglass.name=Szklane płótno +tile.openblocks.paintcan.name=Puszka farby + +#tile.openblocks.sky.normal.name=Sky Block ## NEEDS TRANSLATION ## +#tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. ## NEEDS TRANSLATION ## +#tile.openblocks.sky.inverted.name=Inverted Sky Block ## NEEDS TRANSLATION ## + +#tile.openblocks.radio.name=Radio ## NEEDS TRANSLATION ## +#tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. ## NEEDS TRANSLATION ## + +#tile.openblocks.xpshower.name=XP Shower ## NEEDS TRANSLATION ## +#tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. ## NEEDS TRANSLATION ## + +#tile.openblocks.scaffolding.name=Scaffolding ## NEEDS TRANSLATION ## +#tile.openblocks.scaffolding.description=Have you ever wanted to pillar up somewhere without leaving an ugly tower behind? Well, now you can! Simply build with scaffolding blocks and they will automatically despawn when you are done. ## NEEDS TRANSLATION ## + +#tile.openblocks.goldenegg.name=Golden Egg ## NEEDS TRANSLATION ## + +#tile.openblocks.digitalfuse.name=Digital Fuse ## NEEDS TRANSLATION ## + +item.openblocks.cursor.name=Kursor +#item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. ## NEEDS TRANSLATION ## + +#item.openblocks.devnull.name=/dev/null ## NEEDS TRANSLATION ## +#item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! ## NEEDS TRANSLATION ## + +item.openblocks.slimalyzer.name=Szlamalizator +#item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. ## NEEDS TRANSLATION ## item.openblocks.hangglider.name=Lotnia +#item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! ## NEEDS TRANSLATION ## + item.openblocks.gliderwing.name=Skrzydło lotnii + +item.openblocks.sleepingbag.name=Śpiwór +#item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. ## NEEDS TRANSLATION ## + item.openblocks.luggage.name=Bagaż +#item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! ## NEEDS TRANSLATION ## + item.openblocks.sonicglasses.name=Okulary soniczne +#item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! ## NEEDS TRANSLATION ## + +item.openblocks.squeegee.name=Rakiel +#item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! ## NEEDS TRANSLATION ## + +item.openblocks.paintbrush.name=Pędzel +#item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! ## NEEDS TRANSLATION ## + +item.openblocks.unprepared_stencil.name=Nieprzygotowany szablon +#item.openblocks.unprepared_stencil.description=Stencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. ## NEEDS TRANSLATION ## + +item.openblocks.crane_backpack.name=Plecak żurawia +#item.openblocks.crane_backpack.description=In Minecraft world "magnet" is ancient word for "how do this works?".\n\nThis particular piece of very equipment allows you to pick and carry mobs, players, items and blocks. Can be controlled with magnet control. ## NEEDS TRANSLATION ## + +item.openblocks.crane_control.name=Kontroler żurawia +#item.openblocks.crane_control.description=This hi-tech wireless remote is used for controlling magnet backpacks.\n\nRight click to raise, Sneak + right click to lower, left click to pick/release.\nBlinking light signals something is under magnet. ## NEEDS TRANSLATION ## + +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + +item.openblocks.stencil.name=Szablon item.openblocks.crayon.name=Magiczna kredka item.openblocks.pencil.name=Magiczny ołówek item.openblocks.glasses.pencil.name=Szkła ołówkowe item.openblocks.glasses.crayon.name=Szkła kredowe item.openblocks.glasses.technicolor.name=Niesamowite szkła Technicolor item.openblocks.glasses.admin.name=Kujońskie okulary -item.openblocks.crane_backpack.name=Plecak żurawia -item.openblocks.crane_control.name=Kontroler żurawia item.openblocks.crane_engine.name=Silnik żurawia item.openblocks.crane_magnet.name=Magnes żurawia item.openblocks.beam.name=Wiązka item.openblocks.line.name=Linia item.openblocks.miracle_magnet.name=§5Cudowny magnes§r -item.openblocks.slimalyzer.name=Szlamalizator +#item.openblocks.info_book.name=World Domination with OpenBlocks ## NEEDS TRANSLATION ## item.openblocks.xpbucket.name=Wiadro XP -item.openblocks.sleepingbag.name=Śpiwór -item.openblocks.paintbrush.name=Pędzel -item.openblocks.stencil.name=Szablon item.openblocks.height_map.name=Mapa wysokościowa item.openblocks.empty_map.name=Pusta mapa item.openblocks.map_controller.name=Moduł kontrolera mapy item.openblocks.map_memory.name=Moduł pamięci mapy item.openblocks.cartographer.name=Kartograf item.openblocks.assistant_base.name=Baza asystenta -item.openblocks.cursor.name=Kursor -item.openblocks.squeegee.name=Rakiel -item.openblocks.unprepared_stencil.name=Nieprzygotowany szablon item.openblocks.sketching_pencil.name=Szkicujący ołówek item.openblocks.tasty_clay.name=Elegancka glina item.openblocks.golden_eye.name=Złote oko +#item.openblocks.pointer.name=Pointer ## NEEDS TRANSLATION ## +#item.openblocks.tuned_crystal.name=Tuned Crystal ## NEEDS TRANSLATION ## +#item.openblocks.pedometer.name=Pedometer ## NEEDS TRANSLATION ## + +#item.openblocks.wallpaper.name=Wallpaper ## NEEDS TRANSLATION ## itemGroup.tabOpenBlocks=OpenBlocks + +#entity.OpenBlocks.Luggage.name=Luggage ## NEEDS TRANSLATION ## +#entity.OpenBlocks.Cartographer.name=Cartographer ## NEEDS TRANSLATION ## +#entity.OpenBlocks.Block.name=Floating Block ## NEEDS TRANSLATION ## +#entity.OpenBlocks.MiniMe.name=Mini Me ## NEEDS TRANSLATION ## + +#fluid.OpenBlocks.xpjuice=Liquid XP ## NEEDS TRANSLATION ## diff --git a/src/main/resources/assets/openblocks/lang/pt_BR.lang b/src/main/resources/assets/openblocks/lang/pt_BR.lang index 7eb6c16c..adba2a09 100644 --- a/src/main/resources/assets/openblocks/lang/pt_BR.lang +++ b/src/main/resources/assets/openblocks/lang/pt_BR.lang @@ -1,3 +1,25 @@ +#achievement.openblocks.droppedBrick=Zoinks! ## NEEDS TRANSLATION ## +#achievement.openblocks.droppedBrick.desc=Sorry, it just happened... ## NEEDS TRANSLATION ## +#stat.openblocks.bricksDropped=Bricks dropped ## NEEDS TRANSLATION ## +#achievement.openblocks.stackOverflow=Stack Overflow ## NEEDS TRANSLATION ## +#achievement.openblocks.stackOverflow.desc=It's full of stars! ## NEEDS TRANSLATION ## + +#openblocks.keybind.category=OpenBlocks ## NEEDS TRANSLATION ## +#openblocks.keybind.drop_brick=Be silly ## NEEDS TRANSLATION ## + +#enchantment.openblocks.explosive=Unstable ## NEEDS TRANSLATION ## +#enchantment.openblocks.laststand=Last Stand ## NEEDS TRANSLATION ## +#enchantment.openblocks.flimflam=Flim Flam ## NEEDS TRANSLATION ## + +#openblocks.gui.blocks=Blocks ## NEEDS TRANSLATION ## +#openblocks.gui.items=Items ## NEEDS TRANSLATION ## +#openblocks.gui.misc=Miscellanea ## NEEDS TRANSLATION ## +#openblocks.gui.changelogs=Changelogs ## NEEDS TRANSLATION ## + +#openblocks.gui.features=Features ## NEEDS TRANSLATION ## +#openblocks.gui.bugfixes=Bugfixes ## NEEDS TRANSLATION ## +#openblocks.gui.tweaks=Tweaks ## NEEDS TRANSLATION ## + openblocks.gui.luggage=Bagagem openblocks.gui.sprinkler=Borrifador openblocks.gui.vacuumhopper=Funil a vácuo @@ -8,7 +30,43 @@ openblocks.gui.autoeject=Ejetar automaticamente openblocks.gui.autoextract=Extrair automaticamente openblocks.gui.autodrink=Beber automaticamente openblocks.gui.autoenchantmenttable=Mesa de encantamentos automática +#openblocks.gui.donationstation=Donation Station ## NEEDS TRANSLATION ## +#openblocks.gui.itemdropper=Item Dropper ## NEEDS TRANSLATION ## +#openblocks.gui.blockplacer=Block Placer ## NEEDS TRANSLATION ## +#openblocks.gui.paintmixer=Paint Mixer ## NEEDS TRANSLATION ## +#openblocks.gui.drawingtable=Drawing Table ## NEEDS TRANSLATION ## +#openblocks.gui.digitalfuse=Digital Fuse ## NEEDS TRANSLATION ## +#openblocks.gui.xp_outputs=XP Outputs ## NEEDS TRANSLATION ## +#openblocks.gui.item_outputs=Item Outputs ## NEEDS TRANSLATION ## +#openblocks.gui.max_level=Max. Level: %d ## NEEDS TRANSLATION ## +#openblocks.gui.save_folder=Save folder ## NEEDS TRANSLATION ## +#openblocks.gui.welcome.title=Welcome! ## NEEDS TRANSLATION ## +#openblocks.gui.welcome.content=OpenBlocks is a new open source mod that introduces a variety of ideas into Minecraft, including hang gliders, elevators, tanks, graves, paints, cranes, liquid XP, cartographers, trophies and more! ## NEEDS TRANSLATION ## + +#openblocks.gui.credits.title=Credits ## NEEDS TRANSLATION ## +#openblocks.gui.credits.content=§LBoq, Mikee and NeverCast§R - Leading developers of OpenBlocks (are we allowed to credit ourselves?)\n\n§LSinZ and Yoshi2§R - members of the OpenMods team from the start.\n\n§LVexatos and crafteverywhere§R - Regularly translating the mods.\n\nEveryone else who has contributed to the code over the past two years.\n\n§LDirewolf20 and the rest of ForgeCraft§R - for putting up with the bugs and crashes before we release.\n\nEveryone who's done spotlights, lets plays and generally supported the mod since we started! ## NEEDS TRANSLATION ## + +#openblocks.gui.config.title=Easy Config Editing ## NEEDS TRANSLATION ## +#openblocks.gui.config.content=OpenMods allow for both client and server config options to be changed from chat commands. Some don't even require restart!\n\nServer config settings can be changed using '§L/om_config_s§R' (op needed) and client config settings can be changed using '§L/om_config_c§R'\n\nFor example:\n\n§L/om_config_s set OpenBlocks dropblock elevatorDrainsXP false§R\n§L/om_config_s save§R\n\nFor a full list of commands type: §L/help om_config_s§R or §L/help om_config_c§R ## NEEDS TRANSLATION ## + +#openblocks.gui.restore_inv.title=Inventory backup ## NEEDS TRANSLATION ## +#openblocks.gui.restore_inv.content=Everyone can make mistake. But with §L/ob_inventory§R command you can fix some of them. This command can be used to restore inventory. Backup is created when:\n - player dies\n - grave is spawned \n - player issued command §L/ob_inventory store§R\n\nTo restore inventory you need backup name. Go to folder below or to saves folder on server and look for files named §Linventory-*.dat§R. Then restore inventory with §L/ob_inventory restore §R - where id is either full filename or just middle part, without §Linventory-§R and §L.dat§R. You can also use tab completion. Backups are normal NBT files and can be opened with any editor. ## NEEDS TRANSLATION ## + +#openblocks.gui.bkey.title=The Infamous 'B' Key ## NEEDS TRANSLATION ## +#openblocks.gui.bkey.content=The 'B' key is a very special key in OpenBlocks.\n\nEnabling the 'weAreSeriousPeople' config option in the 'tomfoolery' category of both the client and server config files will give you your very own digestive system.\n\nTry eating some of that tasty clay and press 'B' to digest! ## NEEDS TRANSLATION ## + +#openblocks.gui.unstable.title=Unstable Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.unstable.content=We've had unconfirmed reports that this enchantment causes any gunpowder you're carrying to become unstable when you're attacked or when you jump off something.\n\nUse at your own risk! ## NEEDS TRANSLATION ## + +#openblocks.gui.flimflam.title=Flim Flam Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.flimflam.content=Scientists have yet to discover the properties of this enchantment. ## NEEDS TRANSLATION ## + +#openblocks.gui.laststand.title=Last Stand Enchantment ## NEEDS TRANSLATION ## +#openblocks.gui.laststand.content=The last stand enchantment uses your XP bar as a final protection against dying.\n\nWhen you reach 0.5 hearts, the game will take XP from you whenever you're damaged instead of killing you. The higher number of enchantments you have the cheaper the XP cost will be. ## NEEDS TRANSLATION ## + +#openblocks.changelog.title=What's new in OpenBlocks %s ## NEEDS TRANSLATION ## +#openblocks.misc.url=URL: %s ## NEEDS TRANSLATION ## openblocks.misc.type=Tipo: %s openblocks.misc.uses=Usa: %.2f openblocks.misc.color=Cor: %06X @@ -21,52 +79,296 @@ openblocks.misc.mode.inverted_block=Bloco invertido openblocks.misc.mode.inverted_panel=Painel invertido openblocks.misc.mode.inverted_half_panel=Painel ao meio invertido openblocks.misc.mode.inverted_stairs=Escadas invertidas +#openblocks.misc.structure_pos=Debug: found structure %s at (%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.locked=Locked ## NEEDS TRANSLATION ## +#openblocks.misc.selected_cannon=Selected cannon for targeting ## NEEDS TRANSLATION ## +#openblocks.misc.pointed_cannon=Pointed cannon at %s, %s, %s ## NEEDS TRANSLATION ## +#openblocks.misc.change_mode=Changing to %s mode ## NEEDS TRANSLATION ## +#openblocks.misc.change_size=Changing size to %sx%sx%s ## NEEDS TRANSLATION ## +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.total_blocks=Total block count: %d ## NEEDS TRANSLATION ## +#openblocks.misc.get_witched=Get witched! ## NEEDS TRANSLATION ## +#openblocks.misc.page=Page %d of %d ## NEEDS TRANSLATION ## +#openblocks.misc.oh_no_ceiling=You can't fall asleep here. Ceiling disturbs you too much... ## NEEDS TRANSLATION ## +#openblocks.misc.oh_no_ground=You want to sleep on THAT!? ## NEEDS TRANSLATION ## +#openblocks.misc.sleeping_bag_broken=Item inactive due to failed initialization ## NEEDS TRANSLATION ## +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## + +#openblocks.misc.grave_msg=%s (day: %.1f) ## NEEDS TRANSLATION ## + +#openblocks.misc.cant_restore_player=Can't restore inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.cant_restore_inventory=Can't restore inventory ## NEEDS TRANSLATION ## +#openblocks.misc.cant_store=Can't store player %s inventory ## NEEDS TRANSLATION ## +#openblocks.misc.invalid_sub_inventory=Can't restore sub inventory %s ## NEEDS TRANSLATION ## +#openblocks.misc.stored_inventory=Stored player inventory to %s ## NEEDS TRANSLATION ## +#openblocks.misc.restored_inventory=Restored inventory for player %s ## NEEDS TRANSLATION ## +#openblocks.misc.invalid_index=Invalid index ## NEEDS TRANSLATION ## +#openblocks.misc.empty_slot=No item in slot ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.tracking_reset=Tracking reset ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.tracking_started=Tracking started ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.start_point=Start point: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.speed=Speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.avg_speed=Average speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.total_distance=Total distance: %s ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.straght_line_distance=Straight line distance: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.straigh_line_speed=Straight line speed: %s ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.last_check_distance=Distance from last check: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.last_check_speed=Last check speed: %s ## NEEDS TRANSLATION ## +#openblocks.misc.pedometer.last_check_time=Time from last check: %d ticks ## NEEDS TRANSLATION ## + +#openblocks.misc.pedometer.total_time=Total time: %d ticks ## NEEDS TRANSLATION ## + +#openblocks.misc.shape=Shape: %s ## NEEDS TRANSLATION ## +#openblocks.misc.shape.sphere=Sphere ## NEEDS TRANSLATION ## +#openblocks.misc.shape.cylinder=Cylinder ## NEEDS TRANSLATION ## +#openblocks.misc.shape.cuboid=Cuboid ## NEEDS TRANSLATION ## +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## +#openblocks.misc.shape.dome=Dome ## NEEDS TRANSLATION ## +#openblocks.misc.shape.triangle=Triangle ## NEEDS TRANSLATION ## +#openblocks.misc.shape.pentagon=Pentagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.hexagon=Hexagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.octagon=Octagon ## NEEDS TRANSLATION ## +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## + +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## +#openblocks.misc.width=Width: %d ## NEEDS TRANSLATION ## +#openblocks.misc.height=Height: %d ## NEEDS TRANSLATION ## +#openblocks.misc.depth=Depth: %d ## NEEDS TRANSLATION ## + +#openblocks.misc.radio.too_many=Too many radios already playing ## NEEDS TRANSLATION ## +#openblocks.misc.radio.invalid_stream=Invalid stream ## NEEDS TRANSLATION ## +#openblocks.misc.radio.invalid_url=Invalid URL ## NEEDS TRANSLATION ## +#openblocks.misc.radio.url_not_found=URL not found ## NEEDS TRANSLATION ## +#openblocks.misc.radio.unknown_stream_type=Unknown stream type ## NEEDS TRANSLATION ## +#openblocks.misc.radio.malformed_data=Malformed data in stream ## NEEDS TRANSLATION ## +#openblocks.misc.radio.not_ready=Stream not ready, try again later ## NEEDS TRANSLATION ## +#openblocks.misc.radio.cant_connect=Can't connect ## NEEDS TRANSLATION ## +#openblocks.misc.radio.unknown_error=Unknown error ## NEEDS TRANSLATION ## +#openblocks.misc.radio.muted=Sounds are muted! ## NEEDS TRANSLATION ## + +#openblocks.misc.side.east=East side ## NEEDS TRANSLATION ## +#openblocks.misc.side.west=West side ## NEEDS TRANSLATION ## +#openblocks.misc.side.north=North side ## NEEDS TRANSLATION ## +#openblocks.misc.side.south=South side ## NEEDS TRANSLATION ## +#openblocks.misc.side.up=Top side ## NEEDS TRANSLATION ## +#openblocks.misc.side.down=Bottom side ## NEEDS TRANSLATION ## + +#openblocks.misc.command.invalid=Invalid command arguments ## NEEDS TRANSLATION ## +#openblocks.misc.command.no_flim_flam=Invalid flim-flam name ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_source=Player %s had been successfully flim-flammed with %s ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_target=Someone doesn't like you. Someone with power ## NEEDS TRANSLATION ## +#openblocks.misc.command.flim_flam_failed=Flim-flamming failed! ## NEEDS TRANSLATION ## +#openblocks.misc.command.luck_added=Luck changed for player %s, current: %d ## NEEDS TRANSLATION ## +#openblocks.misc.command.luck_current=Player %s luck: %d ## NEEDS TRANSLATION ## + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## +#openblocks.flim_flammed=Something weird happens around you ## NEEDS TRANSLATION ## openblocks.turtle.magnet=Imã tile.openblocks.elevator.name=Elevador +#tile.openblocks.elevator.description=Place one elevator directly three or more blocks above another with no blocks inbetween and you'll be able to either 'jump' to move up, or 'crouch' to move down. Elevators can be dyed by clicking on them with dye, however, you can only teleport between elevators of the same color. ## NEEDS TRANSLATION ## + +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=Curador +#tile.openblocks.heal.description=The healing block is a creative-mode only block that gives off a slight healing effect over time. ## NEEDS TRANSLATION ## + tile.openblocks.guide.name=Guia de construção +#tile.openblocks.guide.description=The building guide, once powered with redstone, will give you an outline of ghost blocks in different shapes and sizes that'll help you plan out rooms.\nUse touch-buttons on block to change outline dimensions and shapes.\nColor of markers can be changed by using dye on central block. ## NEEDS TRANSLATION ## + +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=Escada cansada +#tile.openblocks.ladder.description=The jaded ladder solves that annoying problem of jumping out of a trapdoor at the top of a ladder. The jaded ladder acts as both a trap door and a ladder at the same time. ## NEEDS TRANSLATION ## + +#tile.openblocks.tank.filled.name=%s Tank ## NEEDS TRANSLATION ## tile.openblocks.tank.name=Tanque -tile.openblocks.target.name=Alvo -tile.openblocks.grave.name=Túmulo +#tile.openblocks.tank.description=Tanks can hold liquids. If you place tanks next to each other and they'll distribute their liquid between the tanks. You can place liquid into the tanks using buckets. If the tank contains XP Juice you can click on them with an empty hand to give yourself some of the XP. When broken tanks will retain their liquid. ## NEEDS TRANSLATION ## + tile.openblocks.flag.name=Bandeira -tile.openblocks.trophy.name=Troféu +#tile.openblocks.flag.description=Flags can be used for decoration or for marking the way back out of a cave you've ventured in to. The flag will point in the direction that you placed it, or you can put it on walls. If you shift-click with a flag in your hand it will change color. ## NEEDS TRANSLATION ## + tile.openblocks.beartrap.name=Armadilha de ursos -tile.openblocks.sprinkler.name=Borrifador -tile.openblocks.vacuumhopper.name=Funil a vácuo +#tile.openblocks.beartrap.description=Place a bear trap and click on it to open it up. When a mob walks over the trap they'll be unable to move! ## NEEDS TRANSLATION ## + tile.openblocks.sponge.name=Esponja +#tile.openblocks.sponge.description=The sponge is a replacement for the vanilla sponge. Perfect for removing small pockets of lava or water. Be careful when using it on large areas of liquid though as it'll start to get quite messy. ## NEEDS TRANSLATION ## + +#item.openblocks.spongeonastick.name=Sponge ## NEEDS TRANSLATION ## +#item.openblocks.spongeonastick.description=The sponge on a stick is a tool for cleaning up liquids. Works just like the sponge, but is more mobile at the expense of wearing out. ## NEEDS TRANSLATION ## + +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Canhão de itens -tile.openblocks.bigbutton.name=Grande botão -tile.openblocks.fan.name=Ventilador -tile.openblocks.xpbottler.name=Engarrafador de experiência -tile.openblocks.village_highlighter.name=Realçador de aldeões -tile.openblocks.path.name=Caminho -tile.openblocks.autoanvil.name=Bigorna automática -tile.openblocks.autoenchantmenttable.name=Mesa de encantamentos automática -tile.openblocks.xpdrain.name=Dreno de experiência +#tile.openblocks.cannon.description=When given a redstone signal, the item cannon will shoot items that it finds in an adjacent inventory. Use the 'pointer' item to aim the cannon. ## NEEDS TRANSLATION ## + tile.openblocks.ropeladder.name=Corda +#tile.openblocks.ropeladder.description=When you place a rope ladder it'll roll out all the way to the ground. For every created ladder block it will use one item from stack. ## NEEDS TRANSLATION ## + +tile.openblocks.sprinkler.name=Borrifador +#tile.openblocks.sprinkler.description=The sprinkler will help fertilize crops up to 4 blocks away. Simply place it above an OpenBlocks tank filled with water! You can also add bonemeal for an even faster rate of growth.\nIt also acts as a water source block! ## NEEDS TRANSLATION ## + +#tile.openblocks.paintmixer.name=Paint Mixer ## NEEDS TRANSLATION ## +#tile.openblocks.paintmixer.description=The paint mixer can mix any colour of paint you want! Drop either an existing paint bucket or a bucket of milk into the top slot, then cyan, magenta, yellow and black dyes into the other four slots and click mix! ## NEEDS TRANSLATION ## + +#tile.openblocks.canvas.name=Canvas ## NEEDS TRANSLATION ## +#tile.openblocks.canvas.description=The canvas is a perfectly white block that's perfect for painting. See the Paint Mixer for information about making paints. ## NEEDS TRANSLATION ## + +tile.openblocks.fan.name=Ventilador +#tile.openblocks.fan.description=The fan will blow players, mobs or entities in the direction it's facing. ## NEEDS TRANSLATION ## + +tile.openblocks.target.name=Alvo +#tile.openblocks.target.description=The target will give out a redstone signal of a strength relative to the accuracy of the player's aim. Give the target a redstone signal to make it pop up! ## NEEDS TRANSLATION ## + +tile.openblocks.path.name=Caminho +#tile.openblocks.path.description=The path doesn't do anything. It just looks nice! ## NEEDS TRANSLATION ## + +#tile.openblocks.itemDropper.name=Item Dropper ## NEEDS TRANSLATION ## +#tile.openblocks.itemDropper.description=The item dropper is similar to the vanilla dropper, except it drops items directly down in a straight line. ## NEEDS TRANSLATION ## + +tile.openblocks.bigbutton.name=Grande botão +#tile.openblocks.bigbutton.description=The big button is a large button that can be placed on walls. If you shift-click on the button with an empty hand it will bring up an inventory with a single slot. You can put items into this slot to increase the length of time the button is pressed - one item increases the button press by one tick. ## NEEDS TRANSLATION ## + +tile.openblocks.xpdrain.name=Dreno de experiência +#tile.openblocks.xpdrain.description=Place the XP drain above an OpenBlocks tank and stand on it. Your XP will drain into the tank, which can then be used for blocks such as the auto enchantment table or the auto anvil. ## NEEDS TRANSLATION ## + +tile.openblocks.vacuumhopper.name=Funil a vácuo +#tile.openblocks.vacuumhopper.description=The vacuum hopper will suck up items and XP orbs around it. You can use the tabs on the right of the interface to select which sides to output to. ## NEEDS TRANSLATION ## + +tile.openblocks.village_highlighter.name=Realçador de aldeões +#tile.openblocks.village_highlighter.description=Drop the village highlighter down in a village and give it a redstone signal. It will outline the perimeter of the village and draw a box in the iron golem spawning area. Useful if you want to make sure villages don't merge into each other or you're making an iron farm! ## NEEDS TRANSLATION ## + +#tile.openblocks.donationStation.name=Donation Station ## NEEDS TRANSLATION ## +#tile.openblocks.donationStation.description=Love a block or item and want to show the mod developer some appreciation? Drop it into the donation station and if we know the authors donation page we'll give you a link. ## NEEDS TRANSLATION ## + +#tile.openblocks.blockPlacer.name=Block Placer ## NEEDS TRANSLATION ## +#tile.openblocks.blockPlacer.description=When given a redstone pulse the block placer will place an item in the direction it's facing. ## NEEDS TRANSLATION ## + +#tile.openblocks.blockbreaker.name=Block Breaker ## NEEDS TRANSLATION ## +#tile.openblocks.blockbreaker.description=When given a redstone pulse the block breaker will break the block it's facing. ## NEEDS TRANSLATION ## + +#tile.openblocks.projector.name=Height Map Projector ## NEEDS TRANSLATION ## +#tile.openblocks.projector.description=I'll let you write this one boq! ## NEEDS TRANSLATION ## +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## + +tile.openblocks.autoenchantmenttable.name=Mesa de encantamentos automática +#tile.openblocks.autoenchantmenttable.description=The auto enchantment table works in a similar way to the vanilla enchantment table except it runs off XP juice. Use the tabs on the right side of the interface to select where items or xp can be pulled from. Just like with the vanilla table bookshelves are required for higher levels. ## NEEDS TRANSLATION ## + +tile.openblocks.xpbottler.name=Engarrafador de experiência +#tile.openblocks.xpbottler.description=The XP bottler will take XP juice and bottle it up into glass bottles to create bottles o' enchanting. ## NEEDS TRANSLATION ## + +tile.openblocks.autoanvil.name=Bigorna automática +#tile.openblocks.autoanvil.description=The auto anvil works just like the vanilla anvil, except it runs from XP juice and can be fully automated.\n\nUse the tabs on the right of the GUI to select which sides of the anvil items or liquid can be inserted or extracted. Right click and drag the anvil in the tab to spin it around and select other sides! ## NEEDS TRANSLATION ## + +#tile.openblocks.drawingtable.name=Drawing Table ## NEEDS TRANSLATION ## +#tile.openblocks.drawingtable.description=The drawing table is for creating stencils which can be used while painting. Insert an Unprepared Stencil into the drawing table then use the arrows to select which stencil you want! ## NEEDS TRANSLATION ## + +tile.openblocks.grave.name=Túmulo +tile.openblocks.trophy.name=Troféu +#tile.openblocks.trophy.entity.name=%s Trophy ## NEEDS TRANSLATION ## +#tile.openblocks.canvasglass.name=Glass Canvas ## NEEDS TRANSLATION ## +#tile.openblocks.paintcan.name=Paint Can ## NEEDS TRANSLATION ## + +#tile.openblocks.sky.normal.name=Sky Block ## NEEDS TRANSLATION ## +#tile.openblocks.sky.normal.description=Bring the outside inside with the new Sky block! Just apply a redstone signal. We also offer an inverted version. ## NEEDS TRANSLATION ## +#tile.openblocks.sky.inverted.name=Inverted Sky Block ## NEEDS TRANSLATION ## + +#tile.openblocks.radio.name=Radio ## NEEDS TRANSLATION ## +#tile.openblocks.radio.description=The radio allows you to stream internet radio! First, you need some tuned crystals which you can find in dungeon chests or from a special villager. Place the crystal in the radio and supply it with a redstone signal to turn it on. The redstone strength controls the volume.\n\nYou can configure which radio stations are available in the servers config file. ## NEEDS TRANSLATION ## + +#tile.openblocks.xpshower.name=XP Shower ## NEEDS TRANSLATION ## +#tile.openblocks.xpshower.description=Attach an XP shower to a tank of XP juice and it'll pour out XP orbs. These orbs can be collected by an XP Drain or an MFR Sewer. ## NEEDS TRANSLATION ## + +#tile.openblocks.scaffolding.name=Scaffolding ## NEEDS TRANSLATION ## +#tile.openblocks.scaffolding.description=Have you ever wanted to pillar up somewhere without leaving an ugly tower behind? Well, now you can! Simply build with scaffolding blocks and they will automatically despawn when you are done. ## NEEDS TRANSLATION ## + +#tile.openblocks.goldenegg.name=Golden Egg ## NEEDS TRANSLATION ## + +#tile.openblocks.digitalfuse.name=Digital Fuse ## NEEDS TRANSLATION ## + +#item.openblocks.cursor.name=Cursor ## NEEDS TRANSLATION ## +#item.openblocks.cursor.description=The cursor will let you click on blocks remotely.\nSimply shift-click onto a block to link the cursor, then use the cursor wherever you like to click on the target block. Be warned, by default the cursor uses up your XP relative to how far you are from the block you're clicking. ## NEEDS TRANSLATION ## + +#item.openblocks.devnull.name=/dev/null ## NEEDS TRANSLATION ## +#item.openblocks.devnull.description=Click using /dev/null to open the inventory. There's a single inventory slot - put an item in there - dirt, for example. As you gather dirt from the ground this slot will fill up. Once it's full, any more dirt you pick up will be automatically discarded. You can shift-click with the item in your hand as though you were placing the block! ## NEEDS TRANSLATION ## + +item.openblocks.slimalyzer.name=Gosmalizador +#item.openblocks.slimalyzer.description=Walk around with the slimalyzer in your hand and it'll light up whenever you're in a slime spawning chunk. ## NEEDS TRANSLATION ## item.openblocks.hangglider.name=Planador +#item.openblocks.hangglider.description=The hang glider is self explanatory. Hold it in your hand and click to place it on your back. Now jump!\nTo increase your speed you can press shift while gliding, but watch out, you'll lose altitude faster! ## NEEDS TRANSLATION ## + item.openblocks.gliderwing.name=Asa do planador + +item.openblocks.sleepingbag.name=Saco de Dormir +#item.openblocks.sleepingbag.description=The sleeping bag lets you sleep out in the wilderness without having to reset your spawn location. To sleep, simply wear it on your back. ## NEEDS TRANSLATION ## + item.openblocks.luggage.name=Bagagem +#item.openblocks.luggage.description=Luggage is your new friend. He'll follow you around anywhere you go collecting any items he finds on the floor. Nom nom nom!\nTo dismantle him just shift-click on him and he'll turn into an item that you can carry around.\nIf he ever gets struck by lightning he'll be able to carry even more items! ## NEEDS TRANSLATION ## + item.openblocks.sonicglasses.name=Óculos sônicos +#item.openblocks.sonicglasses.description=Introducing the fantabulous new Sonic Glasses!\nThis new and exciting technology from OpenMods Inc allow you see what you hear! ## NEEDS TRANSLATION ## + +#item.openblocks.squeegee.name=Squeegee ## NEEDS TRANSLATION ## +#item.openblocks.squeegee.description=The squeegee removes paint from any painted blocks. Just click on the side of the block you want to remove the paint from, or alternative shift-click the block to remove paint from all sides! ## NEEDS TRANSLATION ## + +#item.openblocks.paintbrush.name=Paint Brush ## NEEDS TRANSLATION ## +#item.openblocks.paintbrush.description=Paint brushes let you paint blocks in whatever color you like!\n\nDab your paint brush in a Paint Can made in the Paint Mixer then click on a block to paint it.\n\nCanvas blocks are perfect for painting, but you can also paint quite a few vanilla blocks and even some blocks from other mods. You can also place stencils on blocks and then paint over the stencil! ## NEEDS TRANSLATION ## + +#item.openblocks.unprepared_stencil.name=Unprepared Stencil ## NEEDS TRANSLATION ## +#item.openblocks.unprepared_stencil.description=Stencils can be placed onto blocks and then painted over using paint brushes!\n\nYou can paint a block using multiple stencils and you can click on them with an empty hand to rotate them.\n\nPlace an Unprepared Stencil in a Drawing table to create different patterns. ## NEEDS TRANSLATION ## + +item.openblocks.crane_backpack.name=Mochila de guindaste +#item.openblocks.crane_backpack.description=In Minecraft world "magnet" is ancient word for "how do this works?".\n\nThis particular piece of very equipment allows you to pick and carry mobs, players, items and blocks. Can be controlled with magnet control. ## NEEDS TRANSLATION ## + +item.openblocks.crane_control.name=Controle do guindaste +#item.openblocks.crane_control.description=This hi-tech wireless remote is used for controlling magnet backpacks.\n\nRight click to raise, Sneak + right click to lower, left click to pick/release.\nBlinking light signals something is under magnet. ## NEEDS TRANSLATION ## + +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + +#item.openblocks.stencil.name=Stencil ## NEEDS TRANSLATION ## item.openblocks.crayon.name=Giz de cera mágico item.openblocks.pencil.name=Lapis mágico item.openblocks.glasses.pencil.name=Óculos de lápis item.openblocks.glasses.crayon.name=Óculos de giz de cera item.openblocks.glasses.technicolor.name=Incríveis óculos technicolor item.openblocks.glasses.admin.name=Óculos Fodões -item.openblocks.crane_backpack.name=Mochila de guindaste -item.openblocks.crane_control.name=Controle do guindaste item.openblocks.crane_engine.name=Motor do guindaste item.openblocks.crane_magnet.name=Imã do guindaste item.openblocks.beam.name=Holofote item.openblocks.line.name=Linha item.openblocks.miracle_magnet.name=§5Imã milagroso§r -item.openblocks.slimalyzer.name=Gosmalizador +#item.openblocks.info_book.name=World Domination with OpenBlocks ## NEEDS TRANSLATION ## item.openblocks.xpbucket.name=Balde de experiência -item.openblocks.sleepingbag.name=Saco de Dormir +#item.openblocks.height_map.name=Height Map ## NEEDS TRANSLATION ## +#item.openblocks.empty_map.name=Empty Map ## NEEDS TRANSLATION ## +#item.openblocks.map_controller.name=Map Controller Module ## NEEDS TRANSLATION ## +#item.openblocks.map_memory.name=Map Memory Module ## NEEDS TRANSLATION ## +#item.openblocks.cartographer.name=Cartographer ## NEEDS TRANSLATION ## +#item.openblocks.assistant_base.name=Assistant's base ## NEEDS TRANSLATION ## +#item.openblocks.sketching_pencil.name=Sketching Pencil ## NEEDS TRANSLATION ## +#item.openblocks.tasty_clay.name=Tasty Clay ## NEEDS TRANSLATION ## +#item.openblocks.golden_eye.name=Golden eye ## NEEDS TRANSLATION ## +#item.openblocks.pointer.name=Pointer ## NEEDS TRANSLATION ## +#item.openblocks.tuned_crystal.name=Tuned Crystal ## NEEDS TRANSLATION ## +#item.openblocks.pedometer.name=Pedometer ## NEEDS TRANSLATION ## + +#item.openblocks.wallpaper.name=Wallpaper ## NEEDS TRANSLATION ## itemGroup.tabOpenBlocks=OpenBlocks + +#entity.OpenBlocks.Luggage.name=Luggage ## NEEDS TRANSLATION ## +#entity.OpenBlocks.Cartographer.name=Cartographer ## NEEDS TRANSLATION ## +#entity.OpenBlocks.Block.name=Floating Block ## NEEDS TRANSLATION ## +#entity.OpenBlocks.MiniMe.name=Mini Me ## NEEDS TRANSLATION ## + +#fluid.OpenBlocks.xpjuice=Liquid XP ## NEEDS TRANSLATION ## diff --git a/src/main/resources/assets/openblocks/lang/ru_RU.lang b/src/main/resources/assets/openblocks/lang/ru_RU.lang index ff21e92f..d23fdaa3 100644 --- a/src/main/resources/assets/openblocks/lang/ru_RU.lang +++ b/src/main/resources/assets/openblocks/lang/ru_RU.lang @@ -38,7 +38,6 @@ openblocks.gui.drawingtable=Стол для рисования openblocks.gui.digitalfuse=Цифровой запал openblocks.gui.xp_outputs=Выходы опыта openblocks.gui.item_outputs=Выходы предметов -openblocks.gui.watch_video=Смотреть видео openblocks.gui.max_level=Макс. уровень: %d openblocks.gui.save_folder=Сохранить папку @@ -86,12 +85,14 @@ openblocks.misc.selected_cannon=Выбрана пушка для прицели openblocks.misc.pointed_cannon=Пушка направлена на %s, %s, %s openblocks.misc.change_mode=Изменение режима на %s openblocks.misc.change_size=Изменение размера на %sx%sx%s +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=Общее количество блоков: %d openblocks.misc.get_witched=Get witched! openblocks.misc.page=Страница %d из %d openblocks.misc.oh_no_ceiling=Вы не можете спать здесь. Вас беспокоит потолок... openblocks.misc.oh_no_ground=Вы хотите спать на ЭТОМ!? openblocks.misc.sleeping_bag_broken=Предмет недоступен из-за неудавшейся инициализации +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## openblocks.misc.grave_msg=%s (день: %.1f) @@ -125,12 +126,16 @@ openblocks.misc.shape=Форма: %s openblocks.misc.shape.sphere=Сфера openblocks.misc.shape.cylinder=Цилиндр openblocks.misc.shape.cuboid=Куб +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=Купол openblocks.misc.shape.triangle=Треугольник openblocks.misc.shape.pentagon=Пятиугольник openblocks.misc.shape.hexagon=Шестиугольник openblocks.misc.shape.octagon=Восьмиугольник +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.width=Ширина: %d openblocks.misc.height=Высота: %d openblocks.misc.depth=Глубина: %d @@ -159,7 +164,9 @@ openblocks.misc.command.flim_flam_source=Игрок %s успешно стал openblocks.misc.command.flim_flam_target=Кто-то не любит Вас. Кто-то, у кого есть сила openblocks.misc.command.flim_flam_failed=Не удалось стать братом! openblocks.misc.command.luck_added=Удача изменена для игрока %s, текущая: %d -openblocks.misc.command.luck_current=Удача: %d игрока %s +openblocks.misc.command.luck_current=Удача: %2$d игрока %1$s + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=Что-то странное происходит вокруг Вас openblocks.turtle.magnet=Магнит @@ -197,6 +204,9 @@ tile.openblocks.sponge.description=Губка является заменой о item.openblocks.spongeonastick.name=Губка на палочке item.openblocks.spongeonastick.description=Губка на палочке - это инструмент для очистки жидкостей. Работает, как простая губка, но более мобильна за счёт изнашивания. +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=Предметная пушка tile.openblocks.cannon.description=Когда подан сигнал красного камня, предметная пушка будет выстреливать предметы, которые она найдёт в соседнем инвентаре. Используйте 'указатель', чтобы направить пушку. @@ -247,6 +257,7 @@ tile.openblocks.blockbreaker.description=Когда будет подан сиг tile.openblocks.projector.name=Прожектор карты высот tile.openblocks.projector.description=Пусть boq напишет описание для него! +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=Автоматический стол зачаровывания tile.openblocks.autoenchantmenttable.description=Автоматический стол зачаровывания работает так же, как и обычный стол зачаровывания, но он требует жидкий опыт. В правой части интерфейса Вы можете выбрать, какие стороны стола будут использованы для извлечения/помещения жидкого опыта/предметов. Так же, книжные полки будут влиять на уровень зачарования. @@ -255,7 +266,7 @@ tile.openblocks.xpbottler.name=Разливщик опыта tile.openblocks.xpbottler.description=Разливщик опыта будет брать жидкий опыт и заливать его в стеклянные бутылки, создавая тем самым зелье опыта. tile.openblocks.autoanvil.name=Автоматическая наковальня -tile.openblocks.autoanvil.description=Автоматическая наковальня работает так же, как и обычная наковальня, но она требует жидкий опыт, и может быть полностью автоматизирована.n\n\В правой части интерфейса Вы можете выбрать, какие стороны наковальни будут использованы для извлечения/помещения жидкостей/предметов. +tile.openblocks.autoanvil.description=Автоматическая наковальня работает так же, как и обычная наковальня, но она требует жидкий опыт, и может быть полностью автоматизирована.n\nВ правой части интерфейса Вы можете выбрать, какие стороны наковальни будут использованы для извлечения/помещения жидкостей/предметов. tile.openblocks.drawingtable.name=Стол для рисования tile.openblocks.drawingtable.description=Стол для рисования нужен для создания трафаретов, которые можно использовать во время рисования. Вставьте неподготовленный трафарет в стол для рисования и выберете нужный Вам трафарет, используя стрелки для выбора! @@ -282,6 +293,7 @@ tile.openblocks.scaffolding.description=Вы когда-нибудь хотел tile.openblocks.goldenegg.name=Золотое яйцо tile.openblocks.digitalfuse.name=Цифровой запал + item.openblocks.cursor.name=Курсор item.openblocks.cursor.description=Курсор позволит Вам нажимать на блоки удалённо.\nПросто нажмите shift-ПКМ по блоку, чтобы соединить курсор, затем примените курсор туда, куда Вы хотите нажать. Будьте осторожны, по умолчанию курсор использует Ваш опыт, количество потребляемого опыта зависит от дальности блока, на который Вы нажимаете. @@ -320,6 +332,9 @@ item.openblocks.crane_backpack.description=В мире Minecraft "магнит" item.openblocks.crane_control.name=Крановое управление item.openblocks.crane_control.description=Этот высокотехнологичный беспроводной пульт используется для управления хранилищами.\n\nПКМ, чтобы поднять, ПКМ, присев, чтобы опустить, ЛКМ, чтобы поднять/отпустить.\nМигающие световые сигналы относятся к магниту. +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + item.openblocks.stencil.name=Трафарет item.openblocks.crayon.name=Магический цветной карандаш item.openblocks.pencil.name=Магический карандаш diff --git a/src/main/resources/assets/openblocks/lang/zh_CN.lang b/src/main/resources/assets/openblocks/lang/zh_CN.lang index 80bbd68d..dcc97eb4 100644 --- a/src/main/resources/assets/openblocks/lang/zh_CN.lang +++ b/src/main/resources/assets/openblocks/lang/zh_CN.lang @@ -38,7 +38,6 @@ openblocks.gui.drawingtable=绘图桌 openblocks.gui.digitalfuse=游标 openblocks.gui.xp_outputs=输出经验 openblocks.gui.item_outputs=输出物品 -openblocks.gui.watch_video=观看教学视频 openblocks.gui.max_level=最高附魔等级: %d openblocks.gui.save_folder=打开存档文件夹 @@ -86,12 +85,14 @@ openblocks.misc.selected_cannon=选择加农炮发射目标 openblocks.misc.pointed_cannon=加农炮已瞄准 %s, %s, %s openblocks.misc.change_mode=改变至%s模式 openblocks.misc.change_size=改变规模至 %s x %s x %s +#openblocks.misc.change_box_size=Changing size to (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.total_blocks=搭建共需要: %d 个方块 openblocks.misc.get_witched=为之沉迷! openblocks.misc.page=%d / %d 页 openblocks.misc.oh_no_ceiling=你睡意全无,头顶空空荡荡,房子徒有四壁,令你坐立难安... openblocks.misc.oh_no_ground=你居然还想要睡在那上面!? openblocks.misc.sleeping_bag_broken=由于初始化错误,该物品无法生效 +#openblocks.misc.inverted=Inverted ## NEEDS TRANSLATION ## openblocks.misc.grave_msg=%s (天数: %.1f) @@ -125,12 +126,16 @@ openblocks.misc.shape=形状: %s openblocks.misc.shape.sphere=球体 openblocks.misc.shape.cylinder=圆柱 openblocks.misc.shape.cuboid=立方 +#openblocks.misc.shape.full_cuboid=Full Cuboid ## NEEDS TRANSLATION ## openblocks.misc.shape.dome=圆锥 openblocks.misc.shape.triangle=三角形 openblocks.misc.shape.pentagon=五边形 openblocks.misc.shape.hexagon=六边形 openblocks.misc.shape.octagon=八边形 +#openblocks.misc.shape.axes=Axes ## NEEDS TRANSLATION ## +#openblocks.misc.shape.planes=Planes ## NEEDS TRANSLATION ## +#openblocks.misc.box=Dimensions: (%d,%d,%d):(%d,%d,%d) ## NEEDS TRANSLATION ## openblocks.misc.width=宽度: %d openblocks.misc.height=高度: %d openblocks.misc.depth=深度: %d @@ -160,6 +165,8 @@ openblocks.misc.command.flim_flam_target=某个有权限的人不太喜欢你. openblocks.misc.command.flim_flam_failed=欺骗失败! openblocks.misc.command.luck_added=与玩家 %s 交换运气值,当前运气值为: %d openblocks.misc.command.luck_current=玩家 %s 的运气值: %d + +#openblocks.misc.hidden_lore=§a§oHold ALT to see history§r ## NEEDS TRANSLATION ## openblocks.flim_flammed=你周围发生了一些诡异的事. openblocks.turtle.magnet=磁铁 @@ -167,12 +174,17 @@ openblocks.turtle.magnet=磁铁 tile.openblocks.elevator.name=电梯 tile.openblocks.elevator.description=将一个电梯方块在另一个电梯方块正上方三格或以上的位置,中间不能有障碍物.玩家在电梯上跳跃时就会向上传送,蹲下时就向下传送.电梯可以用染料右键染色,相同颜色的电梯才能互相传送玩家. +#tile.openblocks.elevator_rotating.name=Rotating Elevator ## NEEDS TRANSLATION ## + tile.openblocks.heal.name=治愈方块 tile.openblocks.heal.description=只有在创造模式下才能得到治愈方块,它会为站在上方的玩家提供轻微的治疗效果. tile.openblocks.guide.name=建筑指导仪 tile.openblocks.guide.description=提供红石信号,建筑指导仪便会投影出方块轮廓.你可以通过Shift+右键它来改变形状,或者右键它的不同面来增大或减小轮廓.\n创造模式下将黑曜石放在建筑指导仪上,再拿着任何方块右键它,则会自动完成搭建. +#tile.openblocks.builder_guide.name=Enhanced Building Guide ## NEEDS TRANSLATION ## +#tile.openblocks.builder_guide.description=This enhanced version of building guide not only displays ghost blocks to make building easier, but also allows you to place actual blocks. Just click central block with any block stack!\nWhen in creative mode you can place an obsidian block above, then hit the building guide with any block you like to automatically create the shape. ## NEEDS TRANSLATION ## + tile.openblocks.ladder.name=梯子活板门 tile.openblocks.ladder.description=爬梯子遇上活板门时必须跳出去是件麻烦事,但梯子活板门解决了这个问题.梯子活板门可以在打开时起到梯子的作用,让玩家顺着活板门爬上去. @@ -192,6 +204,9 @@ tile.openblocks.sponge.description=这种海绵是原版海绵的重置版.它 item.openblocks.spongeonastick.name=海绵棒 item.openblocks.spongeonastick.description=类似海绵,海绵棒可用于清理一片范围内的液体.但它比海绵更方便,也很容易坏掉. +#item.openblocks.epic_eraser.name=Epic Eraser ## NEEDS TRANSLATION ## +#item.openblocks.epic_eraser.description=Every item has its own history...\n\nDon't you hate it?\nWith this item you can scrub all traces of epic lore your loot has collected over the years and then sell it on black market without worrying about evidence. ## NEEDS TRANSLATION ## + tile.openblocks.cannon.name=投掷加农炮 tile.openblocks.cannon.description=当投掷加农炮接收到红石信号时,投掷加农炮会向指定目标投掷出相邻容器内的物品.你可以使用'指针'工具来给加农炮定位投掷的目标. @@ -242,6 +257,7 @@ tile.openblocks.blockbreaker.description=为方块采掘器通入红石信号, tile.openblocks.projector.name=高度图投影仪 tile.openblocks.projector.description=用于显示由制图机器人制作的高度图.将高度图放入投影仪内,将在其上方显示3D的全息地图. +#tile.openblocks.projector.working.name=Height Map Projector ## NEEDS TRANSLATION ## tile.openblocks.autoenchantmenttable.name=自动附魔台 tile.openblocks.autoenchantmenttable.description=自动附魔台的使用方法类似于普通附魔台,但它可以通过消耗经验来自动工作.\n在操作界面右边的设定栏可以调整输入经验或工具的面.自动附魔台也需要书架来提升自己的附魔等级上限. @@ -277,6 +293,7 @@ tile.openblocks.scaffolding.description=你是否想过通过向脚下垫方块 tile.openblocks.goldenegg.name=金蛋 tile.openblocks.digitalfuse.name=游标 + item.openblocks.cursor.name=游标 item.openblocks.cursor.description=游标可以让你远程控制方块.手持游标Shift右键一个方块就可以建立连接,之后用游标右键空气就控制连接的方块.\n默认设置下,使用游标与方块远程互动会消耗你的经验,距离越远,消耗越多. @@ -315,6 +332,9 @@ item.openblocks.crane_backpack.description=在Minecraft的世界里,磁铁是一 item.openblocks.crane_control.name=起重机控制器 item.openblocks.crane_control.description=这个高科技的无线遥控工具,能用来控制起重机背包.\n右键升起,Shift+右键降低,左键拾取/释放.\n当有光在闪烁时,表示物体正受到磁力影响. +#item.openblocks.wrench.name=Big Metal Bar ## NEEDS TRANSLATION ## +#item.openblocks.wrench.description=This is extremely sophisticated tool used to perform transformations of objects with octahedral symmetry.\n\n\nOr just big, dumb piece of metal you can use to rotate cubes and stuff.\n\nSo yeah, it's yet another wrench. I'm just trying to be original here, ok? ## NEEDS TRANSLATION ## + item.openblocks.stencil.name=模板 item.openblocks.crayon.name=魔法蜡笔 item.openblocks.pencil.name=魔法铅笔 diff --git a/src/main/resources/assets/openblocks/shaders/shader.frag b/src/main/resources/assets/openblocks/shaders/shader.frag new file mode 100644 index 00000000..bbcc946b --- /dev/null +++ b/src/main/resources/assets/openblocks/shaders/shader.frag @@ -0,0 +1,17 @@ +#version 150 + +uniform float uHasTexture; +uniform float uHasColor; +uniform sampler2D uDefaultTexture; +uniform vec3 uColor; + +in vec2 vTexCoord; +in vec4 vColor; + +void main() +{ + vec4 color = vec4(uColor, 1.0); + color *= 1.0 - (1.0 - texture2D(uDefaultTexture, vTexCoord)) * uHasTexture; + color *= 1.0 - (1.0 - vColor) * uHasColor; + gl_FragColor = color; +} \ No newline at end of file diff --git a/src/main/resources/assets/openblocks/shaders/shader.vert b/src/main/resources/assets/openblocks/shaders/shader.vert new file mode 100644 index 00000000..0ad4668b --- /dev/null +++ b/src/main/resources/assets/openblocks/shaders/shader.vert @@ -0,0 +1,20 @@ +#version 150 compatibility + +in vec3 aVertex; +in vec2 aTexCoord; +in vec4 aColor; +in vec3 aPosition; + +uniform float uScale; + +out vec2 vTexCoord; +out vec4 vColor; + +const vec3 offset = vec3(0.5, 0, 0.5); + +void main() +{ + vTexCoord = aTexCoord; + vColor = aColor; + gl_Position = gl_ModelViewProjectionMatrix * vec4(aVertex * uScale + aPosition + offset, 1); +} \ No newline at end of file diff --git a/src/main/resources/assets/openblocks/sounds.json b/src/main/resources/assets/openblocks/sounds.json index aef30c77..8f127ed1 100644 --- a/src/main/resources/assets/openblocks/sounds.json +++ b/src/main/resources/assets/openblocks/sounds.json @@ -2,137 +2,137 @@ "elevator.activate": { "category": "block", "sounds": [ - "teleport" + "openblocks:teleport" ] }, "cannon.activate": { "category": "block", "sounds": [ - "cannon" + "openblocks:cannon" ] }, "radio.activate": { "category": "block", "sounds": [ - "radio" + "openblocks:radio" ] }, "bottler.signal": { "category": "block", "sounds": [ - "fill" + "openblocks:fill" ] }, "crayon.place": { "category": "block", "sounds": [ - "draw1", - "draw2", - "draw3", - "draw4" + "openblocks:draw1", + "openblocks:draw2", + "openblocks:draw3", + "openblocks:draw4" ] }, "target.open": { "category": "block", "sounds": [ - "open" + "openblocks:open" ] }, "target.close": { "category": "block", "sounds": [ - "close" + "openblocks:close" ] }, "beartrap.open": { "category": "block", "sounds": [ - "beartrapopen" + "openblocks:beartrapopen" ] }, "beartrap.close": { "category": "block", "sounds": [ - "beartrapclose", - "beartrapcloseb" + "openblocks:beartrapclose", + "openblocks:beartrapcloseb" ] }, "luggage.eat.item": { "category": "neutral", "sounds": [ - "chomp" + "openblocks:chomp" ] }, "luggage.eat.food": { "category": "neutral", "sounds": [ - "slowpokenom" + "openblocks:slowpokenom" ] }, "luggage.walk": { "category": "neutral", "sounds": [ - "feet" + "openblocks:feet" ] }, "slimalyzer.signal": { "category": "player", "sounds": [ - "beep" + "openblocks:beep" ] }, "pedometer.use": { "category": "player", "sounds": [ - "beep" + "openblocks:beep" ] }, "squeegee.use": { "category": "player", "sounds": [ - "wipe" + "openblocks:wipe" ] }, "best.feature.ever.fart": { "category": "player", "sounds": [ - "fart1", - "fart2", - "fart3", - "fart4" + "openblocks:fart1", + "openblocks:fart2", + "openblocks:fart3", + "openblocks:fart4" ] }, "annoying.mosquito": { "category": "master", "sounds": [ - "mosquito" + "openblocks:mosquito" ] }, "annoying.alarmclock": { "category": "master", "sounds": [ - "alarmclock" + "openblocks:alarmclock" ] }, "annoying.vibrate": { "category": "master", "sounds": [ - "vibrate" + "openblocks:vibrate" ] }, "unused.mortar": { "category": "master", "sounds": [ - "mortar" + "openblocks:mortar" ] }, "grave.rob": { "category": "block", "sounds": [ - "BWV565" + "openblocks:BWV565" ] } } \ No newline at end of file diff --git a/src/main/resources/assets/openblocks/textures/blocks/guide.png b/src/main/resources/assets/openblocks/textures/blocks/guide.png index df53edfb..faf3dc9d 100644 Binary files a/src/main/resources/assets/openblocks/textures/blocks/guide.png and b/src/main/resources/assets/openblocks/textures/blocks/guide.png differ diff --git a/src/main/resources/assets/openblocks/textures/blocks/projector_cone.png b/src/main/resources/assets/openblocks/textures/blocks/projector_cone.png new file mode 100644 index 00000000..1c2fe100 Binary files /dev/null and b/src/main/resources/assets/openblocks/textures/blocks/projector_cone.png differ diff --git a/src/main/resources/assets/openblocks/textures/blocks/projector_cone_grid.png b/src/main/resources/assets/openblocks/textures/blocks/projector_cone_grid.png new file mode 100644 index 00000000..56f4f6a2 Binary files /dev/null and b/src/main/resources/assets/openblocks/textures/blocks/projector_cone_grid.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index aa79c416..8832f46b 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,20 +1,26 @@ -[ { - "modid" : "OpenBlocks", - "name" : "OpenBlocks", - "version" : "${version}", - "url" : "http://www.openperipheral.info", - "credits" : "", - "authors": [ - "Mikee", - "NeverCast", - "boq", - "Lyqyd" - ], - "description": "All the things you never thought you will ever need", - "logoFile" : "", - "updateUrl" : "", - "parent" : "", - "screenshots": [ + "modListVersion": "2", + "modList": + [ + { + "modid": "OpenBlocks", + "name": "OpenBlocks", + "description": "All the things you never thought you will ever need", + "version": "${version}", + "mcversion": "${mc_version}", + "url": "http://openmods.info/", + "updateUrl": "", + "authorList": [ + "Mikee", + "NeverCast", + "boq", + "Lyqyd" + ], + "credits": "", + "logoFile": "", + "screenshots": [ + ], + "parent": "" + } ] -}] +}