Browse Source

first update to 1.14

Kajetan Johannes Hammerle 4 years ago
parent
commit
9a8a32e92a
100 changed files with 1767 additions and 6192 deletions
  1. 0 725
      KajetansMod.iml
  2. 0 104
      KajetansMod.ipr
  3. 0 237
      KajetansMod.iws
  4. 31 69
      build.gradle
  5. 3 0
      cleanEclipse.sh
  6. 2 1
      gradle.properties
  7. 43 35
      gradlew
  8. 20 0
      runClient.launch
  9. 17 0
      runServer.launch
  10. 27 23
      src/main/java/me/km/ClientEvents.java
  11. 32 71
      src/main/java/me/km/ClientProxy.java
  12. 6 28
      src/main/java/me/km/CommonProxy.java
  13. 6 6
      src/main/java/me/km/DamageUtils.java
  14. 96 72
      src/main/java/me/km/KajetansMod.java
  15. 0 35
      src/main/java/me/km/MeshDefinitionFix.java
  16. 25 15
      src/main/java/me/km/ObjectRegistry.java
  17. 23 15
      src/main/java/me/km/PackageHelper.java
  18. 37 25
      src/main/java/me/km/blockprotections/BlockProtection.java
  19. 11 11
      src/main/java/me/km/blockprotections/BlockProtectionBank.java
  20. 21 0
      src/main/java/me/km/blockprotections/DummyBlockProtection.java
  21. 11 0
      src/main/java/me/km/blockprotections/IBlockProtection.java
  22. 0 69
      src/main/java/me/km/blocks/BlockBase.java
  23. 0 18
      src/main/java/me/km/blocks/BlockCrate.java
  24. 0 234
      src/main/java/me/km/blocks/BlockEvents.java
  25. 7 38
      src/main/java/me/km/blocks/BlockHay.java
  26. 8 45
      src/main/java/me/km/blocks/BlockHayBed.java
  27. 68 210
      src/main/java/me/km/blocks/BlockLantern.java
  28. 29 334
      src/main/java/me/km/blocks/BlockModBed.java
  29. 17 0
      src/main/java/me/km/blocks/BlockModSapling.java
  30. 0 110
      src/main/java/me/km/blocks/BlockModSlab.java
  31. 0 13
      src/main/java/me/km/blocks/BlockOre.java
  32. 13 140
      src/main/java/me/km/blocks/BlockResistantTallGrass.java
  33. 0 114
      src/main/java/me/km/blocks/BlockSpikeTrap.java
  34. 73 0
      src/main/java/me/km/blocks/BlockSpikes.java
  35. 0 47
      src/main/java/me/km/blocks/BlockTallGrass.java
  36. 0 82
      src/main/java/me/km/blocks/BlockTrap.java
  37. 0 89
      src/main/java/me/km/blocks/EnumMetals.java
  38. 0 10
      src/main/java/me/km/blocks/IBlockBase.java
  39. 160 149
      src/main/java/me/km/blocks/ModBlocks.java
  40. 28 0
      src/main/java/me/km/blocks/ModTree.java
  41. 0 130
      src/main/java/me/km/blocks/campfire/BlockCampFire.java
  42. 0 112
      src/main/java/me/km/blocks/campfire/BlockCampFireBurning.java
  43. 0 51
      src/main/java/me/km/blocks/campfire/BlockCampFireBurnt.java
  44. 0 300
      src/main/java/me/km/blocks/campfire/TileEntityCampFire.java
  45. 31 57
      src/main/java/me/km/blocks/cookingpot/BlockCookingPot.java
  46. 31 44
      src/main/java/me/km/blocks/cookingpot/CookingPotColorMixer.java
  47. 35 41
      src/main/java/me/km/blocks/cookingpot/TileEntityCookingPot.java
  48. 0 35
      src/main/java/me/km/blocks/leaves/BlockApricotLeaves.java
  49. 0 28
      src/main/java/me/km/blocks/leaves/BlockCherryLeaves.java
  50. 0 140
      src/main/java/me/km/blocks/leaves/BlockLeaves.java
  51. 0 35
      src/main/java/me/km/blocks/leaves/BlockPearLeaves.java
  52. 0 35
      src/main/java/me/km/blocks/leaves/BlockPlumLeaves.java
  53. 0 144
      src/main/java/me/km/blocks/leaves/BlockSapling.java
  54. 0 131
      src/main/java/me/km/blocks/leaves/WorldGenTree.java
  55. 6 6
      src/main/java/me/km/chatchannel/ChatChannel.java
  56. 29 37
      src/main/java/me/km/databank/DataBank.java
  57. 0 53
      src/main/java/me/km/databank/DummyStatement.java
  58. 0 21
      src/main/java/me/km/databank/IStatement.java
  59. 0 76
      src/main/java/me/km/databank/Statement.java
  60. 98 104
      src/main/java/me/km/effects/EffectUtils.java
  61. 11 4
      src/main/java/me/km/entities/EntityBlackBear.java
  62. 11 4
      src/main/java/me/km/entities/EntityBrownBear.java
  63. 70 56
      src/main/java/me/km/entities/EntityHuman.java
  64. 22 32
      src/main/java/me/km/entities/EntityItemProjectile.java
  65. 53 42
      src/main/java/me/km/entities/EntityNobody.java
  66. 13 13
      src/main/java/me/km/entities/HumanSkinLoader.java
  67. 49 28
      src/main/java/me/km/entities/ModEntities.java
  68. 11 16
      src/main/java/me/km/entities/ModelHuman.java
  69. 12 18
      src/main/java/me/km/entities/RenderBlackBear.java
  70. 14 20
      src/main/java/me/km/entities/RenderBrownBear.java
  71. 81 106
      src/main/java/me/km/entities/RenderHuman.java
  72. 3 3
      src/main/java/me/km/entities/RenderNobody.java
  73. 4 4
      src/main/java/me/km/events/ArrowHitGroundEvent.java
  74. 0 29
      src/main/java/me/km/events/ArrowLaunchEvent.java
  75. 17 26
      src/main/java/me/km/events/CustomEventCaller.java
  76. 5 5
      src/main/java/me/km/events/PlayerHurtEvent.java
  77. 7 8
      src/main/java/me/km/events/PlayerMoveData.java
  78. 5 5
      src/main/java/me/km/events/ThrowableLaunchEvent.java
  79. 0 208
      src/main/java/me/km/fluids/BlockFluidBase.java
  80. 0 63
      src/main/java/me/km/fluids/BlockFluidHoney.java
  81. 0 64
      src/main/java/me/km/fluids/BlockFluidPoison.java
  82. 0 28
      src/main/java/me/km/fluids/ModFluids.java
  83. 0 153
      src/main/java/me/km/inventory/ContainerCampFire.java
  84. 16 9
      src/main/java/me/km/inventory/CustomContainer.java
  85. 49 37
      src/main/java/me/km/inventory/CustomContainerBase.java
  86. 8 8
      src/main/java/me/km/inventory/InventoryBase.java
  87. 4 4
      src/main/java/me/km/inventory/InventoryUtils.java
  88. 0 24
      src/main/java/me/km/items/ItemArmor.java
  89. 0 30
      src/main/java/me/km/items/ItemBase.java
  90. 0 84
      src/main/java/me/km/items/ItemBed.java
  91. 0 32
      src/main/java/me/km/items/ItemBlockSpecial.java
  92. 158 173
      src/main/java/me/km/items/ItemColoredSoup.java
  93. 16 12
      src/main/java/me/km/items/ItemCylinder.java
  94. 15 11
      src/main/java/me/km/items/ItemFood.java
  95. 16 16
      src/main/java/me/km/items/ItemGemStone.java
  96. 15 11
      src/main/java/me/km/items/ItemHat.java
  97. 15 15
      src/main/java/me/km/items/ItemKey.java
  98. 0 29
      src/main/java/me/km/items/ItemMetal.java
  99. 0 8
      src/main/java/me/km/items/ItemModelProvider.java
  100. 23 0
      src/main/java/me/km/items/ItemNoGlintLingeringPotion.java

+ 0 - 725
KajetansMod.iml

@@ -1,725 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module relativePaths="true" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <exclude-output/>
-    <orderEntry type="inheritedJdk"/>
-    <content url="file://$MODULE_DIR$/">
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false"/>
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false"/>
-      <excludeFolder url="file://$MODULE_DIR$/build"/>
-      <excludeFolder url="file://$MODULE_DIR$/.gradle"/>
-    </content>
-    <orderEntry type="sourceFolder" forTests="false"/>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/minecraft/deobfedDeps/compileDummy.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/minecraft/deobfedDeps/providedDummy.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.1/f7be08ec23c21485b9b5a1cf1654c2ec8c58168d/jsr305-3.0.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.1/3d7ec36bbfbf5d7259356a6b8fec0ce4f96e3f47/jsr305-3.0.1-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.1/a2926c057ca3b662b9db194c869bdbe7d3bb8aef/jsr305-3.0.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.mojang/netty/1.6/4b75825a06139752bd800d9e29c5fd55b8b1b1e4/netty-1.6.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.mojang/netty/1.6/cd01cc3788bac1b1eb9cf2cda02fc7698a5ca1cc/netty-1.6-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/oshi-project/oshi-core/1.1/9ddf7b048a8d701be231c0f4f95fd986198fd2d8/oshi-core-1.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/oshi-project/oshi-core/1.1/1ec1ab1e6ac5a1572edfd0dd9ac95e83684b8a65/oshi-core-1.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/3.4.0/803ff252fedbd395baffd43b37341dc4a150a554/jna-3.4.0.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/3.4.0/69707b8db1f5b46b23536f04e58468fbd159e7c0/jna-3.4.0-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/3.4.0/2f42653596d0044f0ab456620cba54c9cf53c5ca/jna-3.4.0-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/platform/3.4.0/e3f70017be8100d3d6923f50b3d2ee17714e9c13/platform-3.4.0.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/platform/3.4.0/805360594738e77e7da892f7f6ea563ab246c586/platform-3.4.0-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/platform/3.4.0/2f42653596d0044f0ab456620cba54c9cf53c5ca/platform-3.4.0-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.ibm.icu/icu4j-core-mojang/51.2/63d216a9311cca6be337c1e458e587f99d382b84/icu4j-core-mojang-51.2.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.ibm.icu/icu4j-core-mojang/51.2/814397ccbafff1132758e551c37396c528d7f2d7/icu4j-core-mojang-51.2-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.sf.jopt-simple/jopt-simple/4.6/306816fb57cf94f108a43c95731b08934dcae15c/jopt-simple-4.6.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.sf.jopt-simple/jopt-simple/4.6/a9984639bd484c54c81e978b694420677a7b79cd/jopt-simple-4.6-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.sf.jopt-simple/jopt-simple/4.6/9cd14a61d7aa7d554f251ef285a6f2c65caf7b65/jopt-simple-4.6-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/io.netty/netty-all/4.0.23.Final/294104aaf1781d6a56a07d561e792c5d0c95f45/netty-all-4.0.23.Final.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/io.netty/netty-all/4.0.23.Final/35e392a44218cd37a03fa52327345f81bc28019/netty-all-4.0.23.Final-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/io.netty/netty-all/4.0.23.Final/fd8e5b2341f3a08b02fe116d6e9886654e65b219/netty-all-4.0.23.Final-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/17.0/9c6ef172e8de35fd8d4d8783e4821e57cdef7445/guava-17.0.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/17.0/18a375325d213ba5ae90706790fbbb3fd51b9a01/guava-17.0-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/17.0/7ca0efbeb87ca845b5d7a0ac9c21a4b7b95f7b28/guava-17.0-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.3.2/90a3822c38ec8c996e84c16a3477ef632cbc87a3/commons-lang3-3.3.2.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.3.2/43ffe692648166363bceadc63ac76c7d19b4ebd7/commons-lang3-3.3.2-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.3.2/d2a489573c0ed2c4942b3660decad5d65087b406/commons-lang3-3.3.2-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.4/b1b6ea3b7e4aa4f492509a4952029cd8e48019ad/commons-io-2.4.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.4/3b5b0183c509963d5ffdf0d9d452a4a7521aeaa3/commons-io-2.4-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.4/f2d8698c46d1167ff24b06a840a87d91a02db891/commons-io-2.4-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.9/9ce04e34240f674bc72680f8b843b1457383161a/commons-codec-1.9.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.9/d103169e712eb2473072d53636b0c3bc380b8afb/commons-codec-1.9-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.9/3f15fff45d57656685abfee9e8302bf14580044c/commons-codec-1.9-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jutils/jutils/1.0.0/e12fe1fda814bd348c1579329c86943d2cd3c6a6/jutils-1.0.0.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jutils/jutils/1.0.0/1ad2673c8dded38030ed77ba393b0253051bb768/jutils-1.0.0-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jutils/jutils/1.0.0/d18678a00b216863206a1bb6190507e02a32971b/jutils-1.0.0-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.2.4/a60a5e993c98c864010053cb901b7eab25306568/gson-2.2.4.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.2.4/edf793f307583c05c23d2bff956e1a10ead8702c/gson-2.2.4-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.2.4/a6dc5db8a12928e583bd3f23e72d3ab611ecd58f/gson-2.2.4-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.mojang/authlib/1.5.24/889ff5477b844800cff734babbf42c1bbda4b10/authlib-1.5.24.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.mojang/authlib/1.5.24/ed92f0044f5b3fd8d4b831cf0e213fefbff6e33a/authlib-1.5.24-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.mojang/realms/1.10.16/b4948eb06ff238e45044f47aa69c2c977ce69dcb/realms-1.10.16.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.8.1/a698750c16740fd5b3871425f4cb3bbaa87f529d/commons-compress-1.8.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.8.1/8e9724537be2a09287d7483c6b4a0c9a0bddf944/commons-compress-1.8.1-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.8.1/3caea4421428752206c7a94c3e3097f0c47f1bb8/commons-compress-1.8.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.3.3/18f4247ff4572a074444572cee34647c43e7c9c7/httpclient-4.3.3.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.3.3/81ad2c81206a9aaba4c3337902fc60e1d80b686d/httpclient-4.3.3-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.3.3/65cba03c4f6207f2885f88206fcf52c53f8d111b/httpclient-4.3.3-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f/commons-logging-1.1.3.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/8a9805acc4e492afb6a400b6e32cfd98ed263caa/commons-logging-1.1.3-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/28bb0405fddaf04f15058fbfbe01fe2780d7d3b6/commons-logging-1.1.3-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/31fbbff1ddbf98f3aa7377c94d33b0447c646b6e/httpcore-4.3.2.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/37b4a5362830a9b29e68f1a1d179f3aa544fb623/httpcore-4.3.2-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/4809f38359edeea9487f747e09aa58ec8d3a54c5/httpcore-4.3.2-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/it.unimi.dsi/fastutil/7.0.12_mojang/ba787e741efdc425fc5d2ea654b57c15fba27efa/fastutil-7.0.12_mojang.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/it.unimi.dsi/fastutil/7.0.12_mojang/b7e3b6acfcd16e9f63d38f493bed4ef6cb3ca502/fastutil-7.0.12_mojang-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.0-beta9/1dd66e68cccd907880229f9e2de1314bd13ff785/log4j-api-2.0-beta9.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.0-beta9/204e63d075caf4035707a92bab186517e2b28bab/log4j-api-2.0-beta9-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.0-beta9/c6682b8a47ddd9f29108838aed0dc8e0ffdedf68/log4j-api-2.0-beta9-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.0-beta9/678861ba1b2e1fccb594bb0ca03114bb05da9695/log4j-core-2.0-beta9.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.0-beta9/df430ccb0bc8a29128ff8262bff145176d55edb1/log4j-core-2.0-beta9-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.0-beta9/c7da50fd52d6ee6991a0e16e2df1431f7656a7f4/log4j-core-2.0-beta9-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.minecraft/launchwrapper/1.12/111e7bea9c968cdb3d06ef4632bf7ff0824d0f36/launchwrapper-1.12.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.minecraft/launchwrapper/1.12/fd80cad9a1b967ce2ff20529dc54e520d5338d7/launchwrapper-1.12-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/jline/jline/2.13/2d9530d0a25daffaffda7c35037b046b627bb171/jline-2.13.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/jline/jline/2.13/77f395bce7cad8f3da6f6f3526d1923e8ea35942/jline-2.13-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/jline/jline/2.13/e290282bf7683ae3307e85bdc5d5e08424dfb893/jline-2.13-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-debug-all/5.0.3/f9e364ae2a66ce2a543012a4668856e84e5dab74/asm-debug-all-5.0.3.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-debug-all/5.0.3/c87547fa477f7dc22c5e3c5ddfc6dfac726e5b15/asm-debug-all-5.0.3-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-debug-all/5.0.3/f0f24f6666c1a15c7e202e91610476bd4ce59368/asm-debug-all-5.0.3-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.typesafe.akka/akka-actor_2.11/2.3.3/ed62e9fc709ca0f2ff1a3220daa8b70a2870078e/akka-actor_2.11-2.3.3.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.typesafe.akka/akka-actor_2.11/2.3.3/d81a273b777f369b260b031f99bac327aff69281/akka-actor_2.11-2.3.3-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.typesafe.akka/akka-actor_2.11/2.3.3/9dbceb71c4fd943b4eb4607847261075a989d47f/akka-actor_2.11-2.3.3-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.typesafe/config/1.2.1/f771f71fdae3df231bcd54d5ca2d57f0bf93f467/config-1.2.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.typesafe/config/1.2.1/855ac28cc00935e194ae6809828fc2397ecf8ace/config-1.2.1-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.typesafe/config/1.2.1/bdacf4f82ce9b29cd474bfde2e91eeb0ca623d28/config-1.2.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors-migration_2.11/1.1.0/dfa8bc42b181d5b9f1a5dd147f8ae308b893eb6f/scala-actors-migration_2.11-1.1.0.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors-migration_2.11/1.1.0/2d7a5d0f4b3fba0fa95311cabd66e3dc2efbb8c8/scala-actors-migration_2.11-1.1.0-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors-migration_2.11/1.1.0/6bccac72dae4d369537e313d12087c1ca295e84f/scala-actors-migration_2.11-1.1.0-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.11.1/56ea2e6c025e0821f28d73ca271218b8dd04926a/scala-compiler-2.11.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.11.1/51ae4b6c6d782c52a20cf1386fcbfa7491c1d26d/scala-compiler-2.11.1-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.11.1/b031d401aabbf7f5f725db500575da3dff90065f/scala-compiler-2.11.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-library_2.11/1.0.2/e517c53a7e9acd6b1668c5a35eccbaa3bab9aac/scala-continuations-library_2.11-1.0.2.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-library_2.11/1.0.2/5f0bb62bfd94ee7854f8f627e92c621f7f31e284/scala-continuations-library_2.11-1.0.2-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-library_2.11/1.0.2/495afc106eeaa1b3367f6be0bc3768c398e4d360/scala-continuations-library_2.11-1.0.2-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-plugin_2.11.1/1.0.2/f361a3283452c57fa30c1ee69448995de23c60f7/scala-continuations-plugin_2.11.1-1.0.2.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-plugin_2.11.1/1.0.2/16960d5491945a59d05cb5175e5cf558b38a1429/scala-continuations-plugin_2.11.1-1.0.2-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-plugin_2.11.1/1.0.2/c6f3c092ab731f3cf83fdb376ebc465a243c1f4c/scala-continuations-plugin_2.11.1-1.0.2-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.1/e11da23da3eabab9f4777b9220e60d44c1aab6a/scala-library-2.11.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.1/319900df0d487b36d5b41e1459e37bc270ba8328/scala-library-2.11.1-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.1/8355e4b6841f772a287167666bad6e9860ac4d3c/scala-library-2.11.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-parser-combinators_2.11/1.0.1/f05d7345bf5a58924f2837c6c1f4d73a938e1ff0/scala-parser-combinators_2.11-1.0.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-parser-combinators_2.11/1.0.1/1078474ef0f67e27e5c53bfbe404c2a99fadaf6f/scala-parser-combinators_2.11-1.0.1-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-parser-combinators_2.11/1.0.1/34d013c02d0b73794ba2911552896dd9c00f34c3/scala-parser-combinators_2.11-1.0.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.11.1/6580347e61cc7f8e802941e7fde40fa83b8badeb/scala-reflect-2.11.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.11.1/96f9e99e677be9d3f6f41e6fb2a66b329309ffa7/scala-reflect-2.11.1-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.11.1/d4c5628e197a0d6af8e9b93a9be32190c547bc8a/scala-reflect-2.11.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-swing_2.11/1.0.1/b1cdd92bd47b1e1837139c1c53020e86bb9112ae/scala-swing_2.11-1.0.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-swing_2.11/1.0.1/205c7295348ced192a726fcedd0b40cfa45da2ee/scala-swing_2.11-1.0.1-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-swing_2.11/1.0.1/d4bda4281db2ec74b105c5acf2326d160b79164e/scala-swing_2.11-1.0.1-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.11/1.0.2/820fbca7e524b530fdadc594c39d49a21ea0337e/scala-xml_2.11-1.0.2.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.11/1.0.2/a06d053a9d8ccf4518b0db56c66abea9f47fee7c/scala-xml_2.11-1.0.2-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.11/1.0.2/312c3557d1ca0b34820f3b3fc5404a47936ceb26/scala-xml_2.11-1.0.2-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/lzma/lzma/0.0.1/521616dc7487b42bef0e803bd2fa3faf668101d7/lzma-0.0.1.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.sf.trove4j/trove4j/3.0.3/42ccaf4761f0dfdfa805c9e340d99a755907e2dd/trove4j-3.0.3.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.sf.trove4j/trove4j/3.0.3/dc5c824f98a9bf2e20a2ccfff83e71be2040cc7d/trove4j-3.0.3-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.sf.trove4j/trove4j/3.0.3/109c5be93362e6e651e417c51d1863477a22969c/trove4j-3.0.3-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/codecjorbis/20101023/c73b5636faf089d9f00e8732a829577de25237ee/codecjorbis-20101023.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/codecjorbis/20101023/4ca2436396bc14ebd78b7db1d4e11ca607c8705e/codecjorbis-20101023-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/codecwav/20101023/12f031cfe88fef5c1dd36c563c0a3a69bd7261da/codecwav-20101023.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/codecwav/20101023/71ec00b9b9c1a6a2c3a8a25f481a23ddb5b21ddb/codecwav-20101023-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/libraryjavasound/20101123/5c5e304366f75f9eaa2e8cca546a1fb6109348b3/libraryjavasound-20101123.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/libraryjavasound/20101123/945ff5711de27751cf699641d1ea316ba6cf7589/libraryjavasound-20101123-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/librarylwjglopenal/20100824/73e80d0794c39665aec3f62eee88ca91676674ef/librarylwjglopenal-20100824.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/librarylwjglopenal/20100824/ecfc8dac1d41bef748997e4edf563d486923ee1e/librarylwjglopenal-20100824-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/soundsystem/20120107/419c05fe9be71f792b2d76cfc9b67f1ed0fec7f6/soundsystem-20120107.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/com.paulscode/soundsystem/20120107/1b9f4eb11ef11fede7fd76a2e5e8203c2a8adcd/soundsystem-20120107-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput/2.0.5/39c7796b469a600f72380316f6b1f11db6c2c7c4/jinput-2.0.5.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput/2.0.5/695a26a9a58e8495c1e3ce7b7f3bec23ecf2ef16/jinput-2.0.5-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput/2.0.5/82604cfeb87b9ab70ed70aa19a137de8ceb21504/jinput-2.0.5-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl/2.9.2-nightly-20140822/7707204c9ffa5d91662de95f0a224e2f721b22af/lwjgl-2.9.2-nightly-20140822.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl/2.9.2-nightly-20140822/cea8ca03571da563f474379aed1419932ea58ca6/lwjgl-2.9.2-nightly-20140822-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl/2.9.2-nightly-20140822/c24e5d6addbc83d192036d585cccbc402c702f56/lwjgl-2.9.2-nightly-20140822-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl_util/2.9.2-nightly-20140822/f0e612c840a7639c1f77f68d72a28dae2f0c8490/lwjgl_util-2.9.2-nightly-20140822.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl_util/2.9.2-nightly-20140822/280428c91a562e477dc576e284277d7bdedd6320/lwjgl_util-2.9.2-nightly-20140822-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl_util/2.9.2-nightly-20140822/75d55615cdb0948b7a19260f5a0f29fdd643260d/lwjgl_util-2.9.2-nightly-20140822-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/java3d/vecmath/1.5.2/79846ba34cbd89e2422d74d53752f993dcc2ccaf/vecmath-1.5.2.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/java3d/vecmath/1.5.2/42442b23189fbef9353c1751055610b63dd57e85/vecmath-1.5.2-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.fusesource.jansi/jansi/1.11/655c643309c2f45a56a747fda70e3fadf57e9f11/jansi-1.11.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.fusesource.jansi/jansi/1.11/b27814181cfd1b1c22ea6a287aeace376c53ffa7/jansi-1.11-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.fusesource.jansi/jansi/1.11/2f0e4b53b6b0eec426dad7118bf54b3deb58000b/jansi-1.11-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors/2.11.0/8ccfb6541de179bb1c4d45cf414acee069b7f78b/scala-actors-2.11.0.jar!/"/>
-        </CLASSES>
-        <JAVADOC>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors/2.11.0/c07dbf25e7e3b78fb9adbd9c790662b06caef931/scala-actors-2.11.0-javadoc.jar!/"/>
-        </JAVADOC>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors/2.11.0/e1dfa274766d5278166b0d660294fe96396693b2/scala-actors-2.11.0-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput-platform/2.0.5/7ff832a6eb9ab6a767f1ade2b548092d0fa64795/jinput-platform-2.0.5-natives-linux.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput-platform/2.0.5/385ee093e01f587f30ee1c8a2ee7d408fd732e16/jinput-platform-2.0.5-natives-windows.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput-platform/2.0.5/53f9c919f34d2ca9de8c51fc4e1e8282029a9232/jinput-platform-2.0.5-natives-osx.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl-platform/2.9.2-nightly-20140822/78b2a55ce4dc29c6b3ec4df8ca165eba05f9b341/lwjgl-platform-2.9.2-nightly-20140822-natives-windows.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl-platform/2.9.2-nightly-20140822/d898a33b5d0a6ef3fed3a4ead506566dce6720a5/lwjgl-platform-2.9.2-nightly-20140822-natives-linux.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl-platform/2.9.2-nightly-20140822/79f5ce2fea02e77fe47a3c745219167a542121d7/lwjgl-platform-2.9.2-nightly-20140822-natives-osx.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/minecraft/net/minecraftforge/forge/1.11.2-13.20.0.2228/snapshot/20161220/forgeSrc-1.11.2-13.20.0.2228.jar!/"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES>
-          <root url="jar:///Users/kajetanjohannes/.gradle/caches/minecraft/net/minecraftforge/forge/1.11.2-13.20.0.2228/snapshot/20161220/forgeSrc-1.11.2-13.20.0.2228-sources.jar!/"/>
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library" scope="RUNTIME">
-      <library>
-        <CLASSES>
-          <root url="file:///Users/kajetanjohannes/.gradle/caches/minecraft/net/minecraftforge/forge/1.11.2-13.20.0.2228/start"/>
-        </CLASSES>
-        <JAVADOC/>
-        <SOURCES/>
-      </library>
-    </orderEntry>
-  </component>
-  <component name="ModuleRootManager"/>
-</module>

+ 0 - 104
KajetansMod.ipr

@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="CompilerConfiguration">
-    <option name="DEFAULT_COMPILER" value="Javac"/>
-    <resourceExtensions>
-      <entry name=".+\.(properties|xml|html|dtd|tld)"/>
-      <entry name=".+\.(gif|png|jpeg|jpg)"/>
-    </resourceExtensions>
-    <wildcardResourcePatterns>
-      <entry name="!?*.class"/>
-      <entry name="!?*.scala"/>
-      <entry name="!?*.groovy"/>
-      <entry name="!?*.java"/>
-    </wildcardResourcePatterns>
-    <annotationProcessing enabled="false" useClasspath="true"/>
-    <bytecodeTargetLevel target="1.8"/>
-  </component>
-  <component name="CopyrightManager" default="">
-    <module2copyright/>
-  </component>
-  <component name="DependencyValidationManager">
-    <option name="SKIP_IMPORT_STATEMENTS" value="false"/>
-  </component>
-  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false"/>
-  <component name="GradleUISettings">
-    <setting name="root"/>
-  </component>
-  <component name="GradleUISettings2">
-    <setting name="root"/>
-  </component>
-  <component name="IdProvider" IDEtalkID="11DA1DB66DD62DDA1ED602B7079FE97C"/>
-  <component name="JavadocGenerationManager">
-    <option name="OUTPUT_DIRECTORY"/>
-    <option name="OPTION_SCOPE" value="protected"/>
-    <option name="OPTION_HIERARCHY" value="true"/>
-    <option name="OPTION_NAVIGATOR" value="true"/>
-    <option name="OPTION_INDEX" value="true"/>
-    <option name="OPTION_SEPARATE_INDEX" value="true"/>
-    <option name="OPTION_DOCUMENT_TAG_USE" value="false"/>
-    <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false"/>
-    <option name="OPTION_DOCUMENT_TAG_VERSION" value="false"/>
-    <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true"/>
-    <option name="OPTION_DEPRECATED_LIST" value="true"/>
-    <option name="OTHER_OPTIONS" value=""/>
-    <option name="HEAP_SIZE"/>
-    <option name="LOCALE"/>
-    <option name="OPEN_IN_BROWSER" value="true"/>
-  </component>
-  <component name="ProjectModuleManager">
-    <modules>
-      <module filepath="$PROJECT_DIR$/KajetansMod.iml" fileurl="file://$PROJECT_DIR$/KajetansMod.iml"/>
-    </modules>
-  </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-type="JavaSDK" assert-jdk-15="true" project-jdk-name="1.8">
-    <output url="file://$PROJECT_DIR$/out"/>
-  </component>
-  <component name="SvnBranchConfigurationManager">
-    <option name="mySupportsUserInfoFilter" value="true"/>
-  </component>
-  <component name="VcsDirectoryMappings">
-    <mapping directory="" vcs=""/>
-  </component>
-  <component name="masterDetails">
-    <states>
-      <state key="ArtifactsStructureConfigurable.UI">
-        <UIState>
-          <splitter-proportions>
-            <SplitterProportionsDataImpl/>
-          </splitter-proportions>
-          <settings/>
-        </UIState>
-      </state>
-      <state key="Copyright.UI">
-        <UIState>
-          <splitter-proportions>
-            <SplitterProportionsDataImpl/>
-          </splitter-proportions>
-        </UIState>
-      </state>
-      <state key="ProjectJDKs.UI">
-        <UIState>
-          <splitter-proportions>
-            <SplitterProportionsDataImpl>
-              <option name="proportions">
-                <list>
-                  <option value="0.2"/>
-                </list>
-              </option>
-            </SplitterProportionsDataImpl>
-          </splitter-proportions>
-          <last-edited>1.6</last-edited>
-        </UIState>
-      </state>
-      <state key="ScopeChooserConfigurable.UI">
-        <UIState>
-          <splitter-proportions>
-            <SplitterProportionsDataImpl/>
-          </splitter-proportions>
-          <settings/>
-        </UIState>
-      </state>
-    </states>
-  </component>
-</project>

+ 0 - 237
KajetansMod.iws

@@ -1,237 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ChangeListManager">
-    <option name="TRACKING_ENABLED" value="true"/>
-    <option name="SHOW_DIALOG" value="false"/>
-    <option name="HIGHLIGHT_CONFLICTS" value="true"/>
-    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false"/>
-    <option name="LAST_RESOLUTION" value="IGNORE"/>
-  </component>
-  <component flattened_view="true" name="ChangesViewManager" show_ignored="false"/>
-  <component name="CreatePatchCommitExecutor">
-    <option name="PATCH_PATH" value=""/>
-    <option name="REVERSE_PATCH" value="false"/>
-  </component>
-  <component name="DaemonCodeAnalyzer">
-    <disable_hints/>
-  </component>
-  <component name="DebuggerManager">
-    <breakpoint_any>
-      <breakpoint>
-        <option name="NOTIFY_CAUGHT" value="true"/>
-        <option name="NOTIFY_UNCAUGHT" value="true"/>
-        <option name="ENABLED" value="false"/>
-        <option name="LOG_ENABLED" value="false"/>
-        <option name="LOG_EXPRESSION_ENABLED" value="false"/>
-        <option name="SUSPEND_POLICY" value="SuspendAll"/>
-        <option name="COUNT_FILTER_ENABLED" value="false"/>
-        <option name="COUNT_FILTER" value="0"/>
-        <option name="CONDITION_ENABLED" value="false"/>
-        <option name="CLASS_FILTERS_ENABLED" value="false"/>
-        <option name="INSTANCE_FILTERS_ENABLED" value="false"/>
-        <option name="CONDITION" value=""/>
-        <option name="LOG_MESSAGE" value=""/>
-      </breakpoint>
-      <breakpoint>
-        <option name="NOTIFY_CAUGHT" value="true"/>
-        <option name="NOTIFY_UNCAUGHT" value="true"/>
-        <option name="ENABLED" value="false"/>
-        <option name="LOG_ENABLED" value="false"/>
-        <option name="LOG_EXPRESSION_ENABLED" value="false"/>
-        <option name="SUSPEND_POLICY" value="SuspendAll"/>
-        <option name="COUNT_FILTER_ENABLED" value="false"/>
-        <option name="COUNT_FILTER" value="0"/>
-        <option name="CONDITION_ENABLED" value="false"/>
-        <option name="CLASS_FILTERS_ENABLED" value="false"/>
-        <option name="INSTANCE_FILTERS_ENABLED" value="false"/>
-        <option name="CONDITION" value=""/>
-        <option name="LOG_MESSAGE" value=""/>
-      </breakpoint>
-    </breakpoint_any>
-    <breakpoint_rules/>
-    <ui_properties/>
-  </component>
-  <component name="ModuleEditorState">
-    <option name="LAST_EDITED_MODULE_NAME"/>
-    <option name="LAST_EDITED_TAB_NAME"/>
-  </component>
-  <component name="ProjectInspectionProfilesVisibleTreeState">
-    <entry key="Project Default">
-      <profile-state/>
-    </entry>
-  </component>
-  <component name="ProjectLevelVcsManager">
-    <OptionsSetting id="Add" value="true"/>
-    <OptionsSetting id="Remove" value="true"/>
-    <OptionsSetting id="Checkout" value="true"/>
-    <OptionsSetting id="Update" value="true"/>
-    <OptionsSetting id="Status" value="true"/>
-    <OptionsSetting id="Edit" value="true"/>
-    <ConfirmationsSetting id="Add" value="0"/>
-    <ConfirmationsSetting id="Remove" value="0"/>
-  </component>
-  <component name="ProjectReloadState">
-    <option name="STATE" value="0"/>
-  </component>
-  <component name="PropertiesComponent">
-    <property name="GoToFile.includeJavaFiles" value="false"/>
-    <property name="GoToClass.toSaveIncludeLibraries" value="false"/>
-    <property name="MemberChooser.sorted" value="false"/>
-    <property name="MemberChooser.showClasses" value="true"/>
-    <property name="GoToClass.includeLibraries" value="false"/>
-    <property name="MemberChooser.copyJavadoc" value="false"/>
-  </component>
-  <component name="RunManager">
-    <configuration default="true" factoryName="Remote" type="Remote">
-      <option name="USE_SOCKET_TRANSPORT" value="true"/>
-      <option name="SERVER_MODE" value="false"/>
-      <option name="SHMEM_ADDRESS" value="javadebug"/>
-      <option name="HOST" value="localhost"/>
-      <option name="PORT" value="5005"/>
-      <method>
-        <option enabled="false" name="BuildArtifacts"/>
-      </method>
-    </configuration>
-    <configuration default="true" factoryName="Applet" type="Applet">
-      <module name=""/>
-      <option name="MAIN_CLASS_NAME"/>
-      <option name="HTML_FILE_NAME"/>
-      <option name="HTML_USED" value="false"/>
-      <option name="WIDTH" value="400"/>
-      <option name="HEIGHT" value="300"/>
-      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy"/>
-      <option name="VM_PARAMETERS"/>
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
-      <option name="ALTERNATIVE_JRE_PATH"/>
-      <method>
-        <option enabled="false" name="BuildArtifacts"/>
-        <option enabled="true" name="Make"/>
-      </method>
-    </configuration>
-    <configuration default="true" factoryName="Application" type="Application">
-      <extension enabled="false" merge="false" name="coverage"/>
-      <option name="MAIN_CLASS_NAME"/>
-      <option name="VM_PARAMETERS"/>
-      <option name="PROGRAM_PARAMETERS"/>
-      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$"/>
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
-      <option name="ALTERNATIVE_JRE_PATH"/>
-      <option name="ENABLE_SWING_INSPECTOR" value="false"/>
-      <option name="ENV_VARIABLES"/>
-      <option name="PASS_PARENT_ENVS" value="true"/>
-      <module name=""/>
-      <envs/>
-      <method>
-        <option enabled="false" name="BuildArtifacts"/>
-        <option enabled="true" name="Make"/>
-      </method>
-    </configuration>
-    <configuration default="true" factoryName="JUnit" type="JUnit">
-      <extension enabled="false" merge="false" name="coverage"/>
-      <module name=""/>
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
-      <option name="ALTERNATIVE_JRE_PATH"/>
-      <option name="PACKAGE_NAME"/>
-      <option name="MAIN_CLASS_NAME"/>
-      <option name="METHOD_NAME"/>
-      <option name="TEST_OBJECT" value="class"/>
-      <option name="VM_PARAMETERS"/>
-      <option name="PARAMETERS"/>
-      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$"/>
-      <option name="ENV_VARIABLES"/>
-      <option name="PASS_PARENT_ENVS" value="true"/>
-      <option name="TEST_SEARCH_SCOPE">
-        <value defaultName="moduleWithDependencies"/>
-      </option>
-      <envs/>
-      <method>
-        <option enabled="false" name="BuildArtifacts"/>
-        <option enabled="true" name="Make"/>
-      </method>
-    </configuration>
-    <list size="0"/>
-    <configuration default="true" name="&lt;template&gt;" selected="false" type="WebApp">
-      <Host>localhost</Host>
-      <Port>5050</Port>
-    </configuration>
-  <configuration default="false" factoryName="Application" name="Minecraft Client" type="Application">
-      <extension enabled="false" name="coverage" runner="idea" sample_coverage="true"/>
-      <option name="MAIN_CLASS_NAME" value="GradleStart"/>
-      <option name="VM_PARAMETERS" value=""/>
-      <option name="PROGRAM_PARAMETERS" value=""/>
-      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/run"/>
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
-      <option name="ALTERNATIVE_JRE_PATH" value=""/>
-      <option name="ENABLE_SWING_INSPECTOR" value="false"/>
-      <option name="ENV_VARIABLES"/>
-      <option name="PASS_PARENT_ENVS" value="true"/>
-      <module name="KajetansMod"/>
-      <RunnerSettings RunnerId="Run"/>
-      <ConfigurationWrapper RunnerId="Run"/>
-    </configuration>
-    <configuration default="false" factoryName="Application" name="Minecraft Server" type="Application">
-      <extension enabled="false" name="coverage" runner="idea" sample_coverage="true"/>
-      <option name="MAIN_CLASS_NAME" value="GradleStartServer"/>
-      <option name="VM_PARAMETERS" value=""/>
-      <option name="PROGRAM_PARAMETERS" value=""/>
-      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/run"/>
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
-      <option name="ALTERNATIVE_JRE_PATH" value=""/>
-      <option name="ENABLE_SWING_INSPECTOR" value="false"/>
-      <option name="ENV_VARIABLES"/>
-      <option name="PASS_PARENT_ENVS" value="true"/>
-      <module name="KajetansMod"/>
-      <RunnerSettings RunnerId="Run"/>
-      <ConfigurationWrapper RunnerId="Run"/>
-    </configuration>
-  </component>
-  <component name="ShelveChangesManager" show_recycled="false"/>
-  <component maxAnnotateRevisions="500" name="SvnConfiguration">
-    <option name="USER" value=""/>
-    <option name="PASSWORD" value=""/>
-    <option name="LAST_MERGED_REVISION"/>
-    <option name="UPDATE_RUN_STATUS" value="false"/>
-    <option name="MERGE_DRY_RUN" value="false"/>
-    <option name="MERGE_DIFF_USE_ANCESTRY" value="true"/>
-    <option name="UPDATE_LOCK_ON_DEMAND" value="false"/>
-    <option name="IGNORE_SPACES_IN_MERGE" value="false"/>
-    <option name="DETECT_NESTED_COPIES" value="true"/>
-    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true"/>
-    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true"/>
-    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
-  </component>
-  <component name="TaskManager">
-    <task active="true" id="Default" summary="Default task"/>
-    <servers/>
-  </component>
-  <component name="VcsManagerConfiguration">
-    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true"/>
-    <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true"/>
-    <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true"/>
-    <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true"/>
-    <option name="PERFORM_EDIT_IN_BACKGROUND" value="true"/>
-    <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true"/>
-    <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true"/>
-    <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false"/>
-    <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false"/>
-    <option name="ENABLE_BACKGROUND_PROCESSES" value="false"/>
-    <option name="CHANGED_ON_SERVER_INTERVAL" value="60"/>
-    <option name="FORCE_NON_EMPTY_COMMENT" value="false"/>
-    <option name="LAST_COMMIT_MESSAGE"/>
-    <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true"/>
-    <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false"/>
-    <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false"/>
-    <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false"/>
-    <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false"/>
-    <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8"/>
-    <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5"/>
-    <option name="ACTIVE_VCS_NAME"/>
-    <option name="UPDATE_GROUP_BY_PACKAGES" value="false"/>
-    <option name="UPDATE_GROUP_BY_CHANGELIST" value="false"/>
-    <option name="SHOW_FILE_HISTORY_AS_TREE" value="false"/>
-    <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6"/>
-  </component>
-  <component name="XDebuggerManager">
-    <breakpoint-manager/>
-  </component>
-</project>

+ 31 - 69
build.gradle

@@ -1,84 +1,46 @@
 buildscript {
     repositories {
+        maven { url = 'https://files.minecraftforge.net/maven' }
         jcenter()
-        maven { url = "http://files.minecraftforge.net/maven" }
+        mavenCentral()
     }
     dependencies {
-        classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
-        classpath 'mysql:mysql-connector-java:5.1.42'
+        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
     }
 }
-apply plugin: 'net.minecraftforge.gradle.forge'
-//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
+apply plugin: 'net.minecraftforge.gradle'
+// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
+apply plugin: 'eclipse'
+apply plugin: 'maven-publish'
 
-version = "1.0"
-group = "me.hammerle.km" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
-archivesBaseName = "km"
+version = '1.0'
+group = 'me.hammerle.km'
+archivesBaseName = 'km'
 
-sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
-compileJava {
-    sourceCompatibility = targetCompatibility = '1.8'
-}
+sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
 
 minecraft {
-    version = "1.12.2-14.23.0.2537"
-    runDir = "run"
-    
-    // the mappings can be changed at any time, and must be in the following format.
-    // snapshot_YYYYMMDD   snapshot are built nightly.
-    // stable_#            stables are built at the discretion of the MCP team.
-    // Use non-default mappings at your own risk. they may not always work.
-    // simply re-run your setup task after changing the mappings to update your workspace.
-    mappings = "snapshot_20171003"
-    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
+    mappings channel: 'snapshot', version: '20190621-1.14.2'
+
+    runs {
+        client {
+            workingDirectory project.file('run')
+            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
+            property 'forge.logging.console.level', 'info'
+            args '--username', 'kajetanjohannes'
+        }
+
+        server {
+            workingDirectory project.file('run')
+            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
+            property 'forge.logging.console.level', 'info'
+        }
+    }
 }
 
 dependencies {
-    // you may put jars on which you depend on in ./libs
-    // or you may define them like so..
-    //compile "some.group:artifact:version:classifier"
-    //compile "some.group:artifact:version"
-      
-    // real examples
-    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
-    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
-
-    // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
-    //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
-
-    // the deobf configurations:  'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
-    // except that these dependencies get remapped to your current MCP mappings
-    //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
-    //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
-
-    // for more info...
-    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
-    // http://www.gradle.org/docs/current/userguide/dependency_management.html
+    minecraft 'net.minecraftforge:forge:1.14.2-26.0.55'
     compile 'mysql:mysql-connector-java:5.1.42'
-    compile files('./../../SnuviScriptRecoded/dist/SnuviScriptRecoded.jar')
-    compile files('./../KajetansCoreMod/build/libs/kcm-1.0.jar')
-}
-
-processResources {
-    // this will ensure that this task is redone when the versions change.
-    inputs.property "version", project.version
-    inputs.property "mcversion", project.minecraft.version
-
-    // replace stuff in mcmod.info, nothing else
-    from(sourceSets.main.resources.srcDirs) {
-        include 'mcmod.info'
-                
-        // replace version and mcversion
-        expand 'version':project.version, 'mcversion':project.minecraft.version
-    }
-        
-    // copy everything else except the mcmod.info
-    from(sourceSets.main.resources.srcDirs) {
-        exclude 'mcmod.info'
-    }
-}
-
-runClient
-{
-    args '--username', 'kajetanjohannes'
-}
+    compile files('./libs/SnuviScriptRecoded.jar')
+    compile files('./libs/kcm-1.0.jar')
+}

+ 3 - 0
cleanEclipse.sh

@@ -0,0 +1,3 @@
+rm .classpath
+rm -r .settings
+rm .project

+ 2 - 1
gradle.properties

@@ -1,3 +1,4 @@
 # Sets default memory used for gradle commands. Can be overridden by user or command line properties.
 # This is required to provide enough memory for the Minecraft decompilation process.
-org.gradle.jvmargs = -Xmx3G
+org.gradle.jvmargs=-Xmx3G
+org.gradle.daemon=false

+ 43 - 35
gradlew

@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
 
 ##############################################################################
 ##
@@ -6,20 +6,38 @@
 ##
 ##############################################################################
 
-# 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"
 
-warn ( ) {
+warn () {
     echo "$*"
 }
 
-die ( ) {
+die () {
     echo
     echo "$*"
     echo
@@ -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`
@@ -154,11 +154,19 @@ if $cygwin ; then
     esac
 fi
 
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
-    JVM_OPTS=("$@")
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
 }
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
 
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"

+ 20 - 0
runClient.launch

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+  <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="KajetansMod"/>
+  <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.minecraftforge.userdev.LaunchTesting"/>
+  <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dforge.logging.console.level=warn -Dforge.logging.markers=SCAN,REGISTRIES,REGISTRYDUMP"/>
+  <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value=""/>
+  <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="/home/kajetan/Dropbox/Projekte/Informatik/Java/Minecraft/KajetansMod/run"/>
+  <mapAttribute key="org.eclipse.debug.core.environmentVariables">
+    <mapEntry key="MOD_CLASSES" value="/home/kajetan/Dropbox/Projekte/Informatik/Java/Minecraft/KajetansMod/bin/main:/home/kajetan/Dropbox/Projekte/Informatik/Java/Minecraft/KajetansMod/bin/main"/>
+    <mapEntry key="MCP_MAPPINGS" value="snapshot_20180921-1.13"/>
+    <mapEntry key="MCP_VERSION" value="20190213.203750"/>
+    <mapEntry key="FORGE_VERSION" value="25.0.219"/>
+    <mapEntry key="assetIndex" value="1.13.1"/>
+    <mapEntry key="assetDirectory" value="/home/kajetan/.gradle/caches/forge_gradle/assets"/>
+    <mapEntry key="nativesDirectory" value="/home/kajetan/Dropbox/Projekte/Informatik/Java/Minecraft/KajetansMod/build/natives"/>
+    <mapEntry key="FORGE_GROUP" value="net.minecraftforge"/>
+    <mapEntry key="target" value="fmluserdevclient"/>
+    <mapEntry key="MC_VERSION" value="1.13.2"/>
+  </mapAttribute>
+</launchConfiguration>

+ 17 - 0
runServer.launch

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+  <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="KajetansMod"/>
+  <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.minecraftforge.userdev.LaunchTesting"/>
+  <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dforge.logging.console.level=warn -Dforge.logging.markers=SCAN,REGISTRIES,REGISTRYDUMP"/>
+  <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value=""/>
+  <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="/home/kajetan/Dropbox/Projekte/Informatik/Java/Minecraft/KajetansMod/run"/>
+  <mapAttribute key="org.eclipse.debug.core.environmentVariables">
+    <mapEntry key="MOD_CLASSES" value="/home/kajetan/Dropbox/Projekte/Informatik/Java/Minecraft/KajetansMod/bin/main:/home/kajetan/Dropbox/Projekte/Informatik/Java/Minecraft/KajetansMod/bin/main"/>
+    <mapEntry key="MCP_MAPPINGS" value="snapshot_20180921-1.13"/>
+    <mapEntry key="MCP_VERSION" value="20190213.203750"/>
+    <mapEntry key="FORGE_VERSION" value="25.0.219"/>
+    <mapEntry key="FORGE_GROUP" value="net.minecraftforge"/>
+    <mapEntry key="target" value="fmluserdevserver"/>
+    <mapEntry key="MC_VERSION" value="1.13.2"/>
+  </mapAttribute>
+</launchConfiguration>

+ 27 - 23
src/main/java/me/km/ClientEvents.java

@@ -6,21 +6,24 @@ import me.km.networking.PlayerDisplayGui;
 import me.km.networking.PlayerHeadGui;
 import me.km.networking.StatusDisplayGui;
 import net.minecraft.item.Item;
-import net.minecraft.item.ItemArmor;
+import net.minecraft.item.ArmorItem;
 import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.CompoundNBT;
+import net.minecraft.util.text.ITextComponent;
+import net.minecraft.util.text.StringTextComponent;
 import net.minecraft.util.text.TextFormatting;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 import net.minecraftforge.client.event.RenderGameOverlayEvent;
 import net.minecraftforge.event.entity.player.ItemTooltipEvent;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
 import net.minecraftforge.fml.common.gameevent.TickEvent;
-import net.minecraftforge.fml.common.network.FMLNetworkEvent;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
 
-@SideOnly(Side.CLIENT)
+@OnlyIn(Dist.CLIENT)
 public class ClientEvents 
 {   
+    boolean once = true;
+    
     @SubscribeEvent
     public void onClientTick(TickEvent.ClientTickEvent e)
     {
@@ -51,36 +54,37 @@ public class ClientEvents
         }
     }
     
-    @SubscribeEvent
-    public void onRenderGui(FMLNetworkEvent.ClientDisconnectionFromServerEvent e)
-    {
-        PlayerDisplayGui.INSTANCE.clear();
-        StatusDisplayGui.INSTANCE.clear();
-        PlayerHeadGui.INSTANCE.clear();
-        ItemStackDisplayGui.INSTANCE.clear();
-        ItemStackDisplayGui.INSTANCE.setActive(false);
-    }
+    // ToDo: Event is missing?
+    //@SubscribeEvent
+    //public void onRenderGui(FMLNetworkEvent.ClientDisconnectionFromServerEvent e)
+    //{
+    //    PlayerDisplayGui.INSTANCE.clear();
+    //    StatusDisplayGui.INSTANCE.clear();
+    //    PlayerHeadGui.INSTANCE.clear();
+    //    ItemStackDisplayGui.INSTANCE.clear();
+    //    ItemStackDisplayGui.INSTANCE.setActive(false);
+    //}
     
     @SubscribeEvent
     public void showingTooltip(ItemTooltipEvent e) 
     {
         ItemStack stack = e.getItemStack();
         Item item = stack.getItem();
-        if(item instanceof ItemArmor)
+        if(item instanceof ArmorItem)
         {
-            NBTTagCompound com = stack.getTagCompound();
-            if(com != null && com.hasKey("magic"))
+            CompoundNBT com = stack.getTag();
+            if(com != null && com.hasUniqueId("magic"))
             {
-                int magic = com.getInteger("magic");
+                int magic = com.getInt("magic");
                 if(magic != 0)
                 {
-                    List<String> list = e.getToolTip();
+                    List<ITextComponent> list = e.getToolTip();
                     String s = TextFormatting.BLUE + " +";
                     for(int i = 0; i < list.size(); i++)
                     {
-                        if(list.get(i).startsWith(s))
+                        if(list.get(i).getString().startsWith(s))
                         {
-                            list.add(i, TextFormatting.BLUE + " +" + magic + " Magic Armor");
+                            list.add(i, new StringTextComponent(String.format("%s +%d Magic Armor", TextFormatting.BLUE, magic)));
                             break;
                         }
                     }

+ 32 - 71
src/main/java/me/km/ClientProxy.java

@@ -10,80 +10,42 @@ import me.km.items.ModItems;
 import me.km.items.ModelCylinder;
 import me.km.items.ModelHat;
 import me.km.networking.KeyManager;
-import net.minecraft.block.Block;
-import net.minecraft.block.state.IBlockState;
+import net.minecraft.block.BlockState;
 import net.minecraft.client.Minecraft;
-import net.minecraft.client.model.ModelBiped;
-import net.minecraft.client.renderer.block.model.ModelBakery;
-import net.minecraft.client.renderer.block.model.ModelResourceLocation;
-import net.minecraft.client.renderer.block.statemap.StateMapperBase;
 import net.minecraft.client.renderer.color.BlockColors;
 import net.minecraft.client.renderer.color.IBlockColor;
 import net.minecraft.client.renderer.color.ItemColors;
-import net.minecraft.client.renderer.entity.Render;
-import net.minecraft.entity.Entity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemBlock;
+import net.minecraft.client.renderer.entity.model.BipedModel;
+import net.minecraft.item.BlockItem;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.ColorizerGrass;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.biome.BiomeColorHelper;
-import net.minecraftforge.client.model.ModelLoader;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.fluids.IFluidBlock;
-import net.minecraftforge.fml.client.registry.RenderingRegistry;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraft.world.GrassColors;
+import net.minecraft.world.IEnviromentBlockReader;
+import net.minecraft.world.biome.BiomeColors;
 
 public class ClientProxy extends CommonProxy 
-{
+{    
     @Override
-    public void registerItemRenderer(Item item, int meta, String id, String variant) 
+    public void init() 
     {
-        ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(KajetansMod.MODID + ":" + id, variant));
+        ModEntities.initClient();
+        MinecraftForge.EVENT_BUS.register(new ClientEvents());
+        MinecraftForge.EVENT_BUS.register(new KeyManager());
     }
     
     @Override
-    public void registerItemRenderer(Item item, int meta, String id) 
-    {
-        registerItemRenderer(item, meta, id, null);
-    }
-
-    @Override
-    public void registerFluidModel(IFluidBlock fluidBlock) 
+    public void postInit() 
     {
-        final Item item = Item.getItemFromBlock((Block) fluidBlock);
-        assert item != null;
-        ModelBakery.registerItemVariants(item);
-        ModelResourceLocation modelResourceLocation = new ModelResourceLocation(KajetansMod.MODID + ":fluids", fluidBlock.getFluid().getName());
-        ModelLoader.setCustomMeshDefinition(item, MeshDefinitionFix.create(stack -> modelResourceLocation));
-        ModelLoader.setCustomStateMapper((Block) fluidBlock, new StateMapperBase() 
+        BlockColors bColors = Minecraft.getInstance().getBlockColors();
+        bColors.register((BlockState state, IEnviromentBlockReader w, BlockPos pos, int tintIndex) -> 
         {
-            @Override
-            protected ModelResourceLocation getModelResourceLocation(IBlockState state) 
+            if(w == null || pos == null)
             {
-                return modelResourceLocation;
+                return -16777216;
             }
-        });
-    }
-    
-    @Override
-    public void registerEntityRenderer(Class<? extends Entity> c, Render<? extends Entity> r)
-    {
-        RenderingRegistry.registerEntityRenderingHandler(c, r);
-    }
-    
-    @Override
-    public void init() 
-    {
-        ModEntities.initClient();
-        MinecraftForge.EVENT_BUS.register(new ClientEvents());
-        MinecraftForge.EVENT_BUS.register(new KeyManager());
-        
-        BlockColors bColors = Minecraft.getMinecraft().getBlockColors();
-        bColors.registerBlockColorHandler((IBlockState state, IBlockAccess w, BlockPos pos, int tintIndex) -> 
-        {
             TileEntityCookingPot tile = (TileEntityCookingPot) w.getTileEntity(pos);
             if(tile == null) 
             {
@@ -93,45 +55,44 @@ public class ClientProxy extends CommonProxy
             return -16777216 | c.getRed() << 16 | c.getGreen() << 8 | c.getBlue();
         }, ModBlocks.cookingPotCopper);
 
-        IBlockColor tallGrass = (IBlockState state, IBlockAccess w, BlockPos pos, int tintIndex) ->
+        IBlockColor tallGrass = (BlockState state, IEnviromentBlockReader w, BlockPos pos, int tintIndex) ->
         {
             if(w != null && pos != null)
             {
-                return BiomeColorHelper.getGrassColorAtPos(w, pos);
+                return BiomeColors.getGrassColor(w, pos);
             }
             else
             {
-                return ColorizerGrass.getGrassColor(0.5D, 1.0D);
+                return GrassColors.get(0.5D, 1.0D);
             }
         };
-        
-        bColors.registerBlockColorHandler(tallGrass, ModBlocks.tallGrass);
+        bColors.register(tallGrass, ModBlocks.tallGrass);
 
-        ItemColors iColors = Minecraft.getMinecraft().getItemColors();
-        iColors.registerItemColorHandler((ItemStack stack, int tintIndex) -> tintIndex > 0 ? -1 : ((ItemColoredSoup) stack.getItem()).getColor(stack), ModItems.coloredSoup);
-        iColors.registerItemColorHandler((ItemStack stack, int tintIndex) -> tintIndex > 0 ? -1 : ((ItemGemStone) stack.getItem()).getColor(stack), 
+        ItemColors iColors = Minecraft.getInstance().getItemColors();
+        iColors.register((ItemStack stack, int tintIndex) -> tintIndex > 0 ? -1 : ItemColoredSoup.getColor(stack), ModItems.coloredSoup);
+        iColors.register((ItemStack stack, int tintIndex) -> tintIndex > 0 ? -1 : ((ItemGemStone) stack.getItem()).getColor(stack), 
                 ModItems.gemStone, ModItems.rawGemStone, ModItems.flawlessGemStone);
         
-        iColors.registerItemColorHandler((ItemStack stack, int tintIndex) -> 
+        iColors.register((ItemStack stack, int tintIndex) -> 
         {
-            IBlockState state = ((ItemBlock) stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata());
-            return tallGrass.colorMultiplier(state, null, null, tintIndex);
+            BlockState state = ((BlockItem) stack.getItem()).getBlock().getDefaultState();
+            return tallGrass.getColor(state, null, null, tintIndex);
         }, ModBlocks.tallGrass);
     }
 
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     private final static ModelHat STRAW_HAT = new ModelHat(1.0f);
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     private final static ModelCylinder CYLINDER = new ModelCylinder(1.0f);
     
     @Override
-    public ModelBiped getCylinderModel() 
+    public BipedModel getCylinderModel() 
     {
         return CYLINDER;
     }
 
     @Override
-    public ModelBiped getStrawHatModel() 
+    public BipedModel getStrawHatModel() 
     {
         return STRAW_HAT;
     }

+ 6 - 28
src/main/java/me/km/CommonProxy.java

@@ -1,46 +1,24 @@
 package me.km;
 
-import me.km.blocks.BlockEvents;
-import me.km.entities.ModEntities;
-import me.km.events.CustomEventCaller;
-import net.minecraft.client.model.ModelBiped;
-import net.minecraft.client.renderer.entity.Render;
-import net.minecraft.entity.Entity;
-import net.minecraft.item.Item;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.fluids.IFluidBlock;
+import net.minecraft.client.renderer.entity.model.BipedModel;
 
 public class CommonProxy 
 {
-    public void registerItemRenderer(Item item, int meta, String id, String variant) 
-    {
-    }
-    
-    public void registerItemRenderer(Item item, int meta, String id) 
-    {
-    }
-
-    public void registerFluidModel(IFluidBlock fluidBlock) 
-    {
-    }
-    
-    public void registerEntityRenderer(Class<? extends Entity> c, Render<? extends Entity> r)
+    public void init() 
     {
+        //MinecraftForge.EVENT_BUS.register(new CustomEventCaller());
     }
     
-    public void init() 
+    public void postInit() 
     {
-        ModEntities.initServer();
-        MinecraftForge.EVENT_BUS.register(new BlockEvents());
-        MinecraftForge.EVENT_BUS.register(new CustomEventCaller());
     }
 
-    public ModelBiped getCylinderModel()
+    public BipedModel getCylinderModel()
     {
         return null;
     }
     
-    public ModelBiped getStrawHatModel()
+    public BipedModel getStrawHatModel()
     {
         return null;
     }

+ 6 - 6
src/main/java/me/km/DamageUtils.java

@@ -1,8 +1,8 @@
 package me.km;
 
-import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.LivingEntity;
 import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.CompoundNBT;
 import net.minecraft.util.DamageSource;
 
 public class DamageUtils 
@@ -24,15 +24,15 @@ public class DamageUtils
         DamageSource.GENERIC.setDamageIsAbsolute();
     }
     
-    public static int getMagicDefense(EntityLivingBase liv)
+    public static int getMagicDefense(LivingEntity liv)
     {
         int level = 0;
         for(ItemStack stack : liv.getArmorInventoryList())
         {
-            NBTTagCompound com = stack.getTagCompound();
-            if(com != null && com.hasKey("magic"))
+            CompoundNBT com = stack.getTag();
+            if(com != null && com.hasUniqueId("magic"))
             {
-                level += com.getInteger("magic");
+                level += com.getInt("magic");
             }
         }
         return level;

+ 96 - 72
src/main/java/me/km/KajetansMod.java

@@ -1,57 +1,72 @@
 package me.km;
 
-import me.kcm.command.ModServerCommandManager;
+import me.kcm.events.Hooks;
+import me.km.permissions.PermissionManager;
 import me.km.blockprotections.BlockProtection;
 import me.km.module.Module;
 import me.km.module.SimpleConfig;
 import me.km.databank.DataBank;
-import me.km.world.ModWorldGeneration;
+import me.km.entities.ModEntities;
 import me.km.networking.ModPacketHandler;
+import me.km.overrides.ModPlayerList;
+import me.km.permissions.ModCommandManager;
 import me.km.playerbank.PlayerManager;
+import me.km.plots.DummyProtectionBank;
+import me.km.plots.ProtectionEvents;
 import me.km.plots.ProtectionBank;
 import me.km.scheduler.SnuviScheduler;
 import me.km.snuviscript.ScriptModule;
-import me.km.world.ChangeWorldEvent;
+import me.km.utils.ReflectionUtils;
 import net.minecraft.server.MinecraftServer;
 import net.minecraft.util.text.TextFormatting;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
 import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fml.DistExecutor;
+import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
+import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
+import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
+import net.minecraftforge.fml.event.lifecycle.FMLDedicatedServerSetupEvent;
+import net.minecraftforge.fml.event.server.FMLServerAboutToStartEvent;
+import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
+import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
+import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
+import org.apache.logging.log4j.LogManager;
 import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.common.SidedProxy;
-import net.minecraftforge.fml.common.event.FMLInitializationEvent;
-import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
-import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
-import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent;
-import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
-import net.minecraftforge.fml.common.registry.GameRegistry;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import me.km.plots.IProtectionBank;
+import net.minecraftforge.fml.DeferredWorkQueue;
 
-@Mod(modid = KajetansMod.MODID, version = KajetansMod.VERSION, name = KajetansMod.NAME)
+@Mod.EventBusSubscriber
+@Mod("km")
 public class KajetansMod
 {    
-    @SideOnly(Side.SERVER)
+    @OnlyIn(Dist.DEDICATED_SERVER)
     public static SimpleConfig conf;
     
     public static Module error;
     public static DataBank databank;
-    @SideOnly(Side.SERVER)
+    
+    @OnlyIn(Dist.DEDICATED_SERVER)
     public static SnuviScheduler scheduler;
     public static PlayerManager playerbank;
-    public static ProtectionBank plots;
+    public static IProtectionBank plots;
     public static BlockProtection blocks;
     public static ScriptModule scripts;
     
-    @SideOnly(Side.SERVER)
+    @OnlyIn(Dist.DEDICATED_SERVER)
     public static PermissionManager perms;
     
-    @SidedProxy(serverSide = "me.km.CommonProxy", clientSide = "me.km.ClientProxy")
-    public static CommonProxy proxy;
+    @OnlyIn(Dist.DEDICATED_SERVER)
+    public static ModCommandManager commands;
+    
+    public static CommonProxy proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> CommonProxy::new);
 
     public static final String MODID = "km";
     public static final String NAME = "Kajetans Mod";
     public static final String VERSION = "0.0.35";
 
-    @Mod.Instance(MODID)
     public static KajetansMod instance;
     
     public static MinecraftServer server;
@@ -64,48 +79,60 @@ public class KajetansMod
         FluidRegistry.enableUniversalBucket();
     }
     
-    @Mod.EventHandler
-    public void preInit(FMLPreInitializationEvent e) 
+    public KajetansMod()
     {
-        System.out.println(NAME + " is loading!");
-        ModPacketHandler.init();
-        GameRegistry.registerWorldGenerator(new ModWorldGeneration(), 3);
-        
-        DamageUtils.init();
+        instance = this;
         
-        /*net.minecraftforge.common.MinecraftForge.EVENT_BUS.register(new Object()
-            {
-                @net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-                public void wusi2(net.minecraftforge.event.ServerChatEvent e) 
-                {
-                    BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(0, 0, 0);
-                    = Utils.getTargetBlock(e.getPlayer());
-                    e.getPlayer().sendMessage(new TextComponentString(pos.toString()));
-                }
-            });*/
+        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init);
+        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setupServer);
+        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientInit);
+        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onServerStop);
+        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::postInit);
+    }
+    
+    public void setupServer(FMLDedicatedServerSetupEvent e)
+    {
+        Hooks.setPlayerListFunction(ds -> 
+        {
+            ds.setPlayerList(new ModPlayerList(ds));
+        });
     }
     
-    @Mod.EventHandler
-    public void init(FMLInitializationEvent e) 
+    public void init(FMLCommonSetupEvent e) 
     {
+        DeferredWorkQueue.runLater(() -> ModPacketHandler.init());
+        //GameRegistry.registerWorldGenerator(new ModWorldGeneration(), 3);
+        
+        DamageUtils.init();
         proxy.init();
     }
     
-    @Mod.EventHandler
-    public void beforeStart(FMLServerAboutToStartEvent e) 
+    public void clientInit(FMLClientSetupEvent e)
+    {
+        ModEntities.initClient();
+    }
+    
+    public void postInit(FMLLoadCompleteEvent e)
+    {
+        proxy.postInit();
+    }
+
+    @SubscribeEvent
+    public static void beforeStart(FMLServerAboutToStartEvent e) 
     {
-        // takes place after setting of playerlist but before world load
         server = e.getServer();
     }
     
-    @Mod.EventHandler
-    public void serverStarting(FMLServerStartingEvent e) 
+    @SubscribeEvent
+    public static void serverStarting(FMLServerStartingEvent e) 
     {      
-        singlePlayer = e.getServer().isSinglePlayer();        
+        singlePlayer = e.getServer().isSinglePlayer();    
         if(singlePlayer)
         {
             return;
         }
+        setCommandManager();
+        
         // configuration and error-dummy
         error = new Module("ERROR", TextFormatting.RED);
         conf = new SimpleConfig(error, "", "config", true);
@@ -113,26 +140,26 @@ public class KajetansMod
         debugMode = conf.getBoolean("debug", false);
         if(debugMode)
         {
-            System.out.println("------------------------------------------------");
-            System.out.println("Starting server in debug mode");
-            System.out.println("------------------------------------------------");
+            LogManager.getLogger().info("------------------------------------------------");
+            LogManager.getLogger().info("Starting server in debug mode");
+            LogManager.getLogger().info("------------------------------------------------");
         }
         else
         {
-            System.out.println("------------------------------------------------");
-            System.out.println("Starting server without debug mode");
-            System.out.println("------------------------------------------------");
+            LogManager.getLogger().info("------------------------------------------------");
+            LogManager.getLogger().info("Starting server without debug mode");
+            LogManager.getLogger().info("------------------------------------------------");
         }
         
         // Datenbankverbindung
         databank = new DataBank("DataBank", TextFormatting.RED, conf.getString("user", "root"), conf.getString("password", ""));
         if(!databank.openDataBankConnection())
         {
-            System.out.println("------------------------------------------------");
-            System.out.println("Starting server with dummy databank");
-            System.out.println("------------------------------------------------");
+            LogManager.getLogger().info("------------------------------------------------");
+            LogManager.getLogger().info("Starting server with dummy databank");
+            LogManager.getLogger().info("------------------------------------------------");
         }
-
+        
         // Scheduler
         scheduler = new SnuviScheduler("Scheduler", TextFormatting.GREEN);
         scheduler.registerEvents("me.km.scheduler");
@@ -142,36 +169,36 @@ public class KajetansMod
         playerbank = new PlayerManager("PlayerBank", TextFormatting.RED, databank);
 
         // Plot-System
-        plots = new ProtectionBank();    
+        if(databank.isDummyDatabank())
+        {
+            plots = new DummyProtectionBank(); 
+        }
+        else
+        {
+            plots = new ProtectionBank(); 
+        }
+        MinecraftForge.EVENT_BUS.register(new ProtectionEvents());
 
         // block protections
         blocks = new BlockProtection();
 
-        // Worldmanager   
-        Module.registerEvent(new ChangeWorldEvent());
-
         // Scriptsystem
         scripts = new ScriptModule("Scripts", TextFormatting.LIGHT_PURPLE);
         scripts.registerCommands(e, "me.km.snuviscript");          
 
         // Permissions
         perms = new PermissionManager("Perms", TextFormatting.DARK_PURPLE);
-        setPermissionManager();
 
         scripts.startScript("startscript");
     }
     
-    @SideOnly(Side.SERVER)
-    private void setPermissionManager() // dependency workaround
+    @OnlyIn(Dist.DEDICATED_SERVER)
+    private static void setCommandManager()
     {
-        if(server.commandManager instanceof ModServerCommandManager)
-        {
-            ((ModServerCommandManager) server.commandManager).setPermissionManager(perms);
-            ((ModServerCommandManager) server.commandManager).registerRegistryEvent("com.sk89q");
-        }
+        commands = new ModCommandManager(server.isDedicatedServer());
+        ReflectionUtils.setCommandManager(server, commands);
     }
 
-    @Mod.EventHandler
     public void onServerStop(FMLServerStoppingEvent e) 
     {
         if(singlePlayer)
@@ -183,7 +210,4 @@ public class KajetansMod
         databank.closeDataBankConnection();
         scheduler.getWorker().stop();
     }
-}
-
-
- 
+}

+ 0 - 35
src/main/java/me/km/MeshDefinitionFix.java

@@ -1,35 +0,0 @@
-package me.km;
-
-import net.minecraft.client.renderer.ItemMeshDefinition;
-import net.minecraft.client.renderer.block.model.ModelResourceLocation;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-/**
- * A hackish adapter that allows lambdas to be used as {@link ItemMeshDefinition} implementations without breaking ForgeGradle's
- * reobfuscation and causing {@link AbstractMethodError}s.
- * <p>
- * Written by diesieben07 in this thread:
- * http://www.minecraftforge.net/forum/index.php/topic,34034.0.html
- *
- * @author diesieben07
- */
-
-@SideOnly(Side.CLIENT)
-interface MeshDefinitionFix extends ItemMeshDefinition 
-{
-    ModelResourceLocation getLocation(ItemStack stack);
-
-    // Helper method to easily create lambda instances of this class
-    static ItemMeshDefinition create(MeshDefinitionFix lambda) 
-    {
-        return lambda;
-    }
-
-    @Override
-    default ModelResourceLocation getModelLocation(ItemStack stack)
-    {
-        return getLocation(stack);
-    }
-}

+ 25 - 15
src/main/java/me/km/ObjectRegistry.java

@@ -1,25 +1,27 @@
 package me.km;
 
 import me.km.blocks.ModBlocks;
-import me.km.fluids.ModFluids;
+import me.km.blocks.cookingpot.TileEntityCookingPot;
+import me.km.entities.ModEntities;
 import me.km.items.ModItems;
-import me.km.recipes.ModRecipes;
+import me.km.world.WorldManager;
 import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
+import net.minecraft.block.Blocks;
+import net.minecraft.entity.EntityType;
 import net.minecraft.item.Item;
-import net.minecraft.item.crafting.IRecipe;
+import net.minecraft.item.Items;
+import net.minecraft.tileentity.TileEntityType;
+import net.minecraftforge.common.ModDimension;
 import net.minecraftforge.event.RegistryEvent;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
 import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
 
-@Mod.EventBusSubscriber
+@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
 public class ObjectRegistry 
 {
     @SubscribeEvent
     public static void onBlockRegistry(RegistryEvent.Register<Block> e) 
     {
-        ModFluids.init();
         ModBlocks.initBlocks(e.getRegistry());
     }
     
@@ -29,11 +31,7 @@ public class ObjectRegistry
         e.getMappings().stream()
                 .forEach((missing) -> 
                 {
-                    if(missing.key.toString().contains("barrel"))
-                    {
-                        missing.remap(ModBlocks.barrel);   
-                    }
-                    else if(missing.key.toString().contains("cauldron"))
+                    if(missing.key.toString().contains("cauldron"))
                     {
                         missing.remap(ModBlocks.cookingPotCopper);   
                     }
@@ -62,8 +60,20 @@ public class ObjectRegistry
     }
     
     @SubscribeEvent
-    public static void onRecipeRegistry(RegistryEvent.Register<IRecipe> e) 
+    public static void onEntityTypeRegistry(RegistryEvent.Register<EntityType<?>> e) 
+    {
+        ModEntities.init(e.getRegistry());
+    }
+    
+    @SubscribeEvent
+    public static void onTileEntityTypeRegistry(RegistryEvent.Register<TileEntityType<?>> e) 
+    {
+        e.getRegistry().register(TileEntityCookingPot.COOKING_POT);
+    }
+    
+    @SubscribeEvent
+    public static void onModDimensionRegistry(RegistryEvent.Register<ModDimension> e) 
     {
-        ModRecipes.init(e.getRegistry());
+        e.getRegistry().register(WorldManager.MOD_DIMENSION);
     }
 }

+ 23 - 15
src/main/java/me/km/PackageHelper.java

@@ -7,22 +7,22 @@ import java.util.ArrayList;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
-public class PackageHelper 
+public class PackageHelper
 {
     public static ArrayList<Class> getClasses(String packageName)
     {
         URL jar = getPath();
-        if (jar != null)
+        if(jar != null)
         {
             try
             {
                 ZipInputStream zip = new ZipInputStream(jar.openStream());
                 ArrayList<Class> classes = new ArrayList<>();
                 String path = packageName.replace(".", "/");
-                while(true) 
+                while(true)
                 {
                     ZipEntry e = zip.getNextEntry();
-                    if (e == null)
+                    if(e == null)
                     {
                         break;
                     }
@@ -30,13 +30,13 @@ public class PackageHelper
                     if(name.startsWith(path))
                     {
                         name = name.replace("/", ".").substring(0, e.getName().length() - 6);
-                        try 
+                        try
                         {
                             classes.add(Class.forName(name));
-                        } 
-                        catch (ClassNotFoundException ex) 
+                        }
+                        catch(ClassNotFoundException ex)
                         {
-                        } 
+                        }
                     }
                 }
                 return classes;
@@ -44,17 +44,25 @@ public class PackageHelper
             catch(IOException ex)
             {
             }
-        } 
+        }
         return new ArrayList<>();
     }
-    
+
     private static URL getPath()
     {
         try
         {
-            String s = KajetansMod.class.getProtectionDomain().getCodeSource().getLocation().getPath();
-            s = s.substring(5, s.length() - 25);
-            
+            String s;
+            try
+            {
+                s = KajetansMod.class.getProtectionDomain().getCodeSource().getLocation().getPath();
+                s = s.substring(5, s.length() - 25);
+            }
+            catch(Exception ex)
+            {
+                s = "../build/libs/km-1.0.jar";
+            }
+
             File f = new File(s);
             if(!f.exists())
             {
@@ -63,12 +71,12 @@ public class PackageHelper
                     System.out.println(f + " does not exist");
                 }
             }
-            
+
             return new URL("file:" + s);
         }
         catch(Exception ex)
         {
-            System.out.println(ex);
+            ex.printStackTrace();
         }
         return null;
     }

+ 37 - 25
src/main/java/me/km/blockprotections/BlockProtection.java

@@ -5,39 +5,47 @@ import me.km.module.Module;
 import me.km.utils.Location;
 import me.km.utils.Utils;
 import net.minecraft.block.Block;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.BlockDoor;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.util.EnumHand;
+import net.minecraft.block.ContainerBlock;
+import net.minecraft.block.DoorBlock;
+import net.minecraft.block.BlockState;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.block.Blocks;
+import net.minecraft.state.properties.DoubleBlockHalf;
+import net.minecraft.util.Hand;
 import net.minecraft.util.math.BlockPos;
 import net.minecraft.util.text.TextFormatting;
-import net.minecraft.world.World;
+import net.minecraft.world.IWorld;
 import net.minecraftforge.event.entity.player.PlayerInteractEvent;
 import net.minecraftforge.event.world.BlockEvent;
-import net.minecraftforge.fml.common.eventhandler.EventPriority;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.eventbus.api.EventPriority;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
 
 public class BlockProtection extends Module
 {
     private final static String BLOCK_BYPASS = "block.bypass";
     
-    private final BlockProtectionBank bank;
+    private final IBlockProtection bank;
     
     public BlockProtection() 
     {
         super("Blocks", TextFormatting.BLUE);
-        bank = new BlockProtectionBank();
+        if(KajetansMod.databank.isDummyDatabank())
+        {
+            bank = new DummyBlockProtection();
+        }
+        else
+        {
+            bank = new BlockProtectionBank();
+        }
         registerEvent(this);
     }
     
-    public BlockProtectionBank getDatabank()
+    public IBlockProtection getDatabank()
     {
         return bank;
     }
     
-    private BlockPos getSameNearbyBlock(World w, BlockPos pos, Block b)
+    private BlockPos getSameNearbyBlock(IWorld w, BlockPos pos, Block b)
     {           
         Location l = new Location(w, pos);
         if(l.getRelativeBlockState(1, 0, 0).getBlock() == b)
@@ -60,11 +68,15 @@ public class BlockProtection extends Module
     }
     
     @SubscribeEvent(priority = EventPriority.HIGHEST)
-    public void onBlockPlace(BlockEvent.PlaceEvent e)
+    public void onBlockPlace(BlockEvent.EntityPlaceEvent e)
     {
         Block b = e.getPlacedBlock().getBlock();
-        EntityPlayer p = e.getPlayer();
-        World w = e.getWorld();
+        if(!(e.getEntity() instanceof PlayerEntity))
+        {
+            return;
+        }
+        PlayerEntity p = (PlayerEntity) e.getEntity();
+        IWorld w = e.getWorld();
         
         if(b == Blocks.CHEST || b == Blocks.TRAPPED_CHEST) // Deny placing chests near other protected chests
         {
@@ -77,7 +89,7 @@ public class BlockProtection extends Module
         else if(b == Blocks.HOPPER) // Deny placing of hoppers under blocks
         {
             BlockPos pos = e.getPos().add(0, 1, 0);
-            if(w.getBlockState(pos).getBlock() instanceof BlockContainer)
+            if(w.getBlockState(pos).getBlock() instanceof ContainerBlock)
             {
                 if(!bank.hasAccess(pos, w, p) && !KajetansMod.perms.hasPermission(p, BLOCK_BYPASS))
                 {
@@ -90,15 +102,15 @@ public class BlockProtection extends Module
     @SubscribeEvent(priority = EventPriority.HIGHEST)
     public void onBlockBreak(BlockEvent.BreakEvent e)
     {
-        EntityPlayer p = e.getPlayer();
-        IBlockState state = e.getState();
+        PlayerEntity p = e.getPlayer();
+        BlockState state = e.getState();
 
         BlockPos pos = e.getPos();
-        if(Utils.getStateValue(state, BlockDoor.HALF) == BlockDoor.EnumDoorHalf.UPPER)
+        if(Utils.getStateValue(state, DoorBlock.HALF) == DoubleBlockHalf.UPPER)
         {
             pos = pos.add(0, -1, 0);
         } 
-        World w = e.getWorld();
+        IWorld w = e.getWorld();
         if(bank.hasAccess(pos, w, p) || KajetansMod.perms.hasPermission(p, BLOCK_BYPASS))
         {
             // TODO remove protection
@@ -110,14 +122,14 @@ public class BlockProtection extends Module
     @SubscribeEvent(priority = EventPriority.HIGHEST)
     public void onContainerOpen(PlayerInteractEvent.RightClickBlock e)
     {
-        if(e.getHand() != EnumHand.MAIN_HAND)
+        if(e.getHand() != Hand.MAIN_HAND)
         {
             return;
         }
-        IBlockState state = e.getWorld().getBlockState(e.getPos());
-        EntityPlayer p = e.getEntityPlayer();
+        BlockState state = e.getWorld().getBlockState(e.getPos());
+        PlayerEntity p = e.getEntityPlayer();
         BlockPos pos = e.getPos();
-        if(Utils.getStateValue(state, BlockDoor.HALF) == BlockDoor.EnumDoorHalf.UPPER)
+        if(Utils.getStateValue(state, DoorBlock.HALF) == DoubleBlockHalf.UPPER)
         {
             pos = pos.add(0, -1, 0);
         }

+ 11 - 11
src/main/java/me/km/blockprotections/BlockProtectionBank.java

@@ -1,15 +1,15 @@
 package me.km.blockprotections;
 
+import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import me.km.KajetansMod;
-import me.km.databank.IStatement;
-import me.km.world.ModDimensions;
-import net.minecraft.entity.player.EntityPlayer;
+import me.km.world.WorldManager;
+import net.minecraft.entity.player.PlayerEntity;
 import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
+import net.minecraft.world.IWorld;
 
-public class BlockProtectionBank
+public class BlockProtectionBank implements IBlockProtection
 {  
     public BlockProtectionBank() 
     {
@@ -30,9 +30,10 @@ public class BlockProtectionBank
                     + "CONSTRAINT block_grant_ibfk_1 FOREIGN KEY (block_id) REFERENCES block (id) ON DELETE CASCADE);");
     }  
 
-    private final IStatement hasAccess = KajetansMod.databank.createStatement(
+    private final PreparedStatement hasAccess = KajetansMod.databank.prepareStatement(
             "Select id from block_grant WHERE id = ? AND player_id = ?;");
     
+    @Override
     public boolean hasAccess(int x, int y, int z, String worldName, int playerId)
     {
         int id = getId(x, y, z, worldName);
@@ -42,7 +43,6 @@ public class BlockProtectionBank
         }
         try
         {
-            hasAccess.validate();
             hasAccess.setInt(1, id);
             hasAccess.setInt(2, playerId);
             try(ResultSet rs = hasAccess.executeQuery())
@@ -61,19 +61,19 @@ public class BlockProtectionBank
         return false;
     }
     
-    public boolean hasAccess(BlockPos pos, World w, EntityPlayer p)
+    @Override
+    public boolean hasAccess(BlockPos pos, IWorld w, PlayerEntity p)
     {
-        return hasAccess(pos.getX(), pos.getY(), pos.getZ(), ModDimensions.getWorldName(w), KajetansMod.playerbank.getPlayerId(p.getUniqueID()));
+        return hasAccess(pos.getX(), pos.getY(), pos.getZ(), WorldManager.getName(w), KajetansMod.playerbank.getPlayerId(p.getUniqueID()));
     }
     
-    private final IStatement getId = KajetansMod.databank.createStatement(
+    private final PreparedStatement getId = KajetansMod.databank.prepareStatement(
             "SELECT id FROM block WHERE world_name=? AND x=? AND y=? AND z=?;");
     
     private int getId(int x, int y, int z, String worldName)
     {
         try
         {
-            getId.validate();
             getId.setString(1, worldName);
             getId.setInt(2, x);
             getId.setInt(3, y);

+ 21 - 0
src/main/java/me/km/blockprotections/DummyBlockProtection.java

@@ -0,0 +1,21 @@
+package me.km.blockprotections;
+
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.IWorld;
+
+public class DummyBlockProtection implements IBlockProtection
+{
+    @Override
+    public boolean hasAccess(int x, int y, int z, String worldName, int playerId)
+    {
+        return true;
+    }
+
+    @Override
+    public boolean hasAccess(BlockPos pos, IWorld w, PlayerEntity p)
+    {
+        return true;
+    }
+    
+}

+ 11 - 0
src/main/java/me/km/blockprotections/IBlockProtection.java

@@ -0,0 +1,11 @@
+package me.km.blockprotections;
+
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.IWorld;
+
+public interface IBlockProtection
+{
+    public boolean hasAccess(int x, int y, int z, String worldName, int playerId);
+    public boolean hasAccess(BlockPos pos, IWorld w, PlayerEntity p);
+}

+ 0 - 69
src/main/java/me/km/blocks/BlockBase.java

@@ -1,69 +0,0 @@
-package me.km.blocks;
-
-import me.km.KajetansMod;
-import net.minecraft.block.*;
-import net.minecraft.block.material.MapColor;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.Entity;
-import net.minecraft.item.Item;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-public class BlockBase extends Block implements IBlockBase
-{
-    protected String name;
-    private SoundType type;
-    private MapColor mapColor;
-
-    public BlockBase(Material material, String name, String local) 
-    {
-        super(material);
-        this.name = name;
-        this.setRegistryName(name);
-        super.setUnlocalizedName(local);
-        super.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
-        this.type = super.getSoundType();
-        this.mapColor = blockMapColor;
-    }
-
-    public BlockBase setMapColor(MapColor mapColor)
-    {
-        this.mapColor = mapColor;
-        return this;
-    }
-
-    @Override
-    public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos) 
-    {
-        return this.mapColor;
-    }
-    
-    @Override
-    public void registerItemModel(Item itemBlock) 
-    {
-        KajetansMod.proxy.registerItemRenderer(itemBlock, 0, name);
-    }
-
-    @Override
-    public BlockBase setCreativeTab(CreativeTabs tab) 
-    {
-        super.setCreativeTab(tab);
-        return this;
-    }
-
-    @Override
-    public BlockBase setSoundType(SoundType sound) 
-    {
-        this.type = sound;
-        return this;
-    }
-
-    @Override
-    public SoundType getSoundType(IBlockState state, World world, BlockPos pos, Entity entity) 
-    {
-        return type;
-    }
-}

+ 0 - 18
src/main/java/me/km/blocks/BlockCrate.java

@@ -1,18 +0,0 @@
-package me.km.blocks;
-
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.creativetab.CreativeTabs;
-
-public class BlockCrate extends BlockBase
-{
-    public BlockCrate(String name, String local)
-    {
-        super(Material.WOOD, name, local);
-        
-        super.setCreativeTab(CreativeTabs.DECORATIONS);
-        super.setHardness(2.0F);
-        super.setResistance(5.0F);
-        super.setSoundType(SoundType.WOOD);
-    }
-}

+ 0 - 234
src/main/java/me/km/blocks/BlockEvents.java

@@ -1,234 +0,0 @@
-package me.km.blocks;
-
-import com.google.common.collect.Sets;
-import java.util.List;
-import java.util.Random;
-import java.util.Set;
-import me.km.utils.ReflectionUtils;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.enchantment.EnchantmentProtection;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityTNTPrimed;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.SoundEvents;
-import net.minecraft.util.DamageSource;
-import net.minecraft.util.EnumParticleTypes;
-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.Vec3d;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.World;
-import net.minecraftforge.event.world.ExplosionEvent;
-import net.minecraftforge.fml.common.eventhandler.EventPriority;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-
-public class BlockEvents 
-{
-    @SubscribeEvent(receiveCanceled = false, priority = EventPriority.LOWEST)
-    public void onExplosion(ExplosionEvent.Start e)
-    {
-        Explosion ex = e.getExplosion();
-        Entity ent = ReflectionUtils.getExploder(ex);
-        if(ReflectionUtils.getSize(ex) > 10)
-        {
-            ReflectionUtils.setSize(ex, 10);
-        }
-        e.setCanceled(true);
-        doExplosionA(ex, e.getWorld(), ent instanceof EntityTNTPrimed);
-        doExplosionB(ex, e.getWorld(), true);
-    }
-    
-    public void doExplosionA(Explosion ex, World w, boolean tnt)
-    {
-        Set<BlockPos> set = Sets.<BlockPos>newHashSet();
-        int i = 16;
-
-        Vec3d v = ex.getPosition();
-        float explosionSize = ReflectionUtils.getSize(ex);
-        Entity exploder = ReflectionUtils.getExploder(ex);
-        for(int j = 0; j < 16; ++j)
-        {
-            for(int k = 0; k < 16; ++k)
-            {
-                for(int l = 0; l < 16; ++l)
-                {
-                    if(j == 0 || j == 15 || k == 0 || k == 15 || l == 0 || l == 15)
-                    {
-                        double d0 = j / 15f * 2 - 1;
-                        double d1 = k / 15f * 2 - 1;
-                        double d2 = l / 15f * 2 - 1;
-                        double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
-                        d0 = d0 / d3;
-                        d1 = d1 / d3;
-                        d2 = d2 / d3;
-                        float f = explosionSize * (0.7f + w.rand.nextFloat() * 0.6f);
-                        double d4 = v.x;
-                        double d6 = v.y;
-                        double d8 = v.z;
-
-                        for(float f1 = 0.3F; f > 0.0F; f -= 0.22500001F)
-                        {
-                            BlockPos blockpos = new BlockPos(d4, d6, d8);
-                            IBlockState iblockstate = w.getBlockState(blockpos);
-
-                            if (iblockstate.getMaterial() != Material.AIR)
-                            {
-                                float f2 = exploder != null ? exploder.getExplosionResistance(ex, w, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(w, blockpos, null, ex);
-                                // TNT hook
-                                if(tnt && f2 <= 10)
-                                {
-                                    f2 = Math.min(f2, 1);
-                                }
-                                // end
-                                f -= (f2 + 0.3F) * 0.3F;
-                            }
-
-                            if (f > 0.0F && (exploder == null || exploder.canExplosionDestroyBlock(ex, w, blockpos, iblockstate, f)))
-                            {
-                                set.add(blockpos);
-                            }
-
-                            d4 += d0 * 0.3d;
-                            d6 += d1 * 0.3d;
-                            d8 += d2 * 0.3d;
-                        }
-                    }
-                }
-            }
-        }
-
-        ex.getAffectedBlockPositions().addAll(set);
-        float f3 = explosionSize * 2;
-        int k1 = MathHelper.floor(v.x - f3 - 1);
-        int l1 = MathHelper.floor(v.x + f3 + 1);
-        int i2 = MathHelper.floor(v.y - f3 - 1);
-        int i1 = MathHelper.floor(v.y + f3 + 1);
-        int j2 = MathHelper.floor(v.z - f3 - 1);
-        int j1 = MathHelper.floor(v.z + f3 + 1);
-        List<Entity> list = w.getEntitiesWithinAABBExcludingEntity(exploder, new AxisAlignedBB(k1, i2, j2, l1, i1, j1));
-        net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(w, ex, list, f3);
-        Vec3d vec3d = new Vec3d(v.x, v.y, v.z);
-
-        for(int k2 = 0; k2 < list.size(); k2++)
-        {
-            Entity entity = list.get(k2);
-
-            if(!entity.isImmuneToExplosions())
-            {
-                double d12 = entity.getDistance(v.x, v.y, v.z) / f3;
-
-                if(d12 <= 1.0D)
-                {
-                    double d5 = entity.posX - v.x;
-                    double d7 = entity.posY + (double)entity.getEyeHeight() - v.y;
-                    double d9 = entity.posZ - v.z;
-                    double d13 = MathHelper.sqrt(d5 * d5 + d7 * d7 + d9 * d9);
-
-                    if(d13 != 0.0D)
-                    {
-                        d5 = d5 / d13;
-                        d7 = d7 / d13;
-                        d9 = d9 / d13;
-                        double d14 = w.getBlockDensity(vec3d, entity.getEntityBoundingBox());
-                        double d10 = (1.0D - d12) * d14;
-                        entity.attackEntityFrom(DamageSource.causeExplosionDamage(ex), (float)((int)((d10 * d10 + d10) / 2 * 7 * f3 + 1)));
-                        double d11 = d10;
-
-                        if(entity instanceof EntityLivingBase)
-                        {
-                            d11 = EnchantmentProtection.getBlastDamageReduction((EntityLivingBase) entity, d10);
-                        }
-
-                        entity.motionX += d5 * d11;
-                        entity.motionY += d7 * d11;
-                        entity.motionZ += d9 * d11;
-
-                        if (entity instanceof EntityPlayer)
-                        {
-                            EntityPlayer entityplayer = (EntityPlayer)entity;
-
-                            if (!entityplayer.isSpectator() && (!entityplayer.isCreative() || !entityplayer.capabilities.isFlying))
-                            {
-                                ex.getPlayerKnockbackMap().put(entityplayer, new Vec3d(d5 * d10, d7 * d10, d9 * d10));
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-    
-    private void doExplosionB(Explosion ex, World w, boolean spawnParticles)
-    {
-        Vec3d v = ex.getPosition();
-        double x = v.x;
-        double y = v.y;
-        double z = v.z;
-        w.playSound(null, x, y, z, SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, 4, (1 + (w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f) * 0.7f);
-
-        if(ReflectionUtils.getSize(ex) >= 2 && ReflectionUtils.isSmoking(ex))
-        {
-            w.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, x, y, z, 1, 0, 0, new int[0]);
-        }
-        else
-        {
-            w.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, x, y, z, 1, 0, 0, new int[0]);
-        }
-
-        if(ReflectionUtils.isSmoking(ex))
-        {
-            float explosionSize = ReflectionUtils.getSize(ex);
-            ex.getAffectedBlockPositions().stream().forEach(blockpos -> 
-            {
-                IBlockState iblockstate = w.getBlockState(blockpos);
-                Block block = iblockstate.getBlock();
-
-                if(spawnParticles)
-                {
-                    double d0 = blockpos.getX() + w.rand.nextFloat();
-                    double d1 = blockpos.getY() + w.rand.nextFloat();
-                    double d2 = blockpos.getZ() + w.rand.nextFloat();
-                    double d3 = d0 - x;
-                    double d4 = d1 - y;
-                    double d5 = d2 - z;
-                    double d6 = MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
-                    d3 = d3 / d6;
-                    d4 = d4 / d6;
-                    d5 = d5 / d6;
-                    double d7 = 0.5D / (d6 / explosionSize + 0.1D);
-                    d7 = d7 * (w.rand.nextFloat() * w.rand.nextFloat() + 0.3F);
-                    d3 = d3 * d7;
-                    d4 = d4 * d7;
-                    d5 = d5 * d7;
-                    w.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (d0 + x) / 2, (d1 + y) / 2, (d2 + z) / 2, d3, d4, d5, new int[0]);
-                    w.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]);
-                }
-
-                if(iblockstate.getMaterial() != Material.AIR)
-                {
-                    if(block.canDropFromExplosion(ex))
-                    {
-                        block.dropBlockAsItem(w, blockpos, w.getBlockState(blockpos), 0);
-                    }
-                    block.onBlockExploded(w, blockpos, ex);
-                }
-            });
-        }
-
-        if(ReflectionUtils.isFlaming(ex))
-        {
-            Random rand = ReflectionUtils.getRandom(ex);
-            ex.getAffectedBlockPositions().stream()
-                    .filter(pos -> (w.getBlockState(pos).getMaterial() == Material.AIR && 
-                                    w.getBlockState(pos.down()).isFullBlock() && 
-                                    rand.nextInt(3) == 0))
-                    .forEach(pos -> w.setBlockState(pos, Blocks.FIRE.getDefaultState()));
-        }
-    }
-}

+ 7 - 38
src/main/java/me/km/blocks/BlockHay.java

@@ -1,56 +1,25 @@
 package me.km.blocks;
 
-import me.km.KajetansMod;
-import net.minecraft.block.BlockRotatedPillar;
+import net.minecraft.block.RotatedPillarBlock;
 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.entity.Entity;
-import net.minecraft.item.Item;
-import net.minecraft.util.EnumFacing;
+import net.minecraft.util.Direction;
 import net.minecraft.util.math.BlockPos;
 import net.minecraft.world.World;
 
-public class BlockHay extends BlockRotatedPillar implements IBlockBase
+public class BlockHay extends RotatedPillarBlock
 { 
-    protected String name;
-    private SoundType type;
-    
-    public BlockHay(String name, String local) 
+    public BlockHay(String name) 
     {
-        super(Material.GRASS);
-        this.name = name;
+        super(Properties.create(Material.ORGANIC).hardnessAndResistance(0.5f).sound(SoundType.PLANT));
         this.setRegistryName(name);
-        super.setUnlocalizedName(local);
-        super.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
-        super.setHardness(0.5F);
-        this.type = SoundType.PLANT;
-        this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.Y));
+        this.setDefaultState(this.stateContainer.getBaseState().with(AXIS, Direction.Axis.Y));
     }
 
     @Override
     public void onFallenUpon(World w, BlockPos pos, Entity ent, float fallDistance)
     {
-        ent.fall(fallDistance, 0.2F);
-    }
-
-    @Override
-    public void registerItemModel(Item itemBlock) 
-    {
-        KajetansMod.proxy.registerItemRenderer(itemBlock, 0, name);
-    }
-
-    @Override
-    public BlockHay setSoundType(SoundType sound) 
-    {
-        this.type = sound;
-        return this;
-    }
-
-    @Override
-    public SoundType getSoundType(IBlockState state, World world, BlockPos pos, Entity entity) 
-    {
-        return type;
+        ent.fall(fallDistance, 0.2f);
     }
 }

+ 8 - 45
src/main/java/me/km/blocks/BlockHayBed.java

@@ -1,61 +1,24 @@
 package me.km.blocks;
 
-import java.util.Random;
-import static me.km.blocks.BlockModBed.PART;
 import me.km.items.ModItems;
-import static net.minecraft.block.Block.spawnAsEntity;
-import net.minecraft.block.BlockBed;
+import net.minecraft.block.Block;
 import net.minecraft.block.SoundType;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.BlockState;
 import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.AxisAlignedBB;
 import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
+import net.minecraft.world.IBlockReader;
 
 public class BlockHayBed extends BlockModBed
 { 
-    private static final AxisAlignedBB BOX = new AxisAlignedBB(0, 0, 0, 1, 0.125d, 1);
-    
-    public BlockHayBed(String name, String local) 
+    public BlockHayBed(String name) 
     {
-        super(name, local);
-        super.setSoundType(SoundType.PLANT);
-    }
-    
-    @Override
-    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
-    {
-        return BOX;
+        super(name, Block.Properties.create(Material.ORGANIC).hardnessAndResistance(0.5f).sound(SoundType.PLANT), 2.0);
     }
 
     @Override
-    public float getLayingHigh() 
-    {
-        return 0;
-    }
-    
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return state.getValue(PART) == BlockBed.EnumPartType.FOOT ? Items.AIR : ModItems.realHayBed;
-    }
-    
-    @Override
-    public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
-    {
-        if(state.getValue(PART) == BlockBed.EnumPartType.HEAD)
-        {
-            spawnAsEntity(worldIn, pos, new ItemStack(ModItems.realHayBed));
-        }
-    }
-    
-    @Override
-    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
+    public ItemStack getItem(IBlockReader w, BlockPos pos, BlockState state)
     {
         return new ItemStack(ModItems.realHayBed);
     }
-
-}
+}

+ 68 - 210
src/main/java/me/km/blocks/BlockLantern.java

@@ -1,158 +1,55 @@
 package me.km.blocks;
 
 import java.util.Random;
-import me.km.KajetansMod;
 import net.minecraft.block.Block;
-import net.minecraft.block.BlockDirectional;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.block.DirectionalBlock;
 import net.minecraft.block.SoundType;
 import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.IProperty;
-import net.minecraft.block.state.BlockFaceShape;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.item.Item;
+import net.minecraft.item.BlockItemUseContext;
+import net.minecraft.particles.ParticleTypes;
+import net.minecraft.state.StateContainer;
 import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumParticleTypes;
-import net.minecraft.util.Mirror;
-import net.minecraft.util.Rotation;
-import net.minecraft.util.math.AxisAlignedBB;
+import net.minecraft.util.Direction;
 import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
+import net.minecraft.util.math.shapes.ISelectionContext;
+import net.minecraft.util.math.shapes.VoxelShape;
+import net.minecraft.world.IBlockReader;
+import net.minecraft.world.IWorld;
+import net.minecraft.world.IWorldReader;
 import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
-public class BlockLantern extends BlockDirectional implements IBlockBase
+public class BlockLantern extends DirectionalBlock
 {
-    protected static final AxisAlignedBB HANGING_AABB = new AxisAlignedBB(0.1875d, 0.125d, 0.1875d, 0.8125d, 1, 0.875d);
-    protected static final AxisAlignedBB STANDING_AABB = new AxisAlignedBB(0.1875d, 0, 0.1875d, 0.8125d, 0.75d, 0.875d);
-    
-    protected static final AxisAlignedBB TORCH_NORTH_AABB = new AxisAlignedBB(0.1875d, 0, 0.375d, 0.8125d, 1, 1);
-    protected static final AxisAlignedBB TORCH_SOUTH_AABB = new AxisAlignedBB(0.1875d, 0, 0, 0.8125d, 1, 0.625d);
-    protected static final AxisAlignedBB TORCH_WEST_AABB = new AxisAlignedBB(0.375d, 0, 0.1875d, 1, 1, 0.8125d);
-    protected static final AxisAlignedBB TORCH_EAST_AABB = new AxisAlignedBB(0, 0, 0.1875d, 0.625d, 1, 0.8125d);
-    
-    protected String name;
-    
-    public BlockLantern(String name, String local) 
-    {
-        super(Material.IRON);
-        this.name = name;
-        super.setHardness(0.0F);
-        super.setLightLevel(0.9375F);
-        super.setSoundType(SoundType.METAL);
-        this.setRegistryName(name);
-        super.setUnlocalizedName(local);
-        super.setCreativeTab(CreativeTabs.DECORATIONS);
-        
-        this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP));
-        super.setTickRandomly(true);
-    }
-
-    @Override
-    public void registerItemModel(Item itemBlock) 
-    {
-        KajetansMod.proxy.registerItemRenderer(itemBlock, 0, name);
-    }
-
-    @Override
-    public BlockLantern setSoundType(SoundType sound) 
-    {
-        super.setSoundType(sound);
-        return this;
-    }
-
-    @Override
-    public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess w, BlockPos pos)
-    {
-        return NULL_AABB;
-    }
-
-    @Override
-    public boolean isOpaqueCube(IBlockState state)
-    {
-        return false;
-    }
-
-    @Override
-    public boolean isFullCube(IBlockState state)
-    {
-        return false;
-    }
-
-    @Override
-    public boolean canPlaceBlockOnSide(World w, BlockPos pos, EnumFacing side)
-    {
-        return canPlaceBlock(w, pos, side);
-    }
-
-    @Override
-    public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
-    {
-        for(EnumFacing enumfacing : EnumFacing.values())
-        {
-            if(canPlaceBlock(worldIn, pos, enumfacing))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
+    protected static final VoxelShape HANGING_AABB = Block.makeCuboidShape(3.0, 2.0, 3.0, 13.0, 16.0, 13.0);
+    protected static final VoxelShape STANDING_AABB = Block.makeCuboidShape(3.0, 0.0, 3.0, 13.0, 12.0, 13.0);
 
-    protected static boolean canPlaceBlock(World w, BlockPos pos, EnumFacing direction)
-    {
-        BlockPos blockpos = pos.offset(direction.getOpposite());
-        IBlockState state = w.getBlockState(blockpos);
-        Block block = state.getBlock();
-        if(direction == EnumFacing.UP)
-        {
-            return block.canPlaceTorchOnTop(state, w, pos);
-        }
-        else
-        {
-            return !isExceptBlockForAttachWithPiston(block) && state.getBlockFaceShape(w, blockpos, direction) == BlockFaceShape.SOLID;
-        }
-    }
-
-    @Override
-    public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
-    {
-        return canPlaceBlock(worldIn, pos, facing) ? this.getDefaultState().withProperty(FACING, facing) : this.getDefaultState().withProperty(FACING, EnumFacing.DOWN);
-    }
+    protected static final VoxelShape TORCH_NORTH_AABB = Block.makeCuboidShape(3.0, 0.0, 6.0, 13.0, 16.0, 16.0);
+    protected static final VoxelShape TORCH_SOUTH_AABB = Block.makeCuboidShape(3.0, 0.0, 0.0, 13.0, 16.0, 10.0);
+    protected static final VoxelShape TORCH_WEST_AABB = Block.makeCuboidShape(6.0, 0.0, 3.0, 16.0, 16.0, 13.0);
+    protected static final VoxelShape TORCH_EAST_AABB = Block.makeCuboidShape(0, 0.0, 3.0, 10.0, 16.0, 13.0);
 
-    @Override
-    public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
-    {
-        if(this.checkForDrop(worldIn, pos, state) && !canPlaceBlock(worldIn, pos, state.getValue(FACING)))
-        {
-            this.dropBlockAsItem(worldIn, pos, state, 0);
-            worldIn.setBlockToAir(pos);
-        }
-    }
+    protected String name;
 
-    private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state)
+    public BlockLantern(String name)
     {
-        if(this.canPlaceBlockAt(worldIn, pos))
-        {
-            return true;
-        }
-        else
-        {
-            this.dropBlockAsItem(worldIn, pos, state, 0);
-            worldIn.setBlockToAir(pos);
-            return false;
-        }
+        super(Properties.create(Material.IRON).doesNotBlockMovement().hardnessAndResistance(0.0f).lightValue(14).sound(SoundType.METAL));
+        this.setRegistryName(name);
+        this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.UP));
     }
 
     @Override
-    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
+    public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context)
     {
-        EnumFacing enumfacing = (EnumFacing) state.getValue(FACING);
-        switch(enumfacing)
+        switch(state.get(FACING))
         {
+            case UP:
+                return STANDING_AABB;
+            case DOWN:
+                return HANGING_AABB;
             case EAST:
                 return TORCH_EAST_AABB;
             case WEST:
@@ -160,114 +57,75 @@ public class BlockLantern extends BlockDirectional implements IBlockBase
             case SOUTH:
                 return TORCH_SOUTH_AABB;
             case NORTH:
-            default:
                 return TORCH_NORTH_AABB;
-            case UP:
-                return STANDING_AABB;
-            case DOWN:
-                return HANGING_AABB;
         }
+        return TORCH_NORTH_AABB;
     }
 
+    @OnlyIn(Dist.CLIENT)
     @Override
-    public IBlockState getStateFromMeta(int meta)
+    public void animateTick(BlockState state, World w, BlockPos pos, Random rand)
     {
-        EnumFacing enumfacing;
-        switch(meta & 7)
+        Direction face = state.get(FACING);
+        double x = pos.getX() + 0.5;
+        double y = pos.getY() + 0.7;
+        double z = pos.getZ() + 0.5;
+        switch(face)
         {
-            case 0:
-                enumfacing = EnumFacing.DOWN;
-                break;
-            case 1:
-                enumfacing = EnumFacing.EAST;
-                break;
-            case 2:
-                enumfacing = EnumFacing.WEST;
-                break;
-            case 3:
-                enumfacing = EnumFacing.SOUTH;
+            case EAST:
+            case NORTH:
+            case WEST:
+            case SOUTH:
+                Direction oface = face.getOpposite();
+                x += 0.1875 * oface.getXOffset();
+                z += 0.1875 * oface.getZOffset();
                 break;
-            case 4:
-                enumfacing = EnumFacing.NORTH;
+            case DOWN:
                 break;
-            case 5:
-            default:
-                enumfacing = EnumFacing.UP;
-        }
-        return this.getDefaultState().withProperty(FACING, enumfacing);
-    }
-
-    @Override
-    public int getMetaFromState(IBlockState state)
-    {
-        switch(state.getValue(FACING))
-        {
-            case EAST: return 1;
-            case WEST: return 2;
-            case SOUTH: return 3;
-            case NORTH: return 4;
             case UP:
-            default: return 5;
-            case DOWN: return 0;
+                y -= 0.125d;
+                break;
         }
+        w.addParticle(ParticleTypes.SMOKE, x, y, z, 0.0, 0.0, 0.0);
+        w.addParticle(ParticleTypes.FLAME, x, y, z, 0.0, 0.0, 0.0);
     }
 
     @Override
-    public IBlockState withRotation(IBlockState state, Rotation rot)
+    public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos)
     {
-        return state.withProperty(FACING, rot.rotate(state.getValue(FACING)));
+        return false;
     }
 
     @Override
-    public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
+    protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
     {
-        return state.withRotation(mirrorIn.toRotation(state.getValue(FACING)));
+        builder.add(FACING);
     }
 
     @Override
-    protected BlockStateContainer createBlockState()
+    public boolean isValidPosition(BlockState state, IWorldReader w, BlockPos pos)
     {
-        return new BlockStateContainer(this, new IProperty[] {FACING});
+        Direction direction = state.get(FACING);
+        BlockPos blockpos = pos.offset(direction.getOpposite());
+        BlockState blockstate = w.getBlockState(blockpos);
+        return Block.hasSolidSide(blockstate, w, blockpos, direction);
     }
 
     @Override
-    public BlockFaceShape getBlockFaceShape(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
+    public BlockState getStateForPlacement(BlockItemUseContext context)
     {
-        return BlockFaceShape.UNDEFINED;
+        return this.getDefaultState().with(FACING, context.getFace());
     }
 
-    @SideOnly(Side.CLIENT)
     @Override
-    public void randomDisplayTick(IBlockState state, World w, BlockPos pos, Random rand)
+    public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld w, BlockPos currentPos, BlockPos facingPos)
     {
-        EnumFacing face = state.getValue(FACING);
-        double x = pos.getX() + 0.5D;
-        double y = pos.getY() + 0.7D;
-        double z = pos.getZ() + 0.5D;
-        switch(face)
-        {
-            case EAST:
-            case WEST:
-            case SOUTH:
-            case NORTH:
-                EnumFacing oface = face.getOpposite();
-                x += 0.1875d * oface.getFrontOffsetX();
-                z += 0.1875d * oface.getFrontOffsetZ();
-                break;
-            case DOWN:
-                break;
-            case UP:
-                y -= 0.125d;
-                break;
-        }
-        w.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x, y , z, 0, 0, 0);
-        w.spawnParticle(EnumParticleTypes.FLAME, x, y, z, 0, 0, 0);
+        return state.get(FACING).getOpposite() == facing && !state.isValidPosition(w, currentPos) ? Blocks.AIR.getDefaultState() : state;
     }
-
-    @SideOnly(Side.CLIENT)
+    
     @Override
-    public BlockRenderLayer getBlockLayer()
+    public BlockRenderLayer getRenderLayer() 
     {
         return BlockRenderLayer.TRANSLUCENT;
     }
-}
+}

+ 29 - 334
src/main/java/me/km/blocks/BlockModBed.java

@@ -1,375 +1,70 @@
 package me.km.blocks;
 
-import java.util.Random;
-import javax.annotation.Nullable;
 import net.minecraft.block.Block;
-import net.minecraft.block.BlockBed;
-import net.minecraft.block.BlockHorizontal;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.EnumPushReaction;
-import net.minecraft.block.material.MapColor;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.IProperty;
-import net.minecraft.block.properties.PropertyBool;
-import net.minecraft.block.properties.PropertyEnum;
-import net.minecraft.block.state.BlockFaceShape;
-import net.minecraft.block.state.BlockStateContainer;
-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.entity.player.EntityPlayerMP;
-import net.minecraft.init.Biomes;
-import net.minecraft.item.ItemStack;
+import net.minecraft.block.BedBlock;
+import net.minecraft.block.BlockRenderType;
+import net.minecraft.block.material.MaterialColor;
+import net.minecraft.block.BlockState;
+import net.minecraft.item.DyeColor;
+import net.minecraft.state.properties.BedPart;
 import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.Mirror;
-import net.minecraft.util.Rotation;
-import net.minecraft.util.math.AxisAlignedBB;
 import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.text.TextComponentTranslation;
-import net.minecraft.world.IBlockAccess;
+import net.minecraft.util.math.shapes.ISelectionContext;
+import net.minecraft.util.math.shapes.VoxelShape;
+import net.minecraft.world.IBlockReader;
 import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
 
-public abstract class BlockModBed extends BlockHorizontal
+public abstract class BlockModBed extends BedBlock
 {
-    public static final PropertyEnum<BlockBed.EnumPartType> PART = PropertyEnum.<BlockBed.EnumPartType>create("part", BlockBed.EnumPartType.class);
-    public static final PropertyBool OCCUPIED = PropertyBool.create("occupied");
-    
-    protected String name;
-    private SoundType type;
-    
-    public BlockModBed(String name, String local)
-    {
-        super(Material.CLOTH);
-        this.setDefaultState(this.blockState.getBaseState().withProperty(PART, BlockBed.EnumPartType.FOOT)
-                        .withProperty(OCCUPIED, false));
-        this.hasTileEntity = true;
-        
-        this.name = name;
-        this.setRegistryName(name);
-        super.setUnlocalizedName(local);
-        this.type = SoundType.CLOTH;
-        super.setHardness(0.2F);
-        super.disableStats();
-    }
+    private final VoxelShape shape;
 
-    @Override
-    public final BlockModBed setSoundType(SoundType sound) 
+    public BlockModBed(String name, Block.Properties builder, double high)
     {
-        this.type = sound;
-        return this;
+        super(DyeColor.BLACK, builder);
+        super.setRegistryName(name);
+        shape = Block.makeCuboidShape(0.0, 0.0, 0.0, 16.0, high, 16.0);
+        this.setDefaultState(this.stateContainer.getBaseState().with(BedBlock.PART, BedPart.FOOT).with(BedBlock.OCCUPIED, false));
     }
 
     @Override
-    public final SoundType getSoundType(IBlockState state, World w, BlockPos pos, Entity ent) 
+    public MaterialColor getMaterialColor(BlockState state, IBlockReader w, BlockPos pos) 
     {
-        return type;
-    }     
+        return this.materialColor;
+    }
 
     @Override
-    public final boolean isBed(IBlockState state, IBlockAccess w, BlockPos pos, Entity p) 
-    {
-        return true;
-    }   
-    
-    public float getLayingHigh()
+    public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving)
     {
-        return 0.6875f;
+        // no tile entity needs to be removed
     }
 
     @Override
-    public MapColor getMapColor(IBlockState state, IBlockAccess w, BlockPos pos)
+    public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
     {
-        return MapColor.CLOTH;
+        return shape;
     }
 
     @Override
-    public boolean onBlockActivated(World w, BlockPos pos, IBlockState state, EntityPlayer p, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
+    public BlockRenderType getRenderType(BlockState state)
     {
-        if(w.isRemote)
-        {
-            return true;
-        }
-        else
-        {
-            if(state.getValue(PART) != BlockBed.EnumPartType.HEAD)
-            {
-                pos = pos.offset(state.getValue(FACING));
-                state = w.getBlockState(pos);
-                if(state.getBlock() != this)
-                {
-                    return true;
-                }
-            }
-
-            if(w.provider.canRespawnHere() && w.getBiome(pos) != Biomes.HELL)
-            {
-                if((state.getValue(OCCUPIED)))
-                {
-                    EntityPlayer entityplayer = this.getPlayerInBed(w, pos);
-                    if(entityplayer != null)
-                    {
-                        p.sendStatusMessage(new TextComponentTranslation("tile.bed.occupied", new Object[0]), true);
-                        return true;
-                    }
-                    state = state.withProperty(OCCUPIED, false);
-                    w.setBlockState(pos, state, 4);
-                }
-
-                EntityPlayer.SleepResult sleep = p.trySleep(pos);
-                if(sleep == EntityPlayer.SleepResult.OK)
-                {
-                    state = state.withProperty(OCCUPIED, true);
-                    // set players real position
-                    // subtracting normal bedsize, adding custom
-                    p.setPosition(p.posX, p.posY - 0.4375f + getLayingHigh(), p.posZ);
-                    // this is for evil servers which render the position wrong
-                    if(p instanceof EntityPlayerMP)
-                    {
-                        ((EntityPlayerMP) p).connection.setPlayerLocation(p.posX, p.posY, p.posZ, p.rotationYaw, p.rotationPitch);
-                    }
-                    // end
-                    w.setBlockState(pos, state, 4);
-                    return true;
-                }
-                else
-                {
-                    switch (sleep) 
-                    {
-                        case NOT_POSSIBLE_NOW:
-                            p.sendStatusMessage(new TextComponentTranslation("tile.bed.noSleep", new Object[0]), true);
-                            break;
-                        case NOT_SAFE:
-                            p.sendStatusMessage(new TextComponentTranslation("tile.bed.notSafe", new Object[0]), true);
-                            break;
-                        case TOO_FAR_AWAY:
-                            p.sendStatusMessage(new TextComponentTranslation("tile.bed.tooFarAway", new Object[0]), true);
-                            break;
-                    }
-                    return true;
-                }
-            }
-            else
-            {
-                w.setBlockToAir(pos);
-                BlockPos blockpos = pos.offset(state.getValue(FACING).getOpposite());
-                if(w.getBlockState(blockpos).getBlock() == this)
-                {
-                    w.setBlockToAir(blockpos);
-                }
-                w.newExplosion(null, pos.getX() + 0.5d, pos.getY() + 0.5d, pos.getZ() + 0.5d, 5, true, true);
-                return true;
-            }
-        }
+        return BlockRenderType.MODEL;
     }
 
-    @Nullable
-    private EntityPlayer getPlayerInBed(World w, BlockPos pos)
+    @Override
+    public TileEntity createNewTileEntity(IBlockReader worldIn)
     {
-        for(EntityPlayer p : w.playerEntities)
-        {
-            if (p.isPlayerSleeping() && p.bedLocation.equals(pos))
-            {
-                return p;
-            }
-        }
         return null;
     }
 
     @Override
-    public boolean isFullCube(IBlockState state)
+    public boolean hasTileEntity(BlockState state)
     {
         return false;
     }
 
     @Override
-    public boolean isOpaqueCube(IBlockState state)
+    public boolean hasTileEntity()
     {
         return false;
     }
-
-    @Override
-    public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance)
-    {
-        super.onFallenUpon(worldIn, pos, entityIn, fallDistance * 0.5F);
-    }
-
-    @Override
-    public void onLanded(World w, Entity ent)
-    {
-        if(ent.isSneaking())
-        {
-            super.onLanded(w, ent);
-        }
-        else if(ent.motionY < 0)
-        {
-            ent.motionY = -ent.motionY * 0.66d;
-
-            if(!(ent instanceof EntityLivingBase))
-            {
-                ent.motionY *= 0.8d;
-            }
-        }
-    }
-
-    @Override
-    public void neighborChanged(IBlockState state, World w, BlockPos pos, Block blockIn, BlockPos fromPos)
-    {
-        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
-
-        if(state.getValue(PART) == BlockBed.EnumPartType.FOOT)
-        {
-            if(w.getBlockState(pos.offset(enumfacing)).getBlock() != this)
-            {
-                w.setBlockToAir(pos);
-            }
-        }
-        else if(w.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock() != this)
-        {
-            if(!w.isRemote)
-            {
-                this.dropBlockAsItem(w, pos, state, 0);
-            }
-            w.setBlockToAir(pos);
-        }
-    }
-
-    @Override
-    public abstract AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos);
-
-    @SideOnly(Side.CLIENT)
-    @Override
-    public boolean hasCustomBreakingProgress(IBlockState state)
-    {
-        return true;
-    }
-
-    @Nullable
-    public static BlockPos getSafeExitLocation(World w, BlockPos pos, int tries)
-    {
-        return net.minecraft.block.BlockBed.getSafeExitLocation(w, pos, tries);
-    }
-
-    @Override
-    public EnumPushReaction getMobilityFlag(IBlockState state)
-    {
-        return EnumPushReaction.DESTROY;
-    }
-
-    @SideOnly(Side.CLIENT)
-    @Override
-    public BlockRenderLayer getBlockLayer()
-    {
-        return BlockRenderLayer.CUTOUT;
-    }
-
-    @Override
-    public EnumBlockRenderType getRenderType(IBlockState state)
-    {
-        return EnumBlockRenderType.MODEL;
-    }
-
-    @Override
-    public void onBlockHarvested(World w, BlockPos pos, IBlockState state, EntityPlayer player)
-    {
-        if(player.capabilities.isCreativeMode && 
-                state.getValue(PART) == BlockBed.EnumPartType.FOOT)
-        {
-            BlockPos blockpos = pos.offset((EnumFacing)state.getValue(FACING));
-            if(w.getBlockState(blockpos).getBlock() == this)
-            {
-                w.setBlockToAir(blockpos);
-            }
-        }
-    }
-
-    @Override
-    public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack)
-    {
-        super.harvestBlock(worldIn, player, pos, state, null, stack);
-    }
-
-    @Override
-    public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
-    {
-        super.breakBlock(worldIn, pos, state);
-    }
-
-    @Override
-    public IBlockState getStateFromMeta(int meta)
-    {
-        EnumFacing f = EnumFacing.getHorizontal(meta);
-        return (meta & 8) > 0 ? this.getDefaultState()
-                .withProperty(PART, BlockBed.EnumPartType.HEAD)
-                .withProperty(FACING, f)
-                .withProperty(OCCUPIED, (meta & 4) > 0) : 
-                this.getDefaultState().withProperty(PART, BlockBed.EnumPartType.FOOT)
-                        .withProperty(FACING, f);
-    }
-
-    @Override
-    public IBlockState getActualState(IBlockState state, IBlockAccess w, BlockPos pos)
-    {
-        if(state.getValue(PART) == BlockBed.EnumPartType.FOOT)
-        {
-            IBlockState iblockstate = w.getBlockState(pos.offset(state.getValue(FACING)));
-            if(iblockstate.getBlock() == this)
-            {
-                state = state.withProperty(OCCUPIED, iblockstate.getValue(OCCUPIED));
-            }
-        }
-        return state;
-    }
-
-    @Override
-    public IBlockState withRotation(IBlockState state, Rotation rot)
-    {
-        return state.withProperty(FACING, rot.rotate(state.getValue(FACING)));
-    }
-
-    @Override
-    public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
-    {
-        return state.withRotation(mirrorIn.toRotation(state.getValue(FACING)));
-    }
-
-    @Override
-    public int getMetaFromState(IBlockState state)
-    {
-        int i = 0;
-        i = i | (state.getValue(FACING)).getHorizontalIndex();
-        if(state.getValue(PART) == BlockBed.EnumPartType.HEAD)
-        {
-            i |= 8;
-            if (state.getValue(OCCUPIED))
-            {
-                i |= 4;
-            }
-        }
-        return i;
-    }
-
-    @Override
-    public BlockFaceShape getBlockFaceShape(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
-    {
-        return BlockFaceShape.UNDEFINED;
-    }
-
-    @Override
-    protected BlockStateContainer createBlockState()
-    {
-        return new BlockStateContainer(this, new IProperty[] {FACING, PART, OCCUPIED});
-    }
-
-    @SideOnly(Side.CLIENT)
-    public static boolean isHeadPiece(int metadata)
-    {
-        return (metadata & 8) != 0;
-    }
 }

+ 17 - 0
src/main/java/me/km/blocks/BlockModSapling.java

@@ -0,0 +1,17 @@
+package me.km.blocks;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.SaplingBlock;
+import net.minecraft.block.SoundType;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.trees.Tree;
+
+// this class just exists because the SaplingBlock constructor is protected
+public class BlockModSapling extends SaplingBlock
+{
+    public BlockModSapling(Tree tree)
+    {
+        super(tree, Block.Properties.create(Material.PLANTS).doesNotBlockMovement()
+                .tickRandomly().hardnessAndResistance(0.0f, 0.0f).sound(SoundType.PLANT));
+    }
+}

+ 0 - 110
src/main/java/me/km/blocks/BlockModSlab.java

@@ -1,110 +0,0 @@
-package me.km.blocks;
-
-import me.km.KajetansMod;
-import net.minecraft.block.BlockSlab;
-import static net.minecraft.block.BlockSlab.HALF;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.IProperty;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-public class BlockModSlab extends BlockSlab implements IBlockBase
-{
-    protected String name;
-    
-    public BlockModSlab(Material material, String name, String local)
-    {
-        super(material);
-        this.name = name;
-        this.setRegistryName(name);
-        super.setUnlocalizedName(local);
-        super.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
-        
-        this.setDefaultState(this.blockState.getBaseState().withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM));
-        super.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
-        super.useNeighborBrightness = true;
-    }
-    
-    @Override
-    public void registerItemModel(Item itemBlock) 
-    {
-        KajetansMod.proxy.registerItemRenderer(itemBlock, 0, name);
-    }
-    
-    @Override
-    public BlockModSlab setSoundType(SoundType sound) 
-    {
-        super.setSoundType(sound);
-        return this;
-    }
-
-    @Override
-    public IBlockState getStateFromMeta(int meta)
-    {
-        IBlockState iblockstate = this.getDefaultState();
-        if(!this.isDouble())
-        {
-            iblockstate = iblockstate.withProperty(HALF, (meta & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP);
-        }
-        return iblockstate;
-    }
-
-    @Override
-    public int getMetaFromState(IBlockState state)
-    {
-        int i = 0;
-        if(state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP)
-        {
-            i |= 8;
-        }
-        return i;
-    }
-
-    @Override
-    protected BlockStateContainer createBlockState()
-    {
-        if(this.isDouble())
-        {
-            return new BlockStateContainer(this);
-        }
-        return new BlockStateContainer(this, new IProperty[] {HALF});
-    }
-
-    @Override
-    public IProperty<?> getVariantProperty()
-    {
-        return null;
-    }
-
-    @Override
-    public Comparable<?> getTypeForItem(ItemStack stack)
-    {
-        return null;
-    }
-
-    @Override
-    public String getUnlocalizedName(int meta) 
-    {
-        return super.getUnlocalizedName();
-    }
-    
-    @Override
-    public boolean isDouble()
-    {
-        return false;
-    }
-    
-    @SideOnly(Side.CLIENT)
-    @Override
-    public BlockRenderLayer getBlockLayer()
-    {
-        return BlockRenderLayer.CUTOUT;
-    }
-}

+ 0 - 13
src/main/java/me/km/blocks/BlockOre.java

@@ -1,13 +0,0 @@
-package me.km.blocks;
-
-import net.minecraft.block.material.Material;
-
-public class BlockOre extends BlockBase
-{
-    public BlockOre(String name, String local) 
-    {
-        super(Material.ROCK, name, local);
-        super.setHardness(3.0f);
-        super.setResistance(5.0f); 
-    }
-}

+ 13 - 140
src/main/java/me/km/blocks/BlockResistantTallGrass.java

@@ -1,159 +1,32 @@
 package me.km.blocks;
 
-import java.util.Random;
-import javax.annotation.Nullable;
-import me.km.items.ModItems;
-import static net.minecraft.block.Block.NULL_AABB;
+import net.minecraft.block.Block;
 import net.minecraft.block.SoundType;
+import net.minecraft.block.TallGrassBlock;
 import net.minecraft.block.material.Material;
-import net.minecraft.block.state.BlockFaceShape;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.stats.StatList;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.AxisAlignedBB;
+import net.minecraft.block.BlockState;
 import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.IShearable;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraft.world.IBlockReader;
+import net.minecraft.world.IWorldReader;
 
-public class BlockResistantTallGrass extends BlockBase implements net.minecraftforge.common.IPlantable, IShearable
+public class BlockResistantTallGrass extends TallGrassBlock
 {
-    protected static final AxisAlignedBB TALL_GRASS_AABB = new AxisAlignedBB(0.1d, 0.0d, 0.1d, 0.9d, 0.8d, 0.9d);
-    
-    public BlockResistantTallGrass(String name, String local) 
+    public BlockResistantTallGrass(String registry)
     {
-        super(Material.VINE, name, local);
-        super.setCreativeTab(CreativeTabs.DECORATIONS);
-        super.setSoundType(SoundType.PLANT);
-        super.setHardness(0);
+        super(Block.Properties.create(Material.TALL_PLANTS).doesNotBlockMovement()
+                .hardnessAndResistance(0.0f, 0.0f).sound(SoundType.PLANT));
+        super.setRegistryName(registry);
     }
 
     @Override
-    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
-    {
-        return TALL_GRASS_AABB;
-    }
-
-    @Nullable
-    @Override
-    public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
-    {
-        return NULL_AABB;
-    }
-
-    @Override
-    public boolean isOpaqueCube(IBlockState state)
-    {
-        return false;
-    }
-
-    @Override
-    public boolean isFullCube(IBlockState state)
-    {
-        return false;
-    }
-
-    @Override
-    public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
-    {
-        return net.minecraftforge.common.EnumPlantType.Plains;
-    }
-
-    @Override
-    public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
-    {
-        IBlockState state = world.getBlockState(pos);
-        if(state.getBlock() != this) 
-        {
-            return getDefaultState();
-        }
-        return state;
-    }
-
-    @SideOnly(Side.CLIENT)
-    @Override
-    public BlockRenderLayer getBlockLayer()
-    {
-        return BlockRenderLayer.CUTOUT;
-    }
-
-    @Override
-    public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
-    {
-        return BlockFaceShape.UNDEFINED;
-    }
-
-    @Override
-    public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos)
+    protected boolean isValidGround(BlockState state, IBlockReader worldIn, BlockPos pos)
     {
         return true;
     }
 
     @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
+    public boolean isValidPosition(BlockState state, IWorldReader w, BlockPos pos)
     {
-        return null;
-    }
-
-    @Override
-    public int quantityDroppedWithBonus(int fortune, Random random)
-    {
-        return 1 + random.nextInt(fortune * 2 + 1);
-    }
-
-    @Override
-    public void harvestBlock(World w, EntityPlayer p, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack)
-    {
-        if(!w.isRemote && stack.getItem() == Items.SHEARS)
-        {
-            p.addStat(StatList.getBlockStats(this));
-            spawnAsEntity(w, pos, new ItemStack(ModBlocks.tallGrass, 1));
-        }
-        else
-        {
-            super.harvestBlock(w, p, pos, state, te, stack);
-        }
-    }
-
-    @Override 
-    public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
-    {
-        return true; 
-    }
-    
-    @Override
-    public NonNullList<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
-    {
-        return NonNullList.withSize(1, new ItemStack(ModBlocks.tallGrass, 1));
-    }
-    
-    @Override
-    public NonNullList<ItemStack> getDrops(IBlockAccess w, BlockPos pos, IBlockState state, int fortune)
-    {
-        int rand = RANDOM.nextInt(8);
-        if(rand <= 3)
-        {
-            return NonNullList.withSize(1, new ItemStack(ModItems.hayBundle));
-        }
-        else if(RANDOM.nextInt(8) == 4) 
-        {
-            ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(RANDOM, fortune);
-            if(!seed.isEmpty())
-            {
-                return NonNullList.withSize(1, seed);
-            }
-        }
-        return NonNullList.create();
+        return true;
     }
 }

+ 0 - 114
src/main/java/me/km/blocks/BlockSpikeTrap.java

@@ -1,114 +0,0 @@
-package me.km.blocks;
-
-import java.util.Random;
-import me.km.KajetansMod;
-import net.minecraft.block.SoundType;
-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.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.Entity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.DamageSource;
-import net.minecraft.util.NonNullList;
-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;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-public class BlockSpikeTrap extends BlockTrap
-{
-    // everything inspired by BlockWoodSlab
-    public static final PropertyEnum<EnumMetals> VARIANT = PropertyEnum.<EnumMetals>create("variant", EnumMetals.class);
-       
-    public BlockSpikeTrap(Material material, String name, String local) 
-    {
-        super(material, name, local);
-        super.setSoundType(SoundType.METAL);
-        super.setHardness(5);
-        super.setResistance(10);
-        super.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, EnumMetals.COPPER));
-    }
-    
-    @Override
-    public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) 
-    {
-        return BOX;
-    }
-
-    @Override
-    public void onEntityCollidedWithBlock(World w, BlockPos pos, IBlockState state, Entity ent) 
-    {
-        if(!ent.isSneaking())
-        {
-            ent.attackEntityFrom(DamageSource.CACTUS, 1);
-        }
-    }
-
-    @Override
-    public void registerItemModel(Item itemBlock) 
-    {
-        for(EnumMetals metal : EnumMetals.values())
-        {
-            KajetansMod.proxy.registerItemRenderer(itemBlock, metal.getMetadata(), name, "variant=" + metal.getName());
-        }
-    }
-    
-    @Override
-    public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
-    {
-        return state.getValue(VARIANT).getMapColor();
-    }
-    
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return Item.getItemFromBlock(ModBlocks.spikes);
-    }
-
-    @Override
-    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
-    {
-        return new ItemStack(ModBlocks.spikes, 1, state.getValue(VARIANT).getMetadata());
-    }   
-    
-    @SideOnly(Side.CLIENT)
-    @Override
-    public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list)
-    {
-        for(EnumMetals metal : EnumMetals.values())
-        {
-            list.add(new ItemStack(this, 1, metal.getMetadata()));
-        }
-    }
-
-    @Override
-    public IBlockState getStateFromMeta(int meta)
-    {
-        return this.getDefaultState().withProperty(VARIANT, EnumMetals.byMetadata(meta));
-    }
-
-    @Override
-    public int getMetaFromState(IBlockState state)
-    {
-        return state.getValue(VARIANT).getMetadata();
-    }
-
-    @Override
-    protected BlockStateContainer createBlockState()
-    {
-        return new BlockStateContainer(this, new IProperty[] {VARIANT});
-    }
-
-    @Override
-    public int damageDropped(IBlockState state)
-    {
-        return state.getValue(VARIANT).getMetadata();
-    }
-}

+ 73 - 0
src/main/java/me/km/blocks/BlockSpikes.java

@@ -0,0 +1,73 @@
+package me.km.blocks;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.entity.Entity;
+import net.minecraft.util.BlockRenderLayer;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.Direction;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.shapes.ISelectionContext;
+import net.minecraft.util.math.shapes.VoxelShape;
+import net.minecraft.world.IBlockReader;
+import net.minecraft.world.IWorld;
+import net.minecraft.world.IWorldReader;
+import net.minecraft.world.World;
+
+public class BlockSpikes extends Block
+{
+    private static final VoxelShape SHAPE = Block.makeCuboidShape(0.0, 0.0, 0.0, 16.0, 1.0, 16.0);
+
+    public BlockSpikes(String name, Properties properties)
+    {
+        super(properties);
+        super.setRegistryName(name);
+    }
+
+    @Override
+    public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
+    {
+        return SHAPE;
+    }
+
+    @Override
+    public boolean isValidPosition(BlockState state, IWorldReader w, BlockPos pos)
+    {
+        return func_220064_c(w, pos.down()); // from RedstoneDiodeBlock
+    }
+
+    @Override
+    public void onEntityCollision(BlockState state, World w, BlockPos pos, Entity ent)
+    {
+        if(!ent.isSneaking())
+        {
+            ent.attackEntityFrom(DamageSource.CACTUS, 1.0F);
+        }
+    }
+
+    @Override
+    public boolean isSolid(BlockState state)
+    {
+        return false;
+    }
+
+    @Override
+    public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos)
+    {
+        return false;
+    }
+
+    @Override
+    public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld w, BlockPos currentPos, BlockPos facingPos)
+    {
+        return !stateIn.isValidPosition(w, currentPos) ? Blocks.AIR.getDefaultState() : 
+                super.updatePostPlacement(stateIn, facing, facingState, w, currentPos, facingPos);
+    }
+
+    @Override
+    public BlockRenderLayer getRenderLayer()
+    {
+        return BlockRenderLayer.CUTOUT;
+    }
+}

+ 0 - 47
src/main/java/me/km/blocks/BlockTallGrass.java

@@ -1,47 +0,0 @@
-package me.km.blocks;
-
-import me.km.items.ModItems;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-public class BlockTallGrass extends net.minecraft.block.BlockTallGrass
-{
-    private final SoundType type;
-    
-    public BlockTallGrass()
-    {
-        super.setHardness(0);
-        type = SoundType.PLANT;
-    }
-
-    @Override
-    public SoundType getSoundType(IBlockState state, World world, BlockPos pos, Entity entity) 
-    {
-        return type;
-    }
-    
-    @Override
-    public NonNullList<ItemStack> getDrops(IBlockAccess w, BlockPos pos, IBlockState state, int fortune)
-    {
-        int rand = RANDOM.nextInt(8);
-        if(rand <= 3)
-        {
-            return NonNullList.withSize(1, new ItemStack(ModItems.hayBundle));
-        }
-        else if(RANDOM.nextInt(8) == 4) 
-        {
-            ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(RANDOM, fortune);
-            if(!seed.isEmpty())
-            {
-                return NonNullList.withSize(1, seed);
-            }
-        }
-        return NonNullList.create();
-    }
-}

+ 0 - 82
src/main/java/me/km/blocks/BlockTrap.java

@@ -1,82 +0,0 @@
-package me.km.blocks;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-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.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-public class BlockTrap extends BlockBase
-{
-    protected static final AxisAlignedBB BOX = new AxisAlignedBB(0, 0, 0, 1, 0.0625d, 1);
-    
-    public BlockTrap(Material material, String name, String local) 
-    {
-        super(material, name, local);
-    }  
-    
-    @Override
-    public void neighborChanged(IBlockState state, World w, BlockPos pos, Block b, BlockPos fromPos)
-    {
-        if(!w.getBlockState(pos.down()).getMaterial().isSolid())
-        {
-            this.dropBlockAsItem(w, pos, state, 0);
-            w.setBlockToAir(pos);
-        }
-        super.neighborChanged(state, w, pos, b, fromPos);
-    }
-    
-    @Override
-    public boolean canPlaceBlockAt(World w, BlockPos pos)
-    {
-        return w.getBlockState(pos.down()).getMaterial().isSolid() && super.canPlaceBlockAt(w, pos);
-    }
-
-    @Override
-    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) 
-    {
-        return BOX;
-    }
-
-    @Override
-    public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) 
-    {
-        return NULL_AABB;
-    }
-    
-    @Override
-    public boolean isOpaqueCube(IBlockState state)
-    {
-        return false;
-    }
-
-    @Override
-    public boolean isFullCube(IBlockState state)
-    {
-        return false;
-    }
-    
-    @Override
-    public boolean canSpawnInBlock()
-    {
-        return false;
-    }
-    
-    @SideOnly(Side.CLIENT)
-    @Override
-    public BlockRenderLayer getBlockLayer()
-    {
-        return BlockRenderLayer.CUTOUT;
-    }
-    
-    @Override
-    public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
-    {
-        return true;
-    }
-}

+ 0 - 89
src/main/java/me/km/blocks/EnumMetals.java

@@ -1,89 +0,0 @@
-package me.km.blocks;
-
-import me.km.items.ModItems;
-import net.minecraft.block.material.MapColor;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.util.IStringSerializable;
-
-public enum EnumMetals implements IStringSerializable
-{
-    COPPER(0, "copper", MapColor.BROWN, ModItems.copperIngot),
-    TIN(1, "tin", MapColor.SILVER, ModItems.tinIngot),
-    BRONZE(2, "bronze", MapColor.YELLOW, ModItems.bronzeIngot),
-    GOLD(3, "gold", MapColor.GOLD, Items.GOLD_INGOT),
-    IRON(4, "iron", MapColor.IRON, Items.IRON_INGOT),
-    SILVER(5, "silver", MapColor.SILVER, ModItems.silverIngot);
-
-    private static final EnumMetals[] META_LOOKUP = new EnumMetals[values().length];
-    private final int meta;
-    private final String name;
-    private final MapColor mapColor;
-    private Item item;
-
-    private EnumMetals(int meta, String name, MapColor mapColor, Item item)
-    {
-        this.meta = meta;
-        this.name = name;
-        this.mapColor = mapColor;
-        this.item = item;
-    }
-
-    public Item getMetalIngot() 
-    {
-        return item;
-    }
-    
-    // items become null somehow
-    public static void fixMetalIngots() 
-    {
-        COPPER.item = ModItems.copperIngot;
-        TIN.item = ModItems.tinIngot;
-        BRONZE.item = ModItems.bronzeIngot;
-        SILVER.item = ModItems.silverIngot;
-    }
-    
-    public int getMetadata()
-    {
-        return this.meta;
-    }
-
-    public MapColor getMapColor()
-    {
-        return this.mapColor;
-    }
-
-    @Override
-    public String toString()
-    {
-        return this.name;
-    }
-
-    public static EnumMetals byMetadata(int meta)
-    {
-        if (meta < 0 || meta >= META_LOOKUP.length)
-        {
-            meta = 0;
-        }
-        return META_LOOKUP[meta];
-    }
-
-    @Override
-    public String getName()
-    {
-        return this.name;
-    }
-
-    public String getUnlocalizedName()
-    {
-        return this.name;
-    }
-
-    static
-    {
-        for(EnumMetals metal : values())
-        {
-            META_LOOKUP[metal.getMetadata()] = metal;
-        }
-    }
-}

+ 0 - 10
src/main/java/me/km/blocks/IBlockBase.java

@@ -1,10 +0,0 @@
-package me.km.blocks;
-
-import net.minecraft.block.SoundType;
-import net.minecraft.item.Item;
-
-public interface IBlockBase 
-{
-    public void registerItemModel(Item itemBlock);
-    public IBlockBase setSoundType(SoundType sound);
-}

+ 160 - 149
src/main/java/me/km/blocks/ModBlocks.java

@@ -1,239 +1,250 @@
 package me.km.blocks;
 
-import me.km.blocks.cookingpot.TileEntityCookingPot;
-import me.km.blocks.campfire.TileEntityCampFire;
-import me.km.blocks.campfire.BlockCampFireBurning;
-import me.km.blocks.campfire.BlockCampFire;
-import me.km.blocks.campfire.BlockCampFireBurnt;
 import me.km.blocks.cookingpot.BlockCookingPot;
-import me.km.blocks.leaves.*;
-import me.km.fluids.BlockFluidBase;
-import me.km.fluids.BlockFluidHoney;
-import me.km.fluids.BlockFluidPoison;
-import me.km.fluids.ModFluids;
-import me.km.items.ItemMetal;
 import net.minecraft.block.Block;
-import net.minecraft.block.BlockPlanks;
+import net.minecraft.block.Block.Properties;
+import net.minecraft.block.SlabBlock;
 import net.minecraft.block.SoundType;
-import net.minecraft.block.material.MapColor;
 import net.minecraft.block.material.Material;
+import net.minecraft.block.material.MaterialColor;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.block.LeavesBlock;
 import net.minecraft.item.Item;
-import net.minecraft.item.ItemBlock;
-import net.minecraftforge.fml.common.registry.GameRegistry;
+import net.minecraft.item.BlockItem;
+import net.minecraft.item.ItemGroup;
 import net.minecraftforge.registries.IForgeRegistry;
 
 public class ModBlocks 
 {
     // ores + blocks
-    public static BlockOre copperOre;
-    public static BlockBase copperBlock;
+    public static Block copperOre;
+    public static Block copperBlock;
     
-    public static BlockOre tinOre;
-    public static BlockBase tinBlock;
+    public static Block tinOre;
+    public static Block tinBlock;
     
-    public static BlockBase bronzeBlock;
+    public static Block bronzeBlock;
     
-    public static BlockOre silverOre;
-    public static BlockBase silverBlock;
+    public static Block silverOre;
+    public static Block silverBlock;
         
     // misc
-    public static BlockBase guildblock;
-    public static BlockBase artefact;
-    public static BlockHay realHayBlock;
-    public static BlockHayBed realHayBed;
+    public static Block guildblock;
+    public static Block artefact;
+    public static Block realHayBlock;
+    public static Block realHayBed;
     
-    public static BlockCrate crateAcacia;
-    public static BlockCrate crateBigOak;
-    public static BlockCrate crateBirch;
-    public static BlockCrate crateJungle;
-    public static BlockCrate crateOak;
-    public static BlockCrate crateSpruce;
+    public static Block crateAcacia;
+    public static Block crateBigOak;
+    public static Block crateBirch;
+    public static Block crateJungle;
+    public static Block crateOak;
+    public static Block crateSpruce;
     
-    public static BlockCookingPot cookingPotCopper;
+    public static Block cookingPotCopper;
     
-    public static BlockBase barrel;
+    public static Block lantern;
     
-    public static BlockCampFireBurning campFireBurning;
-    public static BlockCampFireBurnt campFireBurnt;
-    
-    public static BlockLantern lantern;
-    
-    public static BlockResistantTallGrass tallGrass;
+    public static Block tallGrass;
     
     // traps
-    public static BlockSpikeTrap spikes;
+    public static Block spikesCopper;
+    public static Block spikesBronze;
+    public static Block spikesGold;
+    public static Block spikesIron;
     
     // fluids
-    public static BlockFluidPoison poison;
-    public static BlockFluidHoney honey;
+    public static Block poison;
+    public static Block honey;
     
     // slabs
-    public static BlockModSlab gravelSlab;
+    public static Block gravelSlab;
     
     // leaves
-    public static BlockLeaves cherryLeaves;
-    public static BlockLeaves apricotLeaves;
-    public static BlockLeaves pearLeaves;
-    public static BlockLeaves plumLeaves;
+    public static Block cherryLeaves;
+    public static Block apricotLeaves;
+    public static Block pearLeaves;
+    public static Block plumLeaves;
     
     // saplings
-    public static BlockSapling cherrySapling;
-    public static BlockSapling apricotSapling;
-    public static BlockSapling pearSapling;
-    public static BlockSapling plumSapling;
+    public static Block cherrySapling;
+    public static Block apricotSapling;
+    public static Block pearSapling;
+    public static Block plumSapling;
+    
+    private static Block create(String registry, Material m, float hardness, float resistance)
+    {
+        Block b = new Block(Properties.create(m).hardnessAndResistance(hardness, resistance));
+        b.setRegistryName(registry);
+        return b;
+    }
+    
+    private static Block createCrate(String registry)
+    {
+        Block b = new Block(Properties.create(Material.WOOD).hardnessAndResistance(2.0f, 5.0f).sound(SoundType.WOOD));
+        b.setRegistryName(registry);
+        return b;
+    }
+    
+    private static Block createOre(String registry)
+    {
+        Block b = new Block(Properties.create(Material.ROCK).hardnessAndResistance(3.0f, 3.0f));
+        b.setRegistryName(registry);
+        return b;
+    }
+    
+    private static Block createOreBlock(String registry, MaterialColor mc, float hardness, float resistance)
+    {
+        Block b = new Block(Properties.create(Material.IRON, mc).hardnessAndResistance(hardness, resistance));
+        b.setRegistryName(registry);
+        return b;
+    }
+    
+    private static Block createLeaves(String registry)
+    {
+        Block b = new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT));
+        b.setRegistryName(registry);
+        return b;
+    }
+    
+    private static Block createSapling(String registry, BlockState wood, BlockState leaves)
+    {
+        Block b = new BlockModSapling(new ModTree(wood, leaves));
+        b.setRegistryName(registry);
+        return b;
+    }
     
     public static void initBlocks(IForgeRegistry<Block> r) 
     {
         // ores + blocks
-        copperOre = register(r, new BlockOre("copper_ore", "oreCopper"));      
-        copperBlock = register(r, (BlockBase) new BlockBase(Material.IRON, "copper_block", "blockCopper")
-                .setMapColor(MapColor.BROWN).setHardness(3).setResistance(10));
-        tinOre = register(r, new BlockOre("tin_ore", "oreTin"));      
-        tinBlock = register(r, (BlockBase) new BlockBase(Material.IRON, "tin_block", "blockTin")
-                .setMapColor(MapColor.IRON).setHardness(3).setResistance(5));
-        bronzeBlock = register(r, (BlockBase) new BlockBase(Material.IRON, "bronze_block", "blockBronze")
-                .setMapColor(MapColor.YELLOW).setHardness(5).setResistance(10));
-        silverOre = register(r, new BlockOre("silver_ore", "oreSilver"));      
-        silverBlock = register(r, (BlockBase) new BlockBase(Material.IRON, "silver_block", "blockSilver")
-                .setMapColor(MapColor.IRON).setHardness(5).setResistance(10));
+        copperOre = register(r, createOre("copper_ore"));    
+        tinOre = register(r, createOre("tin_ore"));   
+        silverOre = register(r, createOre("silver_ore")); 
         
-        // misc
-        guildblock = register(r, (BlockBase) new BlockBase(Material.IRON, "guild_block", "blockGuild")
-                .setHardness(50.0F).setResistance(2000.0F));
-        artefact = register(r, (BlockBase) new BlockBase(Material.IRON, "artefact", "artefact")
-                .setHardness(50.0F).setResistance(2000.0F));
-        realHayBlock = register(r, new BlockHay("real_hay_block", "realHayBlock"));
-        realHayBed = register(r, new BlockHayBed("real_hay_bed", "realHayBed"));
-        
-        crateAcacia = register(r, new BlockCrate("crate_acacia", "crateAcacia"));
-        crateBigOak = register(r, new BlockCrate("crate_big_oak", "crateBigOak"));
-        crateBirch = register(r, new BlockCrate("crate_birch", "crateBirch"));
-        crateJungle = register(r, new BlockCrate("crate_jungle", "crateJungle"));
-        crateOak = register(r, new BlockCrate("crate_oak", "crateOak"));
-        crateSpruce = register(r, new BlockCrate("crate_spruce", "crateSpruce"));
+        copperBlock = register(r, createOreBlock("copper_block", MaterialColor.BROWN, 3.0f, 6.0f));   
+        tinBlock = register(r, createOreBlock("tin_block", MaterialColor.IRON, 3.0f, 6.0f));
+        silverBlock = register(r, createOreBlock("silver_block", MaterialColor.IRON, 5.0f, 6.0f));
+        bronzeBlock = register(r, createOreBlock("bronze_block", MaterialColor.YELLOW, 5.0f, 6.0f));
         
-        cookingPotCopper = register(r, new BlockCookingPot("cooking_pot_copper", "cookingPotCopper"));
-        GameRegistry.registerTileEntity(TileEntityCookingPot.class, "km:cauldron");
+        // misc
+        guildblock = register(r, create("guild_block", Material.IRON, 50.0f, 2000.0f));
+        artefact = register(r, create("artefact", Material.IRON, 50.0f, 2000.0f));
+        realHayBlock = register(r, new BlockHay("real_hay_block"));
+        realHayBed = register(r, new BlockHayBed("real_hay_bed"));
         
-        barrel = register(r, (BlockBase) new BlockBase(Material.WOOD, "barrel", "barrel").setSoundType(SoundType.WOOD).setHardness(2.5f));
+        crateAcacia = register(r, createCrate("crate_acacia"));
+        crateBigOak = register(r, createCrate("crate_big_oak"));
+        crateBirch = register(r, createCrate("crate_birch"));
+        crateJungle = register(r, createCrate("crate_jungle"));
+        crateOak = register(r, createCrate("crate_oak"));
+        crateSpruce = register(r, createCrate("crate_spruce"));
         
-        campFireBurning = (BlockCampFireBurning) register(r, new BlockCampFireBurning("camp_fire_burning", "campFireBurning")).setLightLevel(1);
-        campFireBurnt = register(r, new BlockCampFireBurnt("camp_fire_burnt", "campFireBurnt"));
-        GameRegistry.registerTileEntity(TileEntityCampFire.class, campFireBurning.getRegistryName().toString());
+        cookingPotCopper = register(r, new BlockCookingPot("cooking_pot_copper"));
         
-        lantern = register(r, new BlockLantern("lantern", "lantern"));
+        lantern = register(r, new BlockLantern("lantern"));
         
-        tallGrass = register(r, new BlockResistantTallGrass("rtall_grass", "rtallGrass"));
+        tallGrass = register(r, new BlockResistantTallGrass("rtall_grass"));
         
         // traps
-        spikes = register(r, new BlockSpikeTrap(Material.IRON, "spikes", "spikes"));
-    
+        spikesCopper = register(r, new BlockSpikes("spikes_copper", Properties.create(Material.IRON, MaterialColor.BROWN).hardnessAndResistance(3.0f, 6.0f)));
+        spikesBronze = register(r, new BlockSpikes("spikes_bronze", Properties.create(Material.IRON, MaterialColor.YELLOW).hardnessAndResistance(5.0f, 6.0f)));
+        spikesGold = register(r, new BlockSpikes("spikes_gold", Properties.create(Material.IRON, MaterialColor.GOLD).hardnessAndResistance(3.0f, 6.0f)));
+        spikesIron = register(r, new BlockSpikes("spikes_iron", Properties.create(Material.IRON).hardnessAndResistance(5.0f, 6.0f)));
+        
         // fluids
-        poison = register(r, new BlockFluidPoison(ModFluids.poison, Material.WATER));
-        honey = register(r, new BlockFluidHoney(ModFluids.honey, Material.WATER));
+        poison = register(r, create("poison", Material.WATER, 0.0f, 0.0f));
+        honey = register(r, create("honey", Material.WATER, 0.0f, 0.0f));
         
         // slabs
-        gravelSlab = register(r, (BlockModSlab) new BlockModSlab(Material.SAND, "gravel_slab", "gravelSlab").setSoundType(SoundType.GROUND).setHardness(0.6F));
+        gravelSlab = register(r, new SlabBlock(Properties.create(Material.SAND, MaterialColor.STONE)
+                .sound(SoundType.GROUND).hardnessAndResistance(0.6f)).setRegistryName("gravel_slab"));
         
         // leaves
-        cherryLeaves = register(r, new BlockCherryLeaves("cherry_leaves", "cherryLeaves"));
-        apricotLeaves = register(r, new BlockApricotLeaves("apricot_leaves", "apricotLeaves"));
-        pearLeaves = register(r, new BlockPearLeaves("pear_leaves", "pearLeaves"));
-        plumLeaves = register(r, new BlockPlumLeaves("plum_leaves", "plumLeaves"));
+        cherryLeaves = register(r, createLeaves("cherry_leaves"));
+        apricotLeaves = register(r, createLeaves("apricot_leaves"));
+        pearLeaves = register(r, createLeaves("pear_leaves"));
+        plumLeaves = register(r, createLeaves("plum_leaves"));
         
         // saplings
-        cherrySapling = register(r, new BlockSapling("cherry_sapling", "cherrySapling", BlockPlanks.EnumType.OAK, cherryLeaves));
-        apricotSapling = register(r, new BlockSapling("apricot_sapling", "apricotSapling", BlockPlanks.EnumType.OAK, apricotLeaves));
-        pearSapling = register(r, new BlockSapling("pear_sapling", "pearSapling", BlockPlanks.EnumType.OAK, pearLeaves));
-        plumSapling = register(r, new BlockSapling("plum_sapling", "plumSapling", BlockPlanks.EnumType.OAK, plumLeaves));
+        cherrySapling = register(r, createSapling("cherry_sapling", Blocks.OAK_LOG.getDefaultState(), cherryLeaves.getDefaultState()));
+        apricotSapling = register(r, createSapling("apricot_sapling", Blocks.OAK_LOG.getDefaultState(), apricotLeaves.getDefaultState()));
+        pearSapling = register(r, createSapling("pear_sapling", Blocks.OAK_LOG.getDefaultState(), pearLeaves.getDefaultState()));
+        plumSapling = register(r, createSapling("plum_sapling", Blocks.OAK_LOG.getDefaultState(), plumLeaves.getDefaultState()));
     }
     
     public static void initItemBlocks(IForgeRegistry<Item> r) 
     {
         // ores + blocks
-        register(r, copperOre, getItemBlock(copperOre));
-        register(r, copperBlock, getItemBlock(copperBlock));
+        register(r, copperOre, getItemBlock(copperOre, ItemGroup.BUILDING_BLOCKS));
+        register(r, copperBlock, getItemBlock(copperBlock, ItemGroup.BUILDING_BLOCKS));
         
-        register(r, tinOre, getItemBlock(tinOre));
-        register(r, tinBlock, getItemBlock(tinBlock));
+        register(r, tinOre, getItemBlock(tinOre, ItemGroup.BUILDING_BLOCKS));
+        register(r, tinBlock, getItemBlock(tinBlock, ItemGroup.BUILDING_BLOCKS));
         
-        register(r, bronzeBlock, getItemBlock(bronzeBlock));
+        register(r, bronzeBlock, getItemBlock(bronzeBlock, ItemGroup.BUILDING_BLOCKS));
         
-        register(r, silverOre, getItemBlock(silverOre));
-        register(r, silverBlock, getItemBlock(silverBlock));
+        register(r, silverOre, getItemBlock(silverOre, ItemGroup.BUILDING_BLOCKS));
+        register(r, silverBlock, getItemBlock(silverBlock, ItemGroup.BUILDING_BLOCKS));
 
         // misc
-        register(r, guildblock, getItemBlock(guildblock));
-        register(r, artefact, getItemBlock(artefact));
-        
-        register(r, realHayBlock, getItemBlock(realHayBlock));
+        register(r, guildblock, getItemBlock(guildblock, ItemGroup.BUILDING_BLOCKS));
+        register(r, artefact, getItemBlock(artefact, ItemGroup.BUILDING_BLOCKS));
         
-        register(r, crateAcacia, getItemBlock(crateAcacia));
-        register(r, crateBigOak, getItemBlock(crateBigOak));
-        register(r, crateBirch, getItemBlock(crateBirch));
-        register(r, crateJungle, getItemBlock(crateJungle));
-        register(r, crateOak, getItemBlock(crateOak));
-        register(r, crateSpruce, getItemBlock(crateSpruce));
+        register(r, realHayBlock, getItemBlock(realHayBlock, ItemGroup.BUILDING_BLOCKS));
         
-        register(r, cookingPotCopper, getItemBlock(cookingPotCopper));
+        register(r, crateAcacia, getItemBlock(crateAcacia, ItemGroup.DECORATIONS));
+        register(r, crateBigOak, getItemBlock(crateBigOak, ItemGroup.DECORATIONS));
+        register(r, crateBirch, getItemBlock(crateBirch, ItemGroup.DECORATIONS));
+        register(r, crateJungle, getItemBlock(crateJungle, ItemGroup.DECORATIONS));
+        register(r, crateOak, getItemBlock(crateOak, ItemGroup.DECORATIONS));
+        register(r, crateSpruce, getItemBlock(crateSpruce, ItemGroup.DECORATIONS));
         
-        register(r, barrel, getItemBlock(barrel));
+        register(r, cookingPotCopper, getItemBlock(cookingPotCopper, ItemGroup.BREWING));
         
-        register(r, lantern, getItemBlock(lantern));
-        register(r, tallGrass, getItemBlock(tallGrass));
+        register(r, lantern, getItemBlock(lantern, ItemGroup.DECORATIONS));
+        register(r, tallGrass, getItemBlock(tallGrass, ItemGroup.DECORATIONS));
         
         // traps
-        register(r, spikes, getItemMetal(spikes));
+        register(r, spikesCopper, getItemBlock(spikesCopper, ItemGroup.DECORATIONS));
+        register(r, spikesBronze, getItemBlock(spikesBronze, ItemGroup.DECORATIONS));
+        register(r, spikesGold, getItemBlock(spikesGold, ItemGroup.DECORATIONS));
+        register(r, spikesIron, getItemBlock(spikesIron, ItemGroup.DECORATIONS));
         
         // fluids
-        register(r, poison, getItemBlock(poison));
-        register(r, honey, getItemBlock(honey));
+        register(r, poison, getItemBlock(poison, ItemGroup.BUILDING_BLOCKS));
+        register(r, honey, getItemBlock(honey, ItemGroup.BUILDING_BLOCKS));
         
         // slabs
-        register(r, gravelSlab, getItemBlock(gravelSlab));
+        register(r, gravelSlab, getItemBlock(gravelSlab, ItemGroup.BUILDING_BLOCKS));
         
         // leaves
-        register(r, cherryLeaves, getItemBlock(cherryLeaves));
-        register(r, apricotLeaves, getItemBlock(apricotLeaves));
-        register(r, pearLeaves, getItemBlock(pearLeaves));
-        register(r, plumLeaves, getItemBlock(plumLeaves));
+        register(r, cherryLeaves, getItemBlock(cherryLeaves, ItemGroup.BUILDING_BLOCKS));
+        register(r, apricotLeaves, getItemBlock(apricotLeaves, ItemGroup.BUILDING_BLOCKS));
+        register(r, pearLeaves, getItemBlock(pearLeaves, ItemGroup.BUILDING_BLOCKS));
+        register(r, plumLeaves, getItemBlock(plumLeaves, ItemGroup.BUILDING_BLOCKS));
         
         // saplings
-        register(r, cherrySapling, getItemBlock(cherrySapling));
-        register(r, apricotSapling, getItemBlock(apricotSapling));
-        register(r, pearSapling, getItemBlock(pearSapling));
-        register(r, plumSapling, getItemBlock(plumSapling));
+        register(r, cherrySapling, getItemBlock(cherrySapling, ItemGroup.BUILDING_BLOCKS));
+        register(r, apricotSapling, getItemBlock(apricotSapling, ItemGroup.BUILDING_BLOCKS));
+        register(r, pearSapling, getItemBlock(pearSapling, ItemGroup.BUILDING_BLOCKS));
+        register(r, plumSapling, getItemBlock(plumSapling, ItemGroup.BUILDING_BLOCKS));
     }
 
     private static void register(IForgeRegistry<Item> r, Block block, Item itemBlock) 
     {
         r.register(itemBlock);
-        if(block instanceof IBlockBase) 
-        {
-            ((IBlockBase) block).registerItemModel(itemBlock);
-        }
-        if(block instanceof BlockFluidBase) 
-        {
-            ((BlockFluidBase) block).registerBlockModel();
-        }
     }
     
-    private static <T extends Block> T register(IForgeRegistry<Block> r, T block) 
+    private static Block register(IForgeRegistry<Block> r, Block block) 
     {
         r.register(block);
         return block;
     }
 
-    private static ItemBlock getItemBlock(Block block) 
-    {
-        ItemBlock itemBlock = new ItemBlock(block);
-        itemBlock.setRegistryName(block.getRegistryName());
-        return itemBlock;
-    }
-    
-    private static ItemMetal getItemMetal(Block block) 
+    private static BlockItem getItemBlock(Block block, ItemGroup group) 
     {
-        ItemMetal itemBlock = new ItemMetal(block);
+        BlockItem itemBlock = new BlockItem(block, new Item.Properties().group(group));
         itemBlock.setRegistryName(block.getRegistryName());
         return itemBlock;
     }

+ 28 - 0
src/main/java/me/km/blocks/ModTree.java

@@ -0,0 +1,28 @@
+package me.km.blocks;
+
+import java.util.Random;
+import javax.annotation.Nullable;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.trees.Tree;
+import net.minecraft.world.gen.feature.AbstractTreeFeature;
+import net.minecraft.world.gen.feature.NoFeatureConfig;
+import net.minecraft.world.gen.feature.TreeFeature;
+
+public class ModTree extends Tree
+{
+    private final BlockState wood;
+    private final BlockState leaves;
+    
+    public ModTree(BlockState wood, BlockState leaves)
+    {
+        this.wood = wood;
+        this.leaves = leaves;
+    }
+    
+    @Nullable
+    @Override
+    protected AbstractTreeFeature<NoFeatureConfig> getTreeFeature(Random random)
+    {
+        return new TreeFeature(NoFeatureConfig::deserialize, true, 4, wood, leaves, false);
+    }
+}

+ 0 - 130
src/main/java/me/km/blocks/campfire/BlockCampFire.java

@@ -1,130 +0,0 @@
-package me.km.blocks.campfire;
-
-import java.util.Random;
-import me.km.blocks.BlockBase;
-import me.km.blocks.ModBlocks;
-import me.km.items.ModItems;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-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.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-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 net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-public class BlockCampFire extends BlockBase
-{
-    public static final AxisAlignedBB BOX = new AxisAlignedBB(0.0d, 0.0d, 0.0d, 1.0d, 0.4375d, 1.0d);
-    
-    public BlockCampFire(String name, String local) 
-    {
-        super(Material.FIRE, name, local);
-        super.setLightOpacity(0);
-        super.setHardness(1.5f);
-        super.setResistance(4);
-    }
-    
-    @Override
-    public boolean onBlockActivated(World w, BlockPos pos, IBlockState state, EntityPlayer p, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
-    {
-        if(w.isRemote)
-        {
-            return true;
-        }
-        else
-        {
-            w.setBlockState(pos, ModBlocks.campFireBurning.getDefaultState());
-            return true;
-        }
-    }
-
-    @Override
-    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
-    {
-        return BOX;
-    }
-
-    @Override
-    public boolean isOpaqueCube(IBlockState state)
-    {
-        return false;
-    }
-
-    @Override
-    public boolean isFullCube(IBlockState state)
-    {
-        return false;
-    }
-
-    @Override
-    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) 
-    {
-        return new ItemStack(ModItems.campFire);
-    }
-    
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return ModItems.campFire;
-    }
-    
-    @SideOnly(Side.CLIENT)
-    @Override
-    public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
-    {
-        return true;
-    }
-    
-    @SideOnly(Side.CLIENT)
-    @Override
-    public BlockRenderLayer getBlockLayer()
-    {
-        return BlockRenderLayer.CUTOUT;
-    }
-    
-    @Override
-    public EnumBlockRenderType getRenderType(IBlockState state)
-    {
-        return EnumBlockRenderType.MODEL;
-    }
-    
-    @Override
-    public boolean canPlaceBlockAt(World w, BlockPos pos)
-    {
-        return canBlockStay(w, pos) ? super.canPlaceBlockAt(w, pos) : false;
-    }
-
-    public boolean canBlockStay(World w, BlockPos pos)
-    {
-        return w.getBlockState(pos.down()).isTopSolid();
-    }
-
-    @Override
-    public void neighborChanged(IBlockState state, World w, BlockPos pos, Block b, BlockPos fromPos)
-    {
-        if(!this.canBlockStay(w, pos))
-        {
-            this.dropBlockAsItem(w, pos, state, 0);
-            w.setBlockToAir(pos);
-            for(EnumFacing enumfacing : EnumFacing.values())
-            {
-                w.notifyNeighborsOfStateChange(pos.offset(enumfacing), this, false);
-            }
-        }
-    }
-    
-    @Override
-    public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos)
-    {
-        return false;
-    }
-}

+ 0 - 112
src/main/java/me/km/blocks/campfire/BlockCampFireBurning.java

@@ -1,112 +0,0 @@
-package me.km.blocks.campfire;
-
-import java.util.Random;
-import me.km.blocks.ModBlocks;
-import me.km.inventory.ContainerCampFire;
-import net.minecraft.block.ITileEntityProvider;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.InventoryHelper;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.stats.StatList;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-public class BlockCampFireBurning extends BlockCampFire implements ITileEntityProvider
-{
-    public BlockCampFireBurning(String name, String local) 
-    {
-        super(name, local);
-        this.hasTileEntity = true;
-    }
-
-    @Override
-    public boolean eventReceived(IBlockState state, World w, BlockPos pos, int id, int param)
-    {
-        TileEntity tile = w.getTileEntity(pos);
-        return tile == null ? false : tile.receiveClientEvent(id, param);
-    }
-    
-    @Override
-    public boolean isBurning(IBlockAccess world, BlockPos pos) 
-    {
-        return true;
-    }
-    
-    @Override
-    public void onBlockClicked(World w, BlockPos pos, EntityPlayer p)
-    {
-        if(!w.isRemote)
-        {
-            w.setBlockState(pos, ModBlocks.campFireBurnt.getDefaultState());
-        }
-    }
-    
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return Items.STICK;
-    }
-    
-    @Override
-    public int quantityDropped(Random r) 
-    {
-        return r.nextInt(3) + 1;
-    }
-
-    @Override
-    public void getDrops(NonNullList<ItemStack> drops, IBlockAccess w, BlockPos pos, IBlockState state, int fortune)
-    {
-        super.getDrops(drops, w, pos, state, 0);
-        Random rand = w instanceof World ? ((World) w).rand : new Random();
-        if(rand.nextBoolean())
-        {
-            drops.add(new ItemStack(Items.COAL, 1, 1));
-        }
-    }
-    
-    @Override
-    public boolean onBlockActivated(World w, BlockPos pos, IBlockState state, EntityPlayer p, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
-    {
-        if(w.isRemote)
-        {
-            return true;
-        }
-        else
-        {
-            TileEntity tile = w.getTileEntity(pos);
-            if(tile != null && tile instanceof TileEntityCampFire)
-            {
-                ContainerCampFire container = new ContainerCampFire(p.inventory, (TileEntityCampFire) tile);
-                container.openForPlayer((EntityPlayerMP) p);
-                p.addStat(StatList.FURNACE_INTERACTION);
-            }
-            return true;
-        }
-    }
-
-    @Override
-    public TileEntity createNewTileEntity(World w, int meta)
-    {
-        return new TileEntityCampFire();
-    }
-
-    @Override
-    public void breakBlock(World w, BlockPos pos, IBlockState state)
-    {
-        TileEntity tile = w.getTileEntity(pos);
-        if(tile instanceof TileEntityCampFire)
-        {
-            InventoryHelper.dropInventoryItems(w, pos, (TileEntityCampFire) tile);
-        }
-        w.removeTileEntity(pos);
-    }
-}

+ 0 - 51
src/main/java/me/km/blocks/campfire/BlockCampFireBurnt.java

@@ -1,51 +0,0 @@
-package me.km.blocks.campfire;
-
-import java.util.Random;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-public class BlockCampFireBurnt extends BlockCampFire
-{
-    public BlockCampFireBurnt(String name, String local) 
-    {
-        super(name, local);
-    }
-    
-    @Override
-    public boolean onBlockActivated(World w, BlockPos pos, IBlockState state, EntityPlayer p, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
-    {
-        return false;
-    }
-    
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return Items.STICK;
-    }
-    
-    @Override
-    public int quantityDropped(Random r) 
-    {
-        return r.nextInt(3) + 1;
-    }
-
-    @Override
-    public void getDrops(NonNullList<ItemStack> drops, IBlockAccess w, BlockPos pos, IBlockState state, int fortune)
-    {
-        super.getDrops(drops, w, pos, state, 0);
-        Random rand = w instanceof World ? ((World) w).rand : new Random();
-        if(rand.nextBoolean())
-        {
-            drops.add(new ItemStack(Items.COAL, 1, 1));
-        }
-    }
-}

+ 0 - 300
src/main/java/me/km/blocks/campfire/TileEntityCampFire.java

@@ -1,300 +0,0 @@
-package me.km.blocks.campfire;
-
-import java.util.Arrays;
-import me.km.blocks.ModBlocks;
-import me.km.inventory.ContainerCampFire;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.ItemStackHelper;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntityLockable;
-import net.minecraft.util.ITickable;
-import net.minecraft.util.NonNullList;
-
-public class TileEntityCampFire extends TileEntityLockable implements ITickable
-{
-    private NonNullList<ItemStack> stacks = NonNullList.<ItemStack>withSize(6, ItemStack.EMPTY);
-    
-    private int burnTime;
-    
-    /** The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for */
-    private int[] cookTime;
-    private String furnaceCustomName;
-
-    public TileEntityCampFire()
-    {
-        this.cookTime = new int[3];
-        Arrays.fill(this.cookTime, 0);
-        this.furnaceCustomName = null;
-        this.burnTime = 9600;
-    }
-    
-    @Override
-    public int getSizeInventory()
-    {
-        return this.stacks.size();
-    }
-
-    @Override
-    public boolean isEmpty()
-    {
-        return !this.stacks.stream().anyMatch(stack -> !stack.isEmpty());
-    }
-    
-    @Override
-    public ItemStack getStackInSlot(int index)
-    {
-        return this.stacks.get(index);
-    }
-
-    @Override
-    public ItemStack decrStackSize(int index, int count)
-    {
-        return ItemStackHelper.getAndSplit(this.stacks, index, count);
-    }
-
-    @Override
-    public ItemStack removeStackFromSlot(int index)
-    {
-        return ItemStackHelper.getAndRemove(this.stacks, index);
-    }
-
-    @Override
-    public void setInventorySlotContents(int index, ItemStack stack)
-    {
-        ItemStack itemstack = this.stacks.get(index);
-        boolean flag = !stack.isEmpty() && stack.isItemEqual(itemstack) && ItemStack.areItemStackTagsEqual(stack, itemstack);
-        this.stacks.set(index, stack);
-        if(stack.getCount() > this.getInventoryStackLimit())
-        {
-            stack.setCount(this.getInventoryStackLimit());
-        }
-        if(index >= 0 && index <= 2 && !flag)
-        {
-            this.cookTime[index] = 0;
-            this.markDirty();
-        }
-    }
-
-    @Override
-    public String getName()
-    {
-        return this.hasCustomName() ? this.furnaceCustomName : "container.campfire";
-    }
-
-    @Override
-    public boolean hasCustomName()
-    {
-        return this.furnaceCustomName != null && !this.furnaceCustomName.isEmpty();
-    }
-
-    public void setCustomInventoryName(String name)
-    {
-        this.furnaceCustomName = name;
-    }
-
-    @Override
-    public void readFromNBT(NBTTagCompound com)
-    {
-        super.readFromNBT(com);
-        this.stacks = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY);
-        ItemStackHelper.loadAllItems(com, this.stacks);
-        this.burnTime = com.getInteger("BurnTime");
-        this.cookTime = com.getIntArray("CookTime");
-        if(com.hasKey("CustomName", 8))
-        {
-            this.furnaceCustomName = com.getString("CustomName");
-        }
-    }
-
-    @Override
-    public NBTTagCompound writeToNBT(NBTTagCompound compound)
-    {
-        super.writeToNBT(compound);
-        compound.setInteger("BurnTime", this.burnTime);
-        compound.setIntArray("CookTime", this.cookTime);
-        ItemStackHelper.saveAllItems(compound, this.stacks);
-        if(this.hasCustomName())
-        {
-            compound.setString("CustomName", this.furnaceCustomName);
-        }
-        return compound;
-    }
-
-    @Override
-    public int getInventoryStackLimit()
-    {
-        return 64;
-    }
-
-    public boolean isBurning()
-    {
-        return this.burnTime > 0;
-    }
-
-    @Override
-    public void update()
-    {       
-        if(!this.world.isRemote)
-        {
-            boolean update = false;
-            for(int i = 0; i < 3; i++)
-            {
-                ItemStack input = stacks.get(i);
-                if(!input.isEmpty())
-                {
-                    ItemStack output = stacks.get(i + 3);
-                    if(output.getCount() >= output.getMaxStackSize())
-                    {
-                        continue;
-                    }
-                    ItemStack result = getResult(input);
-                    if(result == ItemStack.EMPTY)
-                    {
-                        continue;
-                    }
-                    boolean empty = output.isEmpty();
-                    if(empty || output.isItemEqual(result))
-                    {
-                        this.cookTime[i]++;
-                        this.burnTime--;
-                        if(this.cookTime[i] >= 200)
-                        {
-                            this.cookTime[i] = 0;
-                            input.shrink(1);
-                            if(empty)
-                            {
-                                output = result;
-                                stacks.set(i + 3, output);
-                            }
-                            else
-                            {
-                                output.grow(1);
-                            }
-                            update = true;
-                        }
-                    }
-                }
-            }
-            if(this.burnTime < 0)
-            {
-                world.setBlockState(pos, ModBlocks.campFireBurnt.getDefaultState());
-            }
-            if(update)
-            {
-                this.markDirty();
-            }
-        }
-    }
-    
-    public ItemStack getResult(ItemStack stack)
-    {
-        Item item = stack.getItem();
-        Item result = null;
-        int dv = 0;
-        if(item == Items.PORKCHOP)
-        {
-            result = Items.COOKED_PORKCHOP;
-        }
-        else if(item == Items.BEEF)
-        {
-            result = Items.COOKED_BEEF;
-        }
-        else if(item == Items.CHICKEN)
-        {
-            result = Items.COOKED_CHICKEN;
-        }
-        else if(item == Items.FISH)
-        {
-            result = Items.COOKED_FISH;
-            dv = stack.getItemDamage();
-        }
-        else if(item == Items.POTATO)
-        {
-            result = Items.BAKED_POTATO;
-        }
-        else if(item == Items.MUTTON)
-        {
-            result = Items.COOKED_MUTTON;
-        }
-        else if(item == Items.RABBIT)
-        {
-            result = Items.COOKED_RABBIT;
-        }
-
-        if(result != null)
-        {
-            return new ItemStack(result, 1, dv);
-        }
-        return ItemStack.EMPTY;
-    }
-
-    @Override
-    public boolean isUsableByPlayer(EntityPlayer p)
-    {
-        if(this.world.getTileEntity(this.pos) != this)
-        {
-            return false;
-        }
-        else
-        {
-            return p.getDistanceSq(pos.getX() + 0.5d, pos.getY() + 0.5d, pos.getZ() + 0.5d) <= 64.0D;
-        }
-    }
-
-    @Override
-    public void openInventory(EntityPlayer player)
-    {
-    }
-
-    @Override
-    public void closeInventory(EntityPlayer player)
-    {
-    }
-
-    @Override
-    public boolean isItemValidForSlot(int index, ItemStack stack)
-    {
-        return false;
-    }
-
-    @Override
-    public String getGuiID()
-    {
-        return "km:campfire";
-    }
-
-    @Override
-    public Container createContainer(InventoryPlayer pInv, EntityPlayer p)
-    {
-        return new ContainerCampFire(pInv, this);
-    }
-
-    @Override
-    public int getField(int id)
-    {
-        return this.cookTime[id];
-    }
-
-    @Override
-    public void setField(int id, int value)
-    {
-        this.cookTime[id] = value;
-    }
-
-    @Override
-    public int getFieldCount()
-    {
-        return 3;
-    }
-
-    @Override
-    public void clear()
-    {
-        this.stacks.clear();
-    }
-}

+ 31 - 57
src/main/java/me/km/blocks/cookingpot/BlockCookingPot.java

@@ -1,78 +1,52 @@
 package me.km.blocks.cookingpot;
 
-import java.util.Random;
-import me.km.KajetansMod;
-import me.km.blocks.IBlockBase;
+import me.km.items.ItemColoredSoup;
 import me.km.items.ModItems;
-import net.minecraft.block.BlockCauldron;
+import net.minecraft.block.Block;
+import net.minecraft.block.CauldronBlock;
 import net.minecraft.block.ITileEntityProvider;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.material.MaterialColor;
+import net.minecraft.block.BlockState;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.item.Items;
 import net.minecraft.item.ItemStack;
 import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
+import net.minecraft.util.Hand;
 import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.BlockRayTraceResult;
+import net.minecraft.world.IBlockReader;
 import net.minecraft.world.World;
 
-public class BlockCookingPot extends BlockCauldron implements IBlockBase, ITileEntityProvider
+public class BlockCookingPot extends CauldronBlock implements ITileEntityProvider
 {
-    protected String name;
-
-    public BlockCookingPot(String name, String local) 
+    public BlockCookingPot(String name) 
     {
-        this.name = name;
+        super(Block.Properties.create(Material.IRON, MaterialColor.BROWN).hardnessAndResistance(2.0f));
         this.setRegistryName(name);
-        super.setUnlocalizedName(local);
-        super.setHardness(2.0F);
-        super.setCreativeTab(CreativeTabs.BREWING);
-    }
-    
-    @Override
-    public void registerItemModel(Item itemBlock) 
-    {
-        KajetansMod.proxy.registerItemRenderer(itemBlock, 0, name);
     }
 
     @Override
-    public BlockCookingPot setSoundType(SoundType sound) 
-    {
-        super.setSoundType(sound);
-        return this;
-    }
-
-    @Override
-    public TileEntity createNewTileEntity(World worldIn, int meta) 
+    public TileEntity createNewTileEntity(IBlockReader reader)
     {
         return new TileEntityCookingPot();
     }
-    
-    @Override
-    public void breakBlock(World w, BlockPos pos, IBlockState state)
-    {
-        w.removeTileEntity(pos);
-    }
-    
+
     @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
+    public boolean hasTileEntity()
     {
-        return Item.getItemFromBlock(this);
+        return true;
     }
 
     @Override
-    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
+    public TileEntity createTileEntity(BlockState state, IBlockReader world)
     {
-        return new ItemStack(Item.getItemFromBlock(this), 1, this.damageDropped(state));
+        return new TileEntityCookingPot();
     }
 
     @Override
-    public boolean onBlockActivated(World w, BlockPos pos, IBlockState state, EntityPlayer p, 
-            EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
+    public boolean onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand, BlockRayTraceResult hit)
     {
         if(w.isRemote)
         {
@@ -87,7 +61,7 @@ public class BlockCookingPot extends BlockCauldron implements IBlockBase, ITileE
                 boolean b = false;
                 if(cauldron.hasDefaultColor())
                 {
-                    b = super.onBlockActivated(w, pos, state, p, hand, facing, hitX, hitY, hitZ);
+                    b = super.onBlockActivated(state, w, pos, p, hand, hit);
                 }
                 ItemStack stack = p.getHeldItem(hand);
                 if(stack.isEmpty() || b)
@@ -96,13 +70,13 @@ public class BlockCookingPot extends BlockCauldron implements IBlockBase, ITileE
                 }
                 else if(stack.getItem() == Items.BOWL)
                 {
-                    int waterLevel = state.getValue(LEVEL);
+                    int waterLevel = state.get(LEVEL);
                     if(waterLevel > 0)
                     {
                         ItemStack stew = new ItemStack(ModItems.coloredSoup);
-                        ModItems.coloredSoup.addIngredient(stew, cauldron.getIngredients());
-                        ModItems.coloredSoup.setColor(stew, cauldron.getColor().getRGB());
-                        ModItems.coloredSoup.setFoodStats(stew, cauldron.getIngredients());
+                        ItemColoredSoup.addIngredient(stew, cauldron.getIngredients());
+                        ItemColoredSoup.setColor(stew, cauldron.getColor().getRGB());
+                        ItemColoredSoup.setFoodStats(stew, cauldron.getIngredients());
                         stack.shrink(1);
                         if(stack.isEmpty())
                         {
@@ -112,9 +86,9 @@ public class BlockCookingPot extends BlockCauldron implements IBlockBase, ITileE
                         {
                             p.dropItem(stew, false);
                         }
-                        else if(p instanceof EntityPlayerMP)
+                        else if(p instanceof ServerPlayerEntity)
                         {
-                            ((EntityPlayerMP) p).sendContainerToPlayer(p.inventoryContainer);
+                            ((ServerPlayerEntity) p).sendContainerToPlayer(p.container);
                         }
                         this.setWaterLevel(w, pos, state, waterLevel - 1);
                     }
@@ -122,7 +96,7 @@ public class BlockCookingPot extends BlockCauldron implements IBlockBase, ITileE
                 }
                 if(cauldron.getNumberOfIngredients() < 3 && cauldron.addItemStack(stack))
                 {
-                    if(!p.capabilities.isCreativeMode)
+                    if(!p.isCreative())
                     {
                         stack.shrink(1);
                     }
@@ -134,7 +108,7 @@ public class BlockCookingPot extends BlockCauldron implements IBlockBase, ITileE
     }
 
     @Override
-    public void setWaterLevel(World w, BlockPos pos, IBlockState state, int level) 
+    public void setWaterLevel(World w, BlockPos pos, BlockState state, int level) 
     {
         if(level <= 0 && !w.isRemote)
         {

+ 31 - 44
src/main/java/me/km/blocks/cookingpot/CookingPotColorMixer.java

@@ -2,9 +2,10 @@ package me.km.blocks.cookingpot;
 
 import java.awt.Color;
 import java.util.LinkedList;
+import net.minecraft.block.Blocks;
+import net.minecraft.item.Items;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
-import net.minecraft.item.ItemFishFood;
 
 public class CookingPotColorMixer 
 {
@@ -71,49 +72,35 @@ public class CookingPotColorMixer
     
     private Color getItemColor(ItemStack stack)
     {
-        switch(Item.getIdFromItem(stack.getItem()))
-        {
-            case 86: return PUMPKIN;   
-            case 260: return APPLE;      
-            case 295: return SEEDS_WHEAT;
-            //case 296: return WHEAT;
-            case 319: return PORKCHOP_RAW;
-            case 322: return APPLE_GOLDEN;                
-            case 349:   
-                switch(ItemFishFood.FishType.byItemStack(stack))
-                {
-                    case CLOWNFISH:
-                        return FISH_CLOWNFISH_RAW;  
-                    case COD:
-                        return FISH_COD_RAW;  
-                    case PUFFERFISH:
-                        return POISON;
-                    case SALMON:
-                        return FISH_SALMON_RAW;
-                }
-                break;
-            case 353: return SUGAR;         
-            case 360: return MELON;
-            case 361: return SEEDS_PUMPKIN;
-            case 362: return SEEDS_MELON;
-            case 363: return BEEF_RAW;       
-            case 365: return CHICKEN_RAW;
-            case 372: return NETHER_WART;
-            case 394: // poison potato
-            case 375: return POISON; // spider eye
-            case 376: return SPIDER_EYE_FERMENTED;
-            //case 377: return BLAZE_POWDER;
-            //case 378: return MAGMA_CREAM;  
-            case 382: return MELON_SPECKLED;
-            case 391: return CARROT;
-            case 392: return POTATO; 
-            case 396: return CARROT_GOLDEN;
-            case 411: return RABBIT_RAW;
-            case 414: return RABBIT_FOOT;
-            case 423: return MUTTON_RAW;
-            case 434: return BEETROOT;
-            case 435: return BEETROOT_SEEDS;
-        }
+        Item item = stack.getItem();
+        if(item == Item.getItemFromBlock(Blocks.PUMPKIN)) { return PUMPKIN; }
+        else if(item == Items.APPLE) { return APPLE; }
+        else if(item == Items.GOLDEN_APPLE) { return APPLE_GOLDEN; }
+        else if(item == Items.BEETROOT_SEEDS) { return BEETROOT_SEEDS; }
+        else if(item == Items.MELON_SEEDS) { return SEEDS_MELON; }
+        else if(item == Items.PUMPKIN_SEEDS) { return SEEDS_PUMPKIN; }
+        else if(item == Items.WHEAT_SEEDS) { return SEEDS_WHEAT; }
+        else if(item == Items.PORKCHOP) { return PORKCHOP_RAW; }
+        else if(item == Items.BEEF) { return BEEF_RAW; }
+        else if(item == Items.TROPICAL_FISH) { return FISH_CLOWNFISH_RAW; }
+        else if(item == Items.COD) { return FISH_COD_RAW; }
+        else if(item == Items.PUFFERFISH) { return POISON; }
+        else if(item == Items.SALMON) { return FISH_SALMON_RAW; }
+        else if(item == Items.SUGAR) { return SUGAR; }
+        else if(item == Items.MELON_SLICE) { return MELON; }
+        else if(item == Items.GLISTERING_MELON_SLICE) { return MELON_SPECKLED; }
+        else if(item == Items.CHICKEN) { return CHICKEN_RAW; }
+        else if(item == Items.SPIDER_EYE) { return POISON; }
+        else if(item == Items.POISONOUS_POTATO) { return POISON; }
+        else if(item == Items.RABBIT_FOOT) { return RABBIT_FOOT; }
+        else if(item == Items.NETHER_WART) { return NETHER_WART; }
+        else if(item == Items.FERMENTED_SPIDER_EYE) { return SPIDER_EYE_FERMENTED; }
+        else if(item == Items.GOLDEN_CARROT) { return CARROT_GOLDEN; }
+        else if(item == Items.CARROT) { return CARROT; }
+        else if(item == Items.RABBIT) { return RABBIT_RAW; }
+        else if(item == Items.POTATO) { return POTATO; }
+        else if(item == Items.MUTTON) { return MUTTON_RAW; }
+        else if(item == Items.BEETROOT) { return BEETROOT; }
         return null;
     }
 

+ 35 - 41
src/main/java/me/km/blocks/cookingpot/TileEntityCookingPot.java

@@ -2,73 +2,73 @@ package me.km.blocks.cookingpot;
 
 import java.awt.Color;
 import java.util.LinkedList;
-import net.minecraft.block.state.IBlockState;
+import me.km.KajetansMod;
+import net.minecraft.block.BlockState;
 import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
+import net.minecraft.nbt.INBT;
+import net.minecraft.nbt.CompoundNBT;
+import net.minecraft.nbt.ListNBT;
 import net.minecraft.network.NetworkManager;
-import net.minecraft.network.play.server.SPacketUpdateTileEntity;
+import net.minecraft.network.play.server.SUpdateTileEntityPacket;
 import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
+import net.minecraft.tileentity.TileEntityType;
 
 public class TileEntityCookingPot extends TileEntity
 {
-    private CookingPotColorMixer mixer;
+    public static final TileEntityType<TileEntityCookingPot> COOKING_POT = 
+            (TileEntityType<TileEntityCookingPot>) TileEntityType.Builder
+            .create(TileEntityCookingPot::new).build(null)
+            .setRegistryName(KajetansMod.MODID, "cooking_pot");
+    
+    private final CookingPotColorMixer mixer;
     
     public TileEntityCookingPot()
     {
+        super(COOKING_POT);
         mixer = new CookingPotColorMixer();
     }
     
     @Override
-    public NBTTagCompound writeToNBT(NBTTagCompound com)
+    public CompoundNBT write(CompoundNBT com)
     {
-        super.writeToNBT(com);
+        super.write(com);
         
-        NBTTagList list = new NBTTagList();
+        ListNBT list = new ListNBT();
         LinkedList<ItemStack> items = mixer.getItems();
         items.stream().forEach(stack -> 
         {
-            NBTTagCompound nbttagcompound = new NBTTagCompound();
-            stack.writeToNBT(nbttagcompound);
-            list.appendTag(nbttagcompound);
+            CompoundNBT nbttagcompound = new CompoundNBT();
+            stack.write(nbttagcompound);
+            list.add(nbttagcompound);
         });
         
-        com.setTag("items", list);
+        com.put("items", list);
         return com;
     }
     
     @Override
-    public void readFromNBT(NBTTagCompound com)
+    public void read(CompoundNBT com)
     {
-        super.readFromNBT(com);
+        super.read(com);
         readItems(com);
     }
     
-    private void readItems(NBTTagCompound com)
+    private void readItems(CompoundNBT com)
     {
-        if(com.hasKey("items", 9))
+        if(com.hasUniqueId("items"))
         {
             mixer.reset();
-            NBTTagList list = com.getTagList("items", 10);
+            ListNBT list = com.getList("items", 10);
             LinkedList<ItemStack> items = mixer.getItems();
-            for(NBTBase base : list)
+            for(INBT base : list)
             {
-                items.add(new ItemStack((NBTTagCompound) base));
+                items.add(ItemStack.read((CompoundNBT) base));
             }
             
             mixer.cache();
         }
     }
 
-    @Override
-    protected void setWorldCreate(World w)
-    {
-        this.setWorld(w);
-    }
-
     public boolean hasDefaultColor()
     {
         return mixer.getItems().isEmpty();
@@ -114,32 +114,26 @@ public class TileEntityCookingPot extends TileEntity
     
     private void notifyBlockUpdate()
     {
-        IBlockState state = world.getBlockState(pos);
+        BlockState state = world.getBlockState(pos);
         this.world.notifyBlockUpdate(pos, state, state, 3);
     }
     
     @Override
-    public SPacketUpdateTileEntity getUpdatePacket()
+    public SUpdateTileEntityPacket getUpdatePacket()
     {
-        return new SPacketUpdateTileEntity(this.pos, -1, this.getUpdateTag());
+        return new SUpdateTileEntityPacket(this.pos, -1, this.getUpdateTag());
     }
     
     @Override
-    public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) 
+    public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) 
     {
         readItems(pkt.getNbtCompound());
         notifyBlockUpdate();
     }
 
     @Override
-    public NBTTagCompound getUpdateTag()
-    {
-        return writeToNBT(new NBTTagCompound());
-    }
-    
-    @Override
-    public boolean shouldRefresh(World w, BlockPos pos, IBlockState oldState, IBlockState newState)
+    public CompoundNBT getUpdateTag()
     {
-        return oldState.getBlock() != newState.getBlock();
+        return write(new CompoundNBT());
     }
-}
+}

+ 0 - 35
src/main/java/me/km/blocks/leaves/BlockApricotLeaves.java

@@ -1,35 +0,0 @@
-package me.km.blocks.leaves;
-
-import java.util.Random;
-import me.km.blocks.ModBlocks;
-import me.km.items.ModItems;
-import static net.minecraft.block.Block.spawnAsEntity;
-import net.minecraft.block.BlockPlanks;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class BlockApricotLeaves extends BlockLeaves
-{
-    public BlockApricotLeaves(String name, String local) 
-    {
-        super(name, local, BlockPlanks.EnumType.OAK);
-    }
-  
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return Item.getItemFromBlock(ModBlocks.apricotSapling);
-    }
-    
-    @Override
-    protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance)
-    {
-        if(worldIn.rand.nextInt(chance) == 0)
-        {
-            spawnAsEntity(worldIn, pos, new ItemStack(ModItems.apricot));
-        }
-    }
-}

+ 0 - 28
src/main/java/me/km/blocks/leaves/BlockCherryLeaves.java

@@ -1,28 +0,0 @@
-package me.km.blocks.leaves;
-
-import java.util.Random;
-import me.km.blocks.ModBlocks;
-import net.minecraft.block.BlockPlanks;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.Item;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class BlockCherryLeaves extends BlockLeaves
-{
-    public BlockCherryLeaves(String name, String local) 
-    {
-        super(name, local, BlockPlanks.EnumType.OAK);
-    }
-  
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return Item.getItemFromBlock(ModBlocks.cherrySapling);
-    }
-    
-    @Override
-    protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance)
-    {
-    }
-}

+ 0 - 140
src/main/java/me/km/blocks/leaves/BlockLeaves.java

@@ -1,140 +0,0 @@
-package me.km.blocks.leaves;
-
-import java.util.Random;
-import javax.annotation.Nullable;
-import me.km.KajetansMod;
-import me.km.blocks.IBlockBase;
-import net.minecraft.block.BlockPlanks;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.properties.IProperty;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.stats.StatList;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.NonNullList;
-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;
-
-public class BlockLeaves extends net.minecraft.block.BlockLeaves implements IBlockBase
-{
-    protected String name;
-    private final BlockPlanks.EnumType planks;
-
-    public BlockLeaves(String name, String local, BlockPlanks.EnumType planks) 
-    {
-        this.name = name;
-        this.setRegistryName(name);
-        super.setUnlocalizedName(local);
-        
-        this.planks = planks;
-        this.setDefaultState(this.blockState.getBaseState().withProperty(CHECK_DECAY, true).withProperty(DECAYABLE, true));
-    }
-    
-    @Override
-    public void registerItemModel(Item itemBlock) 
-    {
-        KajetansMod.proxy.registerItemRenderer(itemBlock, 0, name);
-    }
-    
-    @Override
-    public BlockLeaves setSoundType(SoundType sound) 
-    {
-        super.setSoundType(sound);
-        return this;
-    }
-    
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return Item.getItemFromBlock(this);
-    }
-
-    @Override
-    protected ItemStack getSilkTouchDrop(IBlockState state)
-    {
-        return new ItemStack(Item.getItemFromBlock(this), 1, 0);
-    }
-
-    @Override
-    public IBlockState getStateFromMeta(int meta)
-    {
-        return this.getDefaultState().withProperty(DECAYABLE, (meta & 4) == 0).withProperty(CHECK_DECAY, (meta & 8) > 0);
-    }
-
-    @Override
-    public int getMetaFromState(IBlockState state)
-    {
-        int i = 0;
-        if(!state.getValue(DECAYABLE))
-        {
-            i |= 4;
-        }
-        if(state.getValue(CHECK_DECAY))
-        {
-            i |= 8;
-        }
-        return i;
-    }
-
-    @Override
-    public BlockPlanks.EnumType getWoodType(int meta)
-    {
-        return planks;
-    }
-
-    @Override
-    protected BlockStateContainer createBlockState()
-    {
-        return new BlockStateContainer(this, new IProperty[] {CHECK_DECAY, DECAYABLE});
-    }
-
-    @Override
-    public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack)
-    {
-        if (!worldIn.isRemote && stack.getItem() == Items.SHEARS)
-        {
-            player.addStat(StatList.getBlockStats(this));
-        }
-        else
-        {
-            super.harvestBlock(worldIn, player, pos, state, te, stack);
-        }
-    }
-
-    @Override
-    public NonNullList<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
-    {
-        return NonNullList.withSize(1, new ItemStack(this, 1));
-    }
-    
-    // this stuff here has to be done because minecraft isn't calling setGraphicsLevel on our instance
-    @Override
-    public boolean isOpaqueCube(IBlockState state)
-    {
-        return Blocks.LEAVES.isOpaqueCube(state);
-    }
-    
-    @SideOnly(Side.CLIENT)
-    @Override
-    public BlockRenderLayer getBlockLayer()
-    {
-        return  Blocks.LEAVES.getBlockLayer();
-    }
-    
-    @SideOnly(Side.CLIENT)
-    @Override
-    public boolean shouldSideBeRendered(IBlockState bs, IBlockAccess ba, BlockPos pos, EnumFacing side)
-    {
-        return Blocks.LEAVES.shouldSideBeRendered(bs, ba, pos, side);
-    }
-}

+ 0 - 35
src/main/java/me/km/blocks/leaves/BlockPearLeaves.java

@@ -1,35 +0,0 @@
-package me.km.blocks.leaves;
-
-import java.util.Random;
-import me.km.blocks.ModBlocks;
-import me.km.items.ModItems;
-import static net.minecraft.block.Block.spawnAsEntity;
-import net.minecraft.block.BlockPlanks;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class BlockPearLeaves extends BlockLeaves
-{
-    public BlockPearLeaves(String name, String local) 
-    {
-        super(name, local, BlockPlanks.EnumType.OAK);
-    }
-  
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return Item.getItemFromBlock(ModBlocks.pearSapling);
-    }
-    
-    @Override
-    protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance)
-    {
-        if(worldIn.rand.nextInt(chance) == 0)
-        {
-            spawnAsEntity(worldIn, pos, new ItemStack(ModItems.pear));
-        }
-    }
-}

+ 0 - 35
src/main/java/me/km/blocks/leaves/BlockPlumLeaves.java

@@ -1,35 +0,0 @@
-package me.km.blocks.leaves;
-
-import java.util.Random;
-import me.km.blocks.ModBlocks;
-import me.km.items.ModItems;
-import static net.minecraft.block.Block.spawnAsEntity;
-import net.minecraft.block.BlockPlanks;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class BlockPlumLeaves extends BlockLeaves
-{
-    public BlockPlumLeaves(String name, String local) 
-    {
-        super(name, local, BlockPlanks.EnumType.OAK);
-    }
-  
-    @Override
-    public Item getItemDropped(IBlockState state, Random rand, int fortune)
-    {
-        return Item.getItemFromBlock(ModBlocks.plumSapling);
-    }
-    
-    @Override
-    protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance)
-    {
-        if(worldIn.rand.nextInt(chance) == 0)
-        {
-            spawnAsEntity(worldIn, pos, new ItemStack(ModItems.plum));
-        }
-    }
-}

+ 0 - 144
src/main/java/me/km/blocks/leaves/BlockSapling.java

@@ -1,144 +0,0 @@
-package me.km.blocks.leaves;
-
-import java.util.Random;
-import me.km.KajetansMod;
-import me.km.blocks.IBlockBase;
-import net.minecraft.block.BlockBush;
-import net.minecraft.block.BlockOldLog;
-import net.minecraft.block.BlockPlanks;
-import net.minecraft.block.IGrowable;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.properties.IProperty;
-import net.minecraft.block.properties.PropertyInteger;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraft.world.gen.feature.WorldGenerator;
-
-public class BlockSapling extends BlockBush implements IBlockBase, IGrowable
-{
-    public static final PropertyInteger STAGE = PropertyInteger.create("stage", 0, 1);
-    protected static final AxisAlignedBB SAPLING_AABB = new AxisAlignedBB(0.1d, 0, 0.1d, 0.9d, 0.8d, 0.9d);
-    
-    protected String name;
-    private final IBlockState log;
-    private final IBlockState leaf;
-    
-    public BlockSapling(String name, String local, BlockPlanks.EnumType planks, BlockLeaves leaf) 
-    {
-        this.name = name;
-        this.setRegistryName(name);
-        super.setUnlocalizedName(local);
-        super.setHardness(0.0F);
-        super.setSoundType(SoundType.PLANT);
-        
-        super.setDefaultState(this.blockState.getBaseState().withProperty(STAGE, 0));
-        super.setCreativeTab(CreativeTabs.DECORATIONS);
-        
-        this.log = Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, planks);
-        this.leaf = leaf.getDefaultState().withProperty(net.minecraft.block.BlockLeaves.CHECK_DECAY, false);
-    }
-    
-    @Override
-    public void registerItemModel(Item itemBlock) 
-    {
-        KajetansMod.proxy.registerItemRenderer(itemBlock, 0, name);
-    }
-    
-    @Override
-    public BlockSapling setSoundType(SoundType sound) 
-    {
-        super.setSoundType(sound);
-        return this;
-    }
-    
-    @Override
-    public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
-    {
-        return net.minecraftforge.common.EnumPlantType.Plains;
-    }
-
-    @Override
-    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
-    {
-        return SAPLING_AABB;
-    }
-
-    @Override
-    public void updateTick(World w, BlockPos pos, IBlockState state, Random rand)
-    {
-        if(!w.isRemote)
-        {
-            super.updateTick(w, pos, state, rand);
-
-            if(w.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0)
-            {
-                this.grow(w, pos, state, rand);
-            }
-        }
-    }
-
-    public void grow(World worldIn, BlockPos pos, IBlockState state, Random rand)
-    {
-        if(state.getValue(STAGE) == 0)
-        {
-            worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4);
-        }
-        else
-        {
-            this.generateTree(worldIn, pos, state, rand);
-        }
-    }
-
-    public void generateTree(World w, BlockPos pos, IBlockState state, Random rand)
-    {
-        WorldGenerator gen = new WorldGenTree(true, log, leaf);
-        w.setBlockState(pos, Blocks.AIR.getDefaultState(), 4); 
-        if(!gen.generate(w, rand, pos))
-        {
-            w.setBlockState(pos, state, 4);
-        }
-    }
-
-    @Override
-    public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient)
-    {
-        return true;
-    }
-
-    @Override
-    public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state)
-    {
-        return worldIn.rand.nextFloat() < 0.45d;
-    }
-
-    @Override
-    public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state)
-    {
-        this.grow(worldIn, pos, state, rand);
-    }
-
-    @Override
-    public IBlockState getStateFromMeta(int meta)
-    {
-        return this.getDefaultState().withProperty(STAGE, meta);
-    }
-
-    @Override
-    public int getMetaFromState(IBlockState state)
-    {
-        return state.getValue(STAGE);
-    }
-
-    @Override
-    protected BlockStateContainer createBlockState()
-    {
-        return new BlockStateContainer(this, new IProperty[] {STAGE});
-    }
-}

+ 0 - 131
src/main/java/me/km/blocks/leaves/WorldGenTree.java

@@ -1,131 +0,0 @@
-package me.km.blocks.leaves;
-
-import java.util.Random;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.init.Blocks;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraft.world.gen.feature.WorldGenAbstractTree;
-
-public class WorldGenTree extends WorldGenAbstractTree
-{
-    private final IBlockState log; 
-    private final IBlockState leaf; 
-
-    public WorldGenTree(boolean notify, IBlockState log, IBlockState leaf)
-    {
-        super(notify);
-        this.log = log;
-        this.leaf = leaf;
-    }
-    
-    @Override
-    protected boolean canGrowInto(Block blockType)
-    {
-        Material material = blockType.getDefaultState().getMaterial();
-        return material == Material.AIR || material == Material.LEAVES || 
-                blockType == Blocks.GRASS || blockType == Blocks.DIRT || 
-                blockType == Blocks.LOG || blockType == Blocks.LOG2 || 
-                blockType == Blocks.SAPLING || blockType == Blocks.VINE ||
-                blockType instanceof BlockLeaves;
-    }
-
-    @Override
-    public boolean generate(World worldIn, Random rand, BlockPos pos)
-    {
-        int i = rand.nextInt(3) + 5;
-        boolean flag = true;
-        if(pos.getY() >= 1 && pos.getY() + i + 1 <= 256)
-        {
-            for(int j = pos.getY(); j <= pos.getY() + 1 + i; j++)
-            {
-                int k = 1;
-                if (j == pos.getY())
-                {
-                    k = 0;
-                }
-                if (j >= pos.getY() + 1 + i - 2)
-                {
-                    k = 2;
-                }
-
-                BlockPos.MutableBlockPos mPos = new BlockPos.MutableBlockPos();
-                for(int x = pos.getX() - k; x <= pos.getX() + k && flag; x++)
-                {
-                    for(int z = pos.getZ() - k; z <= pos.getZ() + k && flag; z++)
-                    {
-                        if(j >= 0 && j < worldIn.getHeight())
-                        {
-                            if(!this.isReplaceable(worldIn, mPos.setPos(x, j, z)))
-                            {
-                                flag = false;
-                            }
-                        }
-                        else
-                        {
-                            flag = false;
-                        }
-                    }
-                }
-            }
-            if(!flag)
-            {
-                return false;
-            }
-            else
-            {
-                BlockPos down = pos.down();
-                IBlockState state = worldIn.getBlockState(down);
-                boolean isSoil = state.getBlock().canSustainPlant(state, worldIn, down, EnumFacing.UP, (net.minecraft.block.BlockSapling) Blocks.SAPLING);
-
-                if(isSoil && pos.getY() < worldIn.getHeight() - i - 1)
-                {
-                    state.getBlock().onPlantGrow(state, worldIn, down, pos);
-                    for(int y = pos.getY() - 3 + i; y <= pos.getY() + i; y++)
-                    {
-                        int k = y - (pos.getY() + i);
-                        int l = 1 - k / 2;
-                        for(int x = pos.getX() - l; x <= pos.getX() + l; x++)
-                        {
-                            int j = x - pos.getX();
-                            for(int z = pos.getZ() - l; z <= pos.getZ() + l; z++)
-                            {
-                                int m = z - pos.getZ();
-                                if(Math.abs(j) != l || Math.abs(m) != l || rand.nextInt(2) != 0 && k != 0)
-                                {
-                                    BlockPos blockpos = new BlockPos(x, y, z);
-                                    IBlockState state2 = worldIn.getBlockState(blockpos);
-                                    if(state2.getBlock().isAir(state2, worldIn, blockpos) || state2.getBlock().isAir(state2, worldIn, blockpos))
-                                    {
-                                        this.setBlockAndNotifyAdequately(worldIn, blockpos, leaf);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    for(int j = 0; j < i; j++)
-                    {
-                        BlockPos upN = pos.up(j);
-                        IBlockState state2 = worldIn.getBlockState(upN);
-                        if (state2.getBlock().isAir(state2, worldIn, upN) || state2.getBlock().isLeaves(state2, worldIn, upN))
-                        {
-                            this.setBlockAndNotifyAdequately(worldIn, pos.up(j), log);
-                        }
-                    }
-                    return true;
-                }
-                else
-                {
-                    return false;
-                }
-            }
-        }
-        else
-        {
-            return false;
-        }
-    }
-}

+ 6 - 6
src/main/java/me/km/chatchannel/ChatChannel.java

@@ -4,8 +4,8 @@ import java.util.function.BiConsumer;
 import java.util.function.Consumer;
 import java.util.function.Predicate;
 import me.km.KajetansMod;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.util.text.TextComponentString;
+import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.util.text.StringTextComponent;
 
 public class ChatChannel 
 {
@@ -21,7 +21,7 @@ public class ChatChannel
     private final static ChatChannel DEV_CHANNEL = new ChatChannel("Dev", TextColor.LIGHT_PURPLE, 
             (cc, s) -> 
             {
-                TextComponentString text = new TextComponentString(s);
+                StringTextComponent text = new StringTextComponent(s);
                 cc.forEach(p -> p.sendMessage(text));
             }, p -> KajetansMod.perms.hasPermission(p, "script.error"));   
     
@@ -29,13 +29,13 @@ public class ChatChannel
     // chat channels
     // -------------------------------------------------------------------------
     
-    private final Predicate<EntityPlayerMP> filter;
+    private final Predicate<ServerPlayerEntity> filter;
     private final String prefix;
     private final String list;
     private final BiConsumer<ChatChannel, String> onSend;
     
     private ChatChannel(String name, TextColor tc,
-            BiConsumer<ChatChannel, String> onSend, Predicate<EntityPlayerMP> filter)
+            BiConsumer<ChatChannel, String> onSend, Predicate<ServerPlayerEntity> filter)
     {
         this.filter = filter;
         this.prefix = "[" + tc + name + TextColor.RESET + "] ";
@@ -63,7 +63,7 @@ public class ChatChannel
         onSend.accept(this, list + msg + TextColor.RESET + " " + msg2);
     }
     
-    public void forEach(Consumer<EntityPlayerMP> c)
+    public void forEach(Consumer<ServerPlayerEntity> c)
     {
         KajetansMod.server.getPlayerList().getPlayers().stream().filter(filter).forEach(c);
     }

+ 29 - 37
src/main/java/me/km/databank/DataBank.java

@@ -4,6 +4,7 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
+import java.sql.Statement;
 import java.util.HashMap;
 import me.km.module.Module;
 import me.km.scheduler.SnuviScheduler;
@@ -11,9 +12,7 @@ import net.minecraft.util.text.TextFormatting;
 
 public class DataBank extends Module
 {
-    private final static DummyStatement DUMMY_STATEMENT = new DummyStatement();
-    
-    private Connection c;
+    private Connection c = null;
     private final String user;
     private final String password;
     
@@ -28,7 +27,6 @@ public class DataBank extends Module
     
     public boolean openDataBankConnection()
     {
-        c = null;
         try 
         {
             // The newInstance() call is a work around for some broken Java implementations
@@ -51,17 +49,17 @@ public class DataBank extends Module
             if(c != null)
             {
                 c.close();
-            }
-            statements.values().forEach(stmt -> 
-            {
-                try
-                {
-                    stmt.close();
-                }
-                catch(SQLException ex)
+                statements.values().forEach(stmt -> 
                 {
-                }
-            });
+                    try
+                    {
+                        stmt.close();
+                    }
+                    catch(SQLException ex)
+                    {
+                    }
+                });
+            }
             this.sendToConsole("The connection was closed.");
         } 
         catch (SQLException ex) 
@@ -75,15 +73,22 @@ public class DataBank extends Module
         return c == null;
     }
     
-    protected PreparedStatement prepareStatement(String query) throws SQLException
+    public PreparedStatement prepareStatement(String query)
     {
-        PreparedStatement ps = c.prepareStatement(query);
-        PreparedStatement old = statements.put(query, ps);
-        if(old != null)
+        try
+        {
+            PreparedStatement ps = c.prepareStatement(query);
+            PreparedStatement old = statements.put(query, ps);
+            if(old != null)
+            {
+                old.close();
+            }
+        }
+        catch(SQLException ex)
         {
-            old.close();
+            ex.printStackTrace();
         }
-        return ps;
+        return null;
     }
     
     public PreparedStatement prepareUnsafeStatement(String query) throws SQLException
@@ -91,23 +96,6 @@ public class DataBank extends Module
         return c.prepareStatement(query);
     }
     
-    public IStatement createStatement(String query)
-    {
-        if(c == null)
-        {
-            return DUMMY_STATEMENT;
-        }
-        try
-        {
-            return new Statement(this, query);
-        }
-        catch(SQLException ex)
-        {
-            ex.printStackTrace();
-            return DUMMY_STATEMENT;
-        }
-    } 
-    
     public boolean execute(String query)
     {
         if(c == null)
@@ -128,6 +116,10 @@ public class DataBank extends Module
     
     public void startReconnecting(SnuviScheduler scheduler)
     {
+        if(c == null)
+        {
+            return;
+        }
         scheduler.scheduleRepeatingTask(() -> 
         {
             try(java.sql.Statement stmt = c.createStatement()) 

+ 0 - 53
src/main/java/me/km/databank/DummyStatement.java

@@ -1,53 +0,0 @@
-package me.km.databank;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-public class DummyStatement implements IStatement
-{
-    @Override
-    public void validate() throws SQLException
-    {
-    }
-
-    @Override
-    public void close() throws SQLException
-    {
-    }
-
-    @Override
-    public void setInt(int index, int i) throws SQLException
-    {
-    }
-
-    @Override
-    public void setLong(int index, long l) throws SQLException
-    {
-    }
-
-    @Override
-    public void setFloat(int index, float f) throws SQLException
-    {
-    }
-
-    @Override
-    public void setDouble(int index, double d) throws SQLException
-    {
-    }
-    
-    @Override
-    public void setString(int index, String s) throws SQLException
-    {
-    }
-
-    @Override
-    public ResultSet executeQuery() throws SQLException
-    {
-        throw new SQLException("dummy statement");
-    }
-
-    @Override
-    public void executeUpdate() throws SQLException
-    {
-    }
-}

+ 0 - 21
src/main/java/me/km/databank/IStatement.java

@@ -1,21 +0,0 @@
-package me.km.databank;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-public interface IStatement extends AutoCloseable
-{
-    public void validate() throws SQLException;
-    
-    @Override
-    public void close() throws SQLException;
-    
-    public void setInt(int index, int i) throws SQLException;
-    public void setLong(int index, long l) throws SQLException;
-    public void setFloat(int index, float f) throws SQLException;
-    public void setDouble(int index, double d) throws SQLException;
-    public void setString(int index, String s) throws SQLException;
-    
-    public ResultSet executeQuery() throws SQLException;
-    public void executeUpdate() throws SQLException;
-}

+ 0 - 76
src/main/java/me/km/databank/Statement.java

@@ -1,76 +0,0 @@
-package me.km.databank;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-public class Statement implements IStatement
-{
-    private final DataBank d;
-    private PreparedStatement ps;
-    private final String query;
-    
-    public Statement(DataBank d, String query) throws SQLException
-    {
-        this.d = d;
-        this.query = query;
-        ps = d.prepareStatement(query);
-    }
-    
-    @Override
-    public void validate() throws SQLException
-    {
-        if(ps.isClosed())
-        {
-            ps = d.prepareStatement(query);
-        }
-    }
-    
-    @Override
-    public void close() throws SQLException
-    {
-        ps.close();
-    }
-    
-    @Override
-    public void setInt(int index, int i) throws SQLException
-    {
-        ps.setInt(index, i);
-    }
-    
-    @Override
-    public void setLong(int index, long l) throws SQLException
-    {
-        ps.setLong(index, l);
-    }
-    
-    @Override
-    public void setFloat(int index, float f) throws SQLException
-    {
-        ps.setFloat(index, f);
-    }
-    
-    @Override
-    public void setDouble(int index, double d) throws SQLException
-    {
-        ps.setDouble(index, d);
-    }
-    
-    @Override
-    public void setString(int index, String s) throws SQLException
-    {
-        ps.setString(index, s);
-    }
-    
-    @Override
-    public ResultSet executeQuery() throws SQLException
-    {
-        return ps.executeQuery();
-    }
-    
-    @Override
-    public void executeUpdate() throws SQLException
-    {
-        ps.executeUpdate();
-    }
-}

+ 98 - 104
src/main/java/me/km/effects/EffectUtils.java

@@ -4,95 +4,91 @@ import me.km.KajetansMod;
 import me.km.utils.Utils;
 import me.km.entities.EntityItemProjectile;
 import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityEnderPearl;
-import net.minecraft.entity.item.EntityExpBottle;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.entity.item.EnderPearlEntity;
+import net.minecraft.entity.item.ExperienceBottleEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.player.ServerPlayerEntity;
 import net.minecraft.entity.projectile.*;
-import net.minecraft.init.Items;
+import net.minecraft.inventory.EquipmentSlotType;
+import net.minecraft.item.Items;
 import net.minecraft.item.ItemStack;
+import net.minecraft.particles.IParticleData;
+import net.minecraft.potion.Effect;
+import net.minecraft.potion.EffectInstance;
 import net.minecraft.potion.Potion;
-import net.minecraft.potion.PotionEffect;
-import net.minecraft.potion.PotionType;
 import net.minecraft.potion.PotionUtils;
-import net.minecraft.util.EnumParticleTypes;
 import net.minecraft.util.SoundCategory;
 import net.minecraft.util.SoundEvent;
+import net.minecraft.util.datafix.fixes.TippedArrow;
 import net.minecraft.util.math.Vec3d;
 import net.minecraft.world.World;
-import net.minecraft.world.WorldServer;
+import net.minecraft.world.ServerWorld;
 
 public class EffectUtils
 {
     // -----------------------------------------------------------------------------------
     // Particles
     // -----------------------------------------------------------------------------------
-    
-    public static void spawnParticle(WorldServer w, EnumParticleTypes particle, double x, double y, double z, double offX, double offY, double offZ, int count, int... data)
+
+    public static void spawnParticle(ServerWorld w, IParticleData particle, double x, double y, double z, double offX, double offY, double offZ, int count, int... data)
     {
-        w.spawnParticle(particle, false, x, y, z, count, offX, offY, offZ, 1, data);
+        //w.spawnParticle(particle, false, x, y, z, count, offX, offY, offZ, 1, data);
     }
-    
-    public static void spawnParticle(WorldServer w, EnumParticleTypes particle, double x, double y, double z, double offX, double offY, double offZ, int count)
+
+    public static void spawnParticle(ServerWorld w, IParticleData particle, double x, double y, double z, double offX, double offY, double offZ, int count)
     {
         spawnParticle(w, particle, x, y, z, offX, offY, offZ, count, new int[0]);
     }
-    
-    public static void spawnParticle(WorldServer w, EnumParticleTypes particle, double x, double y, double z, int count)
+
+    public static void spawnParticle(ServerWorld w, IParticleData particle, double x, double y, double z, int count)
     {
         spawnParticle(w, particle, x, y, z, 0, 0, 0, count);
     }
-    
-    public static void spawnParticle(WorldServer w, EnumParticleTypes particle, Entity ent, int count)
+
+    public static void spawnParticle(ServerWorld w, IParticleData particle, Entity ent, int count)
     {
         spawnParticle(w, particle, ent.posX, ent.posY, ent.posZ, count);
     }
-    
-    public static void spawnSpell(EntityPlayerMP p, int level)
-    {
-        spawnParticle(p.getServerWorld(), EnumParticleTypes.SPELL, p.posX, p.posY + 1, p.posZ, 0.5f, 0.5f, 0.5f, 10 + level);
-    }
-    
-    public static void spawnParticleCircle(WorldServer w, double x, double y, double z, EnumParticleTypes particle, double radius, int counter, int... data)
+
+    public static void spawnParticleCircle(ServerWorld w, double x, double y, double z, IParticleData particle, double radius, int counter, int... data)
     {
         double angle = 2 * Math.PI / counter;
         for(int i = 0; i < counter; i++)
         {
             spawnParticle(w, particle, x + Math.cos(i * angle) * radius, y, z + Math.sin(i * angle) * radius, 0, 0, 0, 1, data);
-        }                
+        }
     }
-    
-    public static void spawnParticleCircle(WorldServer w, Entity ent, EnumParticleTypes particle, double radius, int counter, int... data)
+
+    public static void spawnParticleCircle(ServerWorld w, Entity ent, IParticleData particle, double radius, int counter, int... data)
     {
-        spawnParticleCircle(w, ent.posX, ent.posY, ent.posZ, particle, radius, counter, data);              
+        spawnParticleCircle(w, ent.posX, ent.posY, ent.posZ, particle, radius, counter, data);
     }
-    
-    public static void spawnParticleCircle(WorldServer w, double x, double y, double z, EnumParticleTypes particle, double radius, int counter)
+
+    public static void spawnParticleCircle(ServerWorld w, double x, double y, double z, IParticleData particle, double radius, int counter)
     {
-        spawnParticleCircle(w, x, y, z, particle, radius, counter, new int[0]);              
+        spawnParticleCircle(w, x, y, z, particle, radius, counter, new int[0]);
     }
-    
-    public static void spawnParticleCircle(WorldServer w, Entity ent, EnumParticleTypes particle, double radius, int counter)
+
+    public static void spawnParticleCircle(ServerWorld w, Entity ent, IParticleData particle, double radius, int counter)
     {
-        spawnParticleCircle(w, ent.posX, ent.posY, ent.posZ, particle, radius, counter, new int[0]);              
+        spawnParticleCircle(w, ent.posX, ent.posY, ent.posZ, particle, radius, counter, new int[0]);
     }
-    
+
     // -----------------------------------------------------------------------------------
     // Sounds
     // -----------------------------------------------------------------------------------
-    
     public static void playSound(World w, SoundEvent se, SoundCategory sc, double x, double y, double z)
     {
         w.playSound(null, x, y, z, se, sc, 1, w.rand.nextFloat() * 0.1f + 0.9f);
     }
-    
-    public static void playSound(EntityPlayer p, SoundEvent se, SoundCategory sc)
+
+    public static void playSound(PlayerEntity p, SoundEvent se, SoundCategory sc)
     {
         playSound(p.world, se, sc, p.posX, p.posY, p.posZ);
     }
-    
-    public static void playSound(EntityPlayer p, SoundEvent se)
+
+    public static void playSound(PlayerEntity p, SoundEvent se)
     {
         playSound(p.world, se, SoundCategory.PLAYERS, p.posX, p.posY, p.posZ);
     }
@@ -100,26 +96,24 @@ public class EffectUtils
     // -----------------------------------------------------------------------------------
     // Potions
     // -----------------------------------------------------------------------------------
-    
-    public static void addPotionTo(EntityLivingBase ent, Potion potion, int duration, int amplifier)
+    public static void addPotionTo(LivingEntity ent, Effect potion, int duration, int amplifier)
     {
-        if(ent.isPotionActive(potion)) 
+        if(ent.isPotionActive(potion))
         {
             ent.removePotionEffect(potion);
         }
-        ent.addPotionEffect(new PotionEffect(potion, duration, amplifier));
+        ent.addPotionEffect(new EffectInstance(potion, duration, amplifier));
     }
-    
+
     // -----------------------------------------------------------------------------------
     // Projectiles
     // -----------------------------------------------------------------------------------
-    
-    public static <T> T launchProjectile(EntityPlayer p, Class<? extends T> projectile, double scale, Object data) 
+    public static <T> T launchProjectile(PlayerEntity p, Class<? extends T> projectile, double scale, Object data)
     {
         World w = p.world;
         Entity launch = null;
 
-        if(EntityItemProjectile.class == projectile) 
+        if(EntityItemProjectile.class == projectile)
         {
             if(data == null)
             {
@@ -132,84 +126,84 @@ public class EffectUtils
             }
             launch = new EntityItemProjectile(p, stack.copy());
             ((EntityItemProjectile) launch).setHeadingFromThrower(p, p.rotationPitch, p.rotationYaw, 0.0f, 1.5f, 1.0f);
-        } 
-        else if(EntitySnowball.class == projectile) 
+        }
+        else if(SnowballEntity.class == projectile)
         {
-            launch = new EntitySnowball(w, p);
-            ((EntitySnowball) launch).shoot(p, p.rotationPitch, p.rotationYaw, 0.0f, 1.5f, 1.0f);
-        } 
-        else if(EntityEgg.class == projectile)
+            launch = new SnowballEntity(w, p);
+            ((SnowballEntity) launch).shoot(p, p.rotationPitch, p.rotationYaw, 0.0f, 1.5f, 1.0f);
+        }
+        else if(EggEntity.class == projectile)
         {
-            launch = new EntityEgg(w, p);
-            ((EntityEgg) launch).shoot(p, p.rotationPitch, p.rotationYaw, 0.0f, 1.5f, 1.0f);
-        } 
-        else if(EntityEnderPearl.class == projectile) 
+            launch = new EggEntity(w, p);
+            ((EggEntity) launch).shoot(p, p.rotationPitch, p.rotationYaw, 0.0f, 1.5f, 1.0f);
+        }
+        else if(EnderPearlEntity.class == projectile)
         {
-            launch = new EntityEnderPearl(w, p);
-            ((EntityEnderPearl) launch).shoot(p, p.rotationPitch, p.rotationYaw, 0.0f, 1.5f, 1.0f);
-        } 
-        else if(EntityPotion.class == projectile) 
+            launch = new EnderPearlEntity(w, p);
+            ((EnderPearlEntity) launch).shoot(p, p.rotationPitch, p.rotationYaw, 0.0f, 1.5f, 1.0f);
+        }
+        else if(PotionEntity.class == projectile)
         {
-            launch = new EntityPotion(w, p, (ItemStack) data);
-            ((EntityPotion) launch).shoot(p, p.rotationPitch, p.rotationYaw, -20.0f, 0.5f, 1.0f);
-        } 
-        else if(EntityExpBottle.class == projectile) 
+            launch = new PotionEntity(w, p);
+            ((PotionEntity) launch).setItem((ItemStack) data);
+            ((PotionEntity) launch).shoot(p, p.rotationPitch, p.rotationYaw, -20.0f, 0.5f, 1.0f);
+        }
+        else if(ExperienceBottleEntity.class == projectile)
         {
-            launch = new EntityExpBottle(w, p);
-            ((EntityExpBottle) launch).shoot(p, p.rotationPitch, p.rotationYaw, -20.0f, 0.7f, 1.0f);
-        } 
-        else if(EntityArrow.class.isAssignableFrom(projectile)) 
+            launch = new ExperienceBottleEntity(w, p);
+            ((ExperienceBottleEntity) launch).shoot(p, p.rotationPitch, p.rotationYaw, -20.0f, 0.7f, 1.0f);
+        }
+        else if(AbstractArrowEntity.class.isAssignableFrom(projectile))
         {
-            if(EntityTippedArrow.class == projectile) 
+            if(SpectralArrowEntity.class == projectile)
             {
-                launch = new EntityTippedArrow(w, p);
-                ((EntityTippedArrow) launch).setPotionEffect((ItemStack) data);
-            } 
-            else if(EntitySpectralArrow.class == projectile) 
-            {
-                launch = new EntitySpectralArrow(w, p);
-            } 
-            else 
+                launch = new SpectralArrowEntity(w, p);
+            }
+            else
             {
-                launch = new EntityTippedArrow(w, p);
+                launch = new ArrowEntity(w, p);
+                if(data != null)
+                {
+                    ((ArrowEntity) launch).setPotionEffect((ItemStack) data);
+                }
             }
-            ((EntityArrow) launch).shoot(p, p.rotationPitch, p.rotationYaw, 0.0F, 3.0F, 1.0F);
-        } 
-        else if(EntityFireball.class.isAssignableFrom(projectile)) 
+            ((AbstractArrowEntity) launch).shoot(p, p.rotationPitch, p.rotationYaw, 0.0F, 3.0F, 1.0F);
+        }
+        else if(DamagingProjectileEntity.class.isAssignableFrom(projectile))
         {
             Vec3d v = p.getLookVec().scale(10);
-            if (EntitySmallFireball.class == projectile) 
+            if(SmallFireballEntity.class == projectile)
             {
-                launch = new EntitySmallFireball(w, p, v.x, v.y, v.z);
-            } 
-            else if (EntityWitherSkull.class == projectile) 
+                launch = new SmallFireballEntity(w, p, v.x, v.y, v.z);
+            }
+            else if(WitherSkullEntity.class == projectile)
             {
-                launch = new EntityWitherSkull(w, p, v.x, v.y, v.z);
-            } 
-            else if (EntityDragonFireball.class == projectile) 
+                launch = new WitherSkullEntity(w, p, v.x, v.y, v.z);
+            }
+            else if(DragonFireballEntity.class == projectile)
             {
-                launch = new EntityDragonFireball(w, p, v.x, v.y, v.z);
-            } 
-            else 
+                launch = new DragonFireballEntity(w, p, v.x, v.y, v.z);
+            }
+            else
             {
-                launch = new EntityLargeFireball(w, p, v.x, v.y, v.z);
+                launch = new FireballEntity(w, p, v.x, v.y, v.z);
             }
-        } 
+        }
 
         Utils.scaleVelocity(launch, scale);
-        w.spawnEntity(launch);
+        w.addEntity(launch);
         return (T) launch;
     }
-    
-    public static EntityTippedArrow launchTippedArrow(EntityPlayer p, double scale, Potion potion, int duration, int amplifier) 
+
+    public static ArrowEntity launchTippedArrow(PlayerEntity p, double scale, Effect potion, int duration, int amplifier)
     {
         ItemStack stack = new ItemStack(Items.TIPPED_ARROW);
-        PotionUtils.addPotionToItemStack(stack, new PotionType(new PotionEffect(potion, duration, amplifier)));
-        EntityTippedArrow arrow = launchProjectile(p, EntityTippedArrow.class, scale, stack);
+        PotionUtils.addPotionToItemStack(stack, new Potion(new EffectInstance(potion, duration, amplifier)));
+        ArrowEntity arrow = launchProjectile(p, ArrowEntity.class, scale, stack);
         return arrow;
     }
-    
-    public static void jumpTo(EntityLivingBase j, EntityLivingBase g)
+
+    public static void jumpTo(LivingEntity j, LivingEntity g)
     {
         Utils.setVelocity(j, (g.posX - g.posX) * 0.2, (g.posY - g.posY) * 0.2 + 0.9, (g.posZ - g.posZ) * 0.2);
         KajetansMod.scheduler.scheduleTask(() -> 

+ 11 - 4
src/main/java/me/km/entities/EntityBlackBear.java

@@ -1,12 +1,19 @@
 package me.km.entities;
 
-import net.minecraft.entity.monster.EntityPolarBear;
+import net.minecraft.entity.EntityType;
+import net.minecraft.entity.passive.PolarBearEntity;
 import net.minecraft.world.World;
 
-public class EntityBlackBear extends EntityPolarBear
+public class EntityBlackBear extends PolarBearEntity
 {
-    public EntityBlackBear(World worldIn) 
+    public EntityBlackBear(EntityType type, World w) 
     {
-        super(worldIn);
+        super(EntityType.POLAR_BEAR, w);
     }
+
+    @Override
+    public EntityType<?> getType()
+    {
+        return ModEntities.BLACK_BEAR;
+    }   
 }

+ 11 - 4
src/main/java/me/km/entities/EntityBrownBear.java

@@ -1,12 +1,19 @@
 package me.km.entities;
 
-import net.minecraft.entity.monster.EntityPolarBear;
+import net.minecraft.entity.EntityType;
+import net.minecraft.entity.passive.PolarBearEntity;
 import net.minecraft.world.World;
 
-public class EntityBrownBear extends EntityPolarBear
+public class EntityBrownBear extends PolarBearEntity
 {
-    public EntityBrownBear(World worldIn) 
+    public EntityBrownBear(EntityType type, World w) 
     {
-        super(worldIn);
+        super(EntityType.POLAR_BEAR, w);
     }
+    
+    @Override
+    public EntityType<?> getType()
+    {
+        return ModEntities.BROWN_BEAR;
+    }   
 }

+ 70 - 56
src/main/java/me/km/entities/EntityHuman.java

@@ -1,36 +1,37 @@
 package me.km.entities;
 
-import io.netty.buffer.ByteBuf;
 import java.nio.charset.StandardCharsets;
 import me.km.KajetansMod;
 import me.km.networking.ModPacketHandler;
 import me.km.snuviscript.ScriptEvents;
 import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityCreature;
-import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.CreatureEntity;
+import net.minecraft.entity.EntitySize;
+import net.minecraft.entity.EntityType;
+import net.minecraft.entity.Pose;
 import net.minecraft.entity.SharedMonsterAttributes;
-import net.minecraft.entity.ai.EntityAISwimming;
-import net.minecraft.entity.ai.EntityAIWatchClosest;
-import net.minecraft.entity.ai.EntityAIWatchClosest2;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.SoundEvents;
-import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.entity.ai.goal.LookAtGoal;
+import net.minecraft.entity.ai.goal.LookRandomlyGoal;
+import net.minecraft.entity.ai.goal.SwimGoal;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.nbt.CompoundNBT;
+import net.minecraft.network.PacketBuffer;
 import net.minecraft.util.DamageSource;
 import net.minecraft.util.ResourceLocation;
 import net.minecraft.util.SoundCategory;
 import net.minecraft.util.SoundEvent;
 import net.minecraft.util.text.ITextComponent;
-import net.minecraft.util.text.TextComponentString;
 import net.minecraft.world.World;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraft.util.SoundEvents;
 
-public class EntityHuman extends EntityCreature implements IEntityAdditionalSpawnData
+public class EntityHuman extends CreatureEntity implements IEntityAdditionalSpawnData
 {
     private final static String STEVE = "Steve";
     
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     private ResourceLocation texture;
     
     private String name;
@@ -38,15 +39,17 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
     private byte slim;
     private final float originalWidth;
     private final float originalHeight;
+    private EntitySize size;
     
-    public EntityHuman(World w)
+    public EntityHuman(EntityType<EntityHuman> type, World w)
     {
-        super(w);       
+        super(type, w);  
         this.name = STEVE;
         this.scale = 1;
-        this.originalWidth = width;
-        this.originalHeight = height;
+        this.originalWidth = getWidth();
+        this.originalHeight = getHeight();
         this.slim = 0;
+        size = ModEntities.HUMAN.getSize();
     }
 
     // -------------------------------------------------------------------------
@@ -96,48 +99,48 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
     // texture stuff
     // -------------------------------------------------------------------------
     
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     public ResourceLocation getTexture()
     {
         return texture;
     }
     
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     public void setTexture(ResourceLocation texture)
     {
         this.texture = texture;
     }
     
     @Override
-    public void readEntityFromNBT(NBTTagCompound com)
+    public void readAdditional(CompoundNBT com)
     {
-        super.readEntityFromNBT(com);
-        if(com.hasKey("HumanName"))
+        super.readAdditional(com);
+        if(com.hasUniqueId("HumanName"))
         {
             this.name = com.getString("HumanName");
         }
-        if(com.hasKey("Scale"))
+        if(com.hasUniqueId("Scale"))
         {
             this.scale = com.getFloat("Scale");
-            this.setSize(originalWidth * scale, originalHeight * scale);
+            setSize(originalWidth * scale, originalHeight * scale);
         }
-        if(com.hasKey("Slim"))
+        if(com.hasUniqueId("Slim"))
         {
             this.slim = com.getByte("Slim");
         }
     }
 
     @Override
-    public void writeEntityToNBT(NBTTagCompound com)
+    public void writeAdditional(CompoundNBT com)
     {
-        super.writeEntityToNBT(com);
-        com.setString("HumanName", name);
-        com.setFloat("Scale", scale);
-        com.setByte("Slim", slim);
+        super.writeAdditional(com);
+        com.putString("HumanName", name);
+        com.putFloat("Scale", scale);
+        com.putByte("Slim", slim);
     }
     
     @Override
-    public void writeSpawnData(ByteBuf buf) 
+    public void writeSpawnData(PacketBuffer buf) 
     {
         byte[] b = name.getBytes(StandardCharsets.UTF_8);
         buf.writeInt(b.length);
@@ -147,13 +150,13 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
     }
 
     @Override
-    public void readSpawnData(ByteBuf buf) 
+    public void readSpawnData(PacketBuffer buf) 
     {
         int length = buf.readInt();
         name = buf.readBytes(length).toString(StandardCharsets.UTF_8);
         setTexture(HumanSkinLoader.INSTANCE.getTexture(name, loc -> setTexture(loc)));
         scale = buf.readFloat();
-        this.setSize(originalWidth * scale, originalHeight * scale);
+        setSize(originalWidth * scale, originalHeight * scale);
         slim = buf.readByte();
     }
     
@@ -179,27 +182,27 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
     {
         if(source == DamageSource.OUT_OF_WORLD)
         {
-            this.setDead();
+            this.remove();
             return false;
         }
         if(!world.isRemote)
         {
             Entity ent = source.getTrueSource();
-            if(KajetansMod.scripts != null && ent instanceof EntityPlayer)
+            if(KajetansMod.scripts != null && ent instanceof PlayerEntity)
             {
-                ScriptEvents.onHumanHurt((EntityPlayer) ent, this);
+                ScriptEvents.onHumanHurt((PlayerEntity) ent, this);
             }
         }
         return false;
     }
-
+    
     @Override
-    protected void initEntityAI()
+    protected void registerGoals() 
     {
-        this.tasks.addTask(0, new EntityAISwimming(this));
-        this.tasks.addTask(1, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
-        this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
-    }
+        this.goalSelector.addGoal(0, new SwimGoal(this));
+        this.goalSelector.addGoal(1, new LookAtGoal(this, PlayerEntity.class, 6.0F));
+        this.goalSelector.addGoal(2, new LookRandomlyGoal(this));
+   }
     
     public void setSkinName(String name)
     {
@@ -216,12 +219,12 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
     }
 
     @Override
-    protected void applyEntityAttributes()
+    protected void registerAttributes()
     {
-        super.applyEntityAttributes();
-        this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(1);
-        this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.1d);
-        this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_SPEED);
+        super.registerAttributes();
+        this.getAttributes().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(1);
+        this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.1d);
+        this.getAttributes().registerAttribute(SharedMonsterAttributes.ATTACK_SPEED);
     }
 
     @Override
@@ -270,7 +273,7 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
     @Override
     public float getAIMoveSpeed()
     {
-        return (float) this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue();
+        return (float) this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getValue();
     }
 
     @Override
@@ -279,7 +282,7 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
         return heightIn > 4 ? SoundEvents.ENTITY_PLAYER_BIG_FALL : SoundEvents.ENTITY_PLAYER_SMALL_FALL;
     }
 
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     @Override
     public boolean getAlwaysRenderNameTagForRender()
     {
@@ -289,14 +292,14 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
     @Override
     public ITextComponent getDisplayName()
     {
-        return new TextComponentString(getName());
+        return getName();
     }
-    
+
     @Override
-    public float getEyeHeight()
+    public float getEyeHeight(Pose p_213307_1_)
     {
         float f = getDefaultEyeHeight();
-        if(this.height == 1.65F)
+        if(getHeight() == 1.65F)
         {
             f -= 0.08F;
         }
@@ -308,10 +311,21 @@ public class EntityHuman extends EntityCreature implements IEntityAdditionalSpaw
     {
         return 1.62F;
     }
-    
+
     @Override
-    protected boolean canDespawn()
+    public boolean canDespawn(double distanceToClosestPlayer)
     {
         return false;
     }
+
+    @Override
+    public EntitySize getSize(Pose poseIn)
+    {
+        return size;
+    }
+    
+    public void setSize(float w, float h)
+    {
+        size = EntitySize.fixed(w, h);
+    }
 }

+ 22 - 32
src/main/java/me/km/entities/EntityItemProjectile.java

@@ -5,23 +5,23 @@ import me.km.KajetansMod;
 import me.km.snuviscript.ScriptEvents;
 import me.km.utils.ReflectionUtils;
 import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.LivingEntity;
 import net.minecraft.entity.IProjectile;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.item.ItemEntity;
+import net.minecraft.entity.player.PlayerEntity;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.DamageSource;
 import net.minecraft.util.math.AxisAlignedBB;
 import net.minecraft.util.math.MathHelper;
 import net.minecraft.util.math.Vec3d;
 
-public class EntityItemProjectile extends EntityItem implements IProjectile
+public class EntityItemProjectile extends ItemEntity implements IProjectile
 {
-    private final EntityLivingBase thrower;
+    private final LivingEntity thrower;
     private boolean noHit;
     private final float damage;
 
-    public EntityItemProjectile(EntityLivingBase thrower, ItemStack stack, float damage) 
+    public EntityItemProjectile(LivingEntity thrower, ItemStack stack, float damage) 
     {
         super(thrower.world, thrower.posX, thrower.posY + thrower.getEyeHeight() - 0.1d, thrower.posZ, stack);
         this.thrower = thrower;
@@ -30,29 +30,25 @@ public class EntityItemProjectile extends EntityItem implements IProjectile
         this.damage = damage;
     }
     
-    public EntityItemProjectile(EntityLivingBase thrower, ItemStack stack) 
+    public EntityItemProjectile(LivingEntity thrower, ItemStack stack) 
     {
         this(thrower, stack, -1);
     }
 
-    public EntityLivingBase getItemThrower() 
+    public LivingEntity getItemThrower() 
     {
         return thrower;
     }
 
-    public void setHeadingFromThrower(Entity entityThrower, float rotationPitchIn, float rotationYawIn, float pitchOffset, float velocity, float inaccuracy)
+    public void setHeadingFromThrower(Entity thrower, float rotationPitchIn, float rotationYawIn, float pitchOffset, float velocity, float inaccuracy)
     {
         float f = -MathHelper.sin(rotationYawIn * 0.017453292F) * MathHelper.cos(rotationPitchIn * 0.017453292F);
         float f1 = -MathHelper.sin((rotationPitchIn + pitchOffset) * 0.017453292F);
         float f2 = MathHelper.cos(rotationYawIn * 0.017453292F) * MathHelper.cos(rotationPitchIn * 0.017453292F);
         this.shoot(f, f1, f2, velocity, inaccuracy);
-        this.motionX += entityThrower.motionX;
-        this.motionZ += entityThrower.motionZ;
 
-        if (!entityThrower.onGround)
-        {
-            this.motionY += entityThrower.motionY;
-        }
+        double y = thrower.onGround ? 0.0 : thrower.getMotion().getY();
+        this.setMotion(this.getMotion().add(thrower.getMotion().getX(), y, thrower.getMotion().getZ()));
     }
     
     public void shoot(Entity shooter, float pitch, float yaw, float velocity, float inaccuracy)
@@ -61,13 +57,9 @@ public class EntityItemProjectile extends EntityItem implements IProjectile
         float f1 = -MathHelper.sin(pitch * 0.017453292F);
         float f2 = MathHelper.cos(yaw * 0.017453292F) * MathHelper.cos(pitch * 0.017453292F);
         this.shoot(f, f1, f2, velocity, inaccuracy);
-        this.motionX += shooter.motionX;
-        this.motionZ += shooter.motionZ;
-
-        if(!shooter.onGround)
-        {
-            this.motionY += shooter.motionY;
-        }
+        
+        double y = shooter.onGround ? 0.0 : shooter.getMotion().getY();
+        this.setMotion(this.getMotion().add(shooter.getMotion().getX(), y, shooter.getMotion().getZ()));
     }
     
     @Override
@@ -83,9 +75,7 @@ public class EntityItemProjectile extends EntityItem implements IProjectile
         x = x * (double)velocity;
         y = y * (double)velocity;
         z = z * (double)velocity;
-        this.motionX = x;
-        this.motionY = y;
-        this.motionZ = z;
+        this.setMotion(x, y, z);
         float f1 = MathHelper.sqrt(x * x + z * z);
         this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI));
         this.rotationPitch = (float)(MathHelper.atan2(y, (double)f1) * (180D / Math.PI));
@@ -94,9 +84,9 @@ public class EntityItemProjectile extends EntityItem implements IProjectile
     }
 
     @Override
-    public void onUpdate() 
+    public void tick() 
     {
-        super.onUpdate();
+        super.tick();
         if(noHit)
         {
             if(this.onGround)
@@ -106,8 +96,8 @@ public class EntityItemProjectile extends EntityItem implements IProjectile
                 return;
             }
             
-            float fw = this.width / 2;
-            float fh = this.height / 2;
+            float fw = this.getWidth() / 2;
+            float fh = this.getHeight() / 2;
             List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, 
                     new AxisAlignedBB(prevPosX, prevPosY, prevPosZ, posX, posY, posZ).expand(fw, fh, fw));
             if(list.isEmpty())
@@ -126,7 +116,7 @@ public class EntityItemProjectile extends EntityItem implements IProjectile
                     return true;
                 }
                 // size of the projectile is 0.25 x 0.25
-                return ent.getEntityBoundingBox().grow(0.25f).calculateIntercept(oldV, newV) == null;
+                return !ent.getBoundingBox().grow(0.25f).intersects(oldV, newV);
             });
             if(!list.isEmpty())
             {
@@ -141,9 +131,9 @@ public class EntityItemProjectile extends EntityItem implements IProjectile
     {
         if(damage == -1)
         {
-            if(KajetansMod.scripts != null && thrower instanceof EntityPlayer)
+            if(KajetansMod.scripts != null && thrower instanceof PlayerEntity)
             {
-                ScriptEvents.onEntityItemProjectileHit(this, (EntityPlayer) thrower, this.getItem(), list);
+                ScriptEvents.onEntityItemProjectileHit(this, (PlayerEntity) thrower, this.getItem(), list);
             }
         }
         else

+ 53 - 42
src/main/java/me/km/entities/EntityNobody.java

@@ -1,38 +1,41 @@
 package me.km.entities;
 
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
+import net.minecraft.block.BlockState;
 import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityType;
 import net.minecraft.entity.MoverType;
-import net.minecraft.entity.effect.EntityLightningBolt;
-import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.entity.effect.LightningBoltEntity;
+import net.minecraft.nbt.CompoundNBT;
+import net.minecraft.network.IPacket;
+import net.minecraft.network.play.server.SSpawnObjectPacket;
 import net.minecraft.util.SoundEvent;
 import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Vec3d;
+import net.minecraft.util.text.ITextComponent;
+import net.minecraft.util.text.StringTextComponent;
 import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
 public class EntityNobody extends Entity
 {
-    public EntityNobody(World w)
+    public EntityNobody(EntityType<EntityNobody> type, World w)
     {
-        super(w);
+        super(type, w);
     }
 
     @Override
-    public void onUpdate()
+    public void tick()
     {
-        this.onEntityUpdate();
+        this.baseTick();
     }
 
     @Override
-    public void onEntityUpdate()
+    public void baseTick()
     {
-        this.world.profiler.startSection("entityBaseTick");
-
-        if(this.isRiding() && this.getRidingEntity().isDead)
+        if(this.isPassenger() && this.getRidingEntity().removed) 
         {
-            this.dismountRidingEntity();
+            this.stopRiding();
         }
 
         if(this.rideCooldown > 0)
@@ -46,11 +49,10 @@ public class EntityNobody extends Entity
         }
 
         this.firstUpdate = false;
-        this.world.profiler.endSection();
     }
 
     @Override
-    public void move(MoverType type, double x, double y, double z)
+    public void move(MoverType type, Vec3d pos)
     {
     }
 
@@ -93,7 +95,7 @@ public class EntityNobody extends Entity
     }
 
     @Override
-    protected void updateFallState(double y, boolean onGroundIn, IBlockState state, BlockPos pos)
+    protected void updateFallState(double y, boolean onGroundIn, BlockState state, BlockPos pos)
     {
     }
 
@@ -114,12 +116,6 @@ public class EntityNobody extends Entity
         return false;
     }
 
-    @Override
-    public boolean isOverWater()
-    {
-        return false;
-    }
-
     @Override
     public boolean handleWaterMovement()
     {
@@ -140,13 +136,7 @@ public class EntityNobody extends Entity
     protected void createRunningParticles()
     {
     }
-
-    @Override
-    public boolean isInsideOfMaterial(Material materialIn)
-    {
-        return false;
-    }
-
+    
     @Override
     public boolean isInLava()
     {
@@ -154,11 +144,11 @@ public class EntityNobody extends Entity
     }
 
     @Override
-    public void moveRelative(float strafe, float up, float forward, float friction)
+    public void moveRelative(float p_213309_1_, Vec3d relative)
     {
     }
 
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     @Override
     public int getBrightnessForRender()
     {
@@ -187,24 +177,23 @@ public class EntityNobody extends Entity
     }
 
     @Override
-    public void onStruckByLightning(EntityLightningBolt lightningBolt)
+    public void onStruckByLightning(LightningBoltEntity lightningBolt)
     {
     }
 
     @Override
-    protected boolean pushOutOfBlocks(double x, double y, double z)
+    protected void pushOutOfBlocks(double x, double y, double z)
     {
-        return false;
     }
 
     @Override
-    public String getName()
+    public ITextComponent getName()
     {
         if(this.hasCustomName())
         {
-            return this.getCustomNameTag();
+            return this.getCustomName();
         }
-        return "Nobody";
+        return new StringTextComponent("Nobody");
     }
 
     @Override
@@ -214,16 +203,38 @@ public class EntityNobody extends Entity
     }
 
     @Override
-    protected void entityInit() {
+    protected void registerData()
+    {
+        
+    }
+
+    @Override
+    protected void readAdditional(CompoundNBT nbttc)
+    {
+        
+    }
+
+    @Override
+    protected void writeAdditional(CompoundNBT nbttc)
+    {
+        
+    }
+
+    @Override
+    public CompoundNBT serializeNBT()
+    {
+        return new CompoundNBT();
     }
 
     @Override
-    protected void readEntityFromNBT(NBTTagCompound compound) 
+    public void deserializeNBT(CompoundNBT t)
     {
+        
     }
 
     @Override
-    protected void writeEntityToNBT(NBTTagCompound compound) 
+    public IPacket<?> createSpawnPacket()
     {
+        return new SSpawnObjectPacket(this);
     }
 }

+ 13 - 13
src/main/java/me/km/entities/HumanSkinLoader.java

@@ -1,6 +1,5 @@
 package me.km.entities;
 
-import java.awt.image.BufferedImage;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.ArrayList;
@@ -9,14 +8,15 @@ import java.util.HashSet;
 import java.util.function.Consumer;
 import javax.imageio.ImageIO;
 import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.ImageBufferDownload;
+import net.minecraft.client.renderer.DownloadImageBuffer;
 import net.minecraft.client.renderer.texture.DynamicTexture;
+import net.minecraft.client.renderer.texture.NativeImage;
 import net.minecraft.client.renderer.texture.TextureManager;
 import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
-@SideOnly(Side.CLIENT)
+@OnlyIn(Dist.CLIENT)
 public class HumanSkinLoader
 {
     public final static HumanSkinLoader INSTANCE = new HumanSkinLoader();
@@ -29,15 +29,15 @@ public class HumanSkinLoader
     private final HashMap<String, ArrayList<Consumer<ResourceLocation>>> queue;
     
     private final TextureManager manager;
-    private final ImageBufferDownload converter;
+    private final DownloadImageBuffer converter;
     
     public HumanSkinLoader()
     {
         this.skins = new HashMap<>();
         this.loading = new HashSet<>();
         this.queue = new HashMap<>();
-        this.manager = Minecraft.getMinecraft().getRenderManager().renderEngine;
-        this.converter = new ImageBufferDownload();
+        this.manager = Minecraft.getInstance().getRenderManager().textureManager;
+        this.converter = new DownloadImageBuffer();
     }
     
     public ResourceLocation getTexture(String name, Consumer<ResourceLocation> delayed)
@@ -78,7 +78,7 @@ public class HumanSkinLoader
         return loc;
     }
     
-    private void downloadSkin(String name, Consumer<BufferedImage> delayed)
+    private void downloadSkin(String name, Consumer<NativeImage> delayed)
     {
         new Thread(() -> 
         {
@@ -87,7 +87,7 @@ public class HumanSkinLoader
             {
                 //httpurlconnection = (HttpURLConnection)(new URL("http://skins.minecraft.net/MinecraftSkins/" + name + ".png"))
                 httpurlconnection = (HttpURLConnection) (new URL("http://skins.hammerle.me/" + name + ".png"))
-                        .openConnection(Minecraft.getMinecraft().getProxy());
+                        .openConnection(Minecraft.getInstance().getProxy());
                 httpurlconnection.setDoInput(true);
                 httpurlconnection.setDoOutput(false);
                 httpurlconnection.connect();
@@ -99,7 +99,7 @@ public class HumanSkinLoader
                     //System.out.println("https://crafatar.com/skins/" + name + ".png");
                     httpurlconnection.disconnect();
                     httpurlconnection = (HttpURLConnection) (new URL("https://crafatar.com/skins/" + name + ".png"))
-                            .openConnection(Minecraft.getMinecraft().getProxy());
+                            .openConnection(Minecraft.getInstance().getProxy());
                     httpurlconnection.setDoInput(true);
                     httpurlconnection.setDoOutput(false);
                     httpurlconnection.connect();
@@ -111,8 +111,8 @@ public class HumanSkinLoader
                     }
                 }
                 
-                BufferedImage image = converter.parseUserSkin(ImageIO.read(httpurlconnection.getInputStream()));
-                Minecraft.getMinecraft().addScheduledTask(() -> delayed.accept(image));
+                NativeImage image = converter.parseUserSkin(NativeImage.read(httpurlconnection.getInputStream()));
+                Minecraft.getInstance().enqueue(() -> delayed.accept(image));
             }
             catch (Exception ex)
             {

+ 49 - 28
src/main/java/me/km/entities/ModEntities.java

@@ -1,41 +1,62 @@
 package me.km.entities;
 
 import me.km.KajetansMod;
-import net.minecraft.client.renderer.entity.Render;
-import net.minecraft.entity.Entity;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.common.registry.EntityRegistry;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraft.entity.EntityClassification;
+import net.minecraft.entity.EntityType;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
+import net.minecraftforge.fml.client.registry.RenderingRegistry;
+import net.minecraftforge.registries.IForgeRegistry;
 
 public class ModEntities 
 {
-    public static void initServer() 
-    {
-        register(1, EntityBrownBear.class, "BrownBear", "bear/brownbear");
-        register(2, EntityBlackBear.class, "BlackBear", "bear/blackbear");
-        register(3, EntityHuman.class, "Human", "human");
-        register(4, EntityNobody.class, "Nobody", "nobody");
-    }
+    public static final EntityType<EntityHuman> HUMAN = 
+            (EntityType<EntityHuman>) EntityType.Builder.create(EntityHuman::new, EntityClassification.CREATURE)
+                    .size(0.6F, 1.8F)
+                    .build(String.format("%s:human", KajetansMod.MODID))
+                    .setRegistryName(KajetansMod.MODID, "human");
+    public static final EntityType<EntityNobody> NOBODY = 
+            (EntityType<EntityNobody>) EntityType.Builder.create(EntityNobody::new, EntityClassification.MISC)
+                    .size(0.0f, 0.0f)
+                    .build(String.format("%s:nobody", KajetansMod.MODID))
+                    .setRegistryName(KajetansMod.MODID, "nobody");
+    public static final EntityType<EntityBrownBear> BROWN_BEAR = 
+            (EntityType<EntityBrownBear>) EntityType.Builder.create(EntityBrownBear::new, EntityClassification.CREATURE)
+                    .size(1.4f, 1.4f)
+                    .build(String.format("%s:bear/brownbear", KajetansMod.MODID))
+                    .setRegistryName(KajetansMod.MODID, "bear/brownbear");
+    public static final EntityType<EntityBlackBear> BLACK_BEAR = 
+            (EntityType<EntityBlackBear>) EntityType.Builder.create(EntityBlackBear::new, EntityClassification.CREATURE)
+                    .size(1.4f, 1.4f)
+                    .build(String.format("%s:bear/blackbear", KajetansMod.MODID))
+                    .setRegistryName(KajetansMod.MODID, "bear/blackbear");
     
-    @SideOnly(Side.CLIENT)
-    public static void initClient() 
+    public static void init(IForgeRegistry<EntityType<?>> r)
     {
-        register(1, EntityBrownBear.class, "BrownBear", "bear/brownbear", new RenderBrownBear());
-        register(2, EntityBlackBear.class, "BlackBear", "bear/blackbear", new RenderBlackBear());
-        register(3, EntityHuman.class, "Human", "human", new RenderHuman());
-        register(4, EntityNobody.class, "Nobody", "nobody", new RenderNobody());
-    }
-
-    @SideOnly(Side.CLIENT)
-    private static void register(int id, Class<? extends Entity> c, String name, String path, Render<? extends Entity> r) 
-    {
-        register(id, c, name, path);
-        KajetansMod.proxy.registerEntityRenderer(c, r);
+        r.register(HUMAN);
+        r.register(NOBODY);
+        r.register(BROWN_BEAR);
+        r.register(BLACK_BEAR); 
     }
     
-    private static void register(int id, Class<? extends Entity> c, String name, String path) 
+    @OnlyIn(Dist.CLIENT)
+    public static void initClient() 
     {
-        EntityRegistry.registerModEntity(new ResourceLocation(KajetansMod.MODID + ":" + path), c, name, id, KajetansMod.instance, 144, 2, true);
+        RenderingRegistry.registerEntityRenderingHandler(EntityBrownBear.class, (rm) -> 
+        {
+            return new RenderBrownBear();
+        });
+        RenderingRegistry.registerEntityRenderingHandler(EntityBlackBear.class, (rm) -> 
+        {
+            return new RenderBlackBear();
+        });
+        RenderingRegistry.registerEntityRenderingHandler(EntityHuman.class, (rm) -> 
+        {
+            return new RenderHuman();
+        });
+        RenderingRegistry.registerEntityRenderingHandler(EntityNobody.class, (rm) -> 
+        {
+            return new RenderNobody();
+        });
     }
 }

+ 11 - 16
src/main/java/me/km/entities/ModelHuman.java

@@ -1,10 +1,9 @@
 package me.km.entities;
 
-import net.minecraft.client.model.ModelPlayer;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.entity.Entity;
+import com.mojang.blaze3d.platform.GlStateManager;
+import net.minecraft.client.renderer.entity.model.PlayerModel;
 
-public class ModelHuman extends ModelPlayer
+public class ModelHuman extends PlayerModel<EntityHuman>
 {
     public ModelHuman(float modelSize, boolean smallArmsIn) 
     {
@@ -12,21 +11,17 @@ public class ModelHuman extends ModelPlayer
     }
     
     @Override
-    public void render(Entity ent, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
+    public void render(EntityHuman ent, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
     {
-        this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, ent);
+        this.setRotationAngles(ent, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
         GlStateManager.pushMatrix();
-        
-        if(ent.isSneaking())
-        {
-            GlStateManager.translate(0.0F, 0.2F, 0.0F);
-        }
 
-        float factor = ((EntityHuman) ent).getScale();
-        GlStateManager.translate(0.0F, -1.5f * factor + 1.5f, 0.0F);
-        GlStateManager.scale(factor, factor, factor);
-        this.bipedHead.render(scale);
-        this.bipedBody.render(scale);
+        float factor = ent.getScale();
+        GlStateManager.translatef(0.0F, -1.5f * factor + 1.5f, 0.0F);
+        GlStateManager.scalef(factor, factor, factor);
+
+        this.field_78116_c.render(scale);
+        this.field_78115_e.render(scale);
         this.bipedRightArm.render(scale);
         this.bipedLeftArm.render(scale);
         this.bipedRightLeg.render(scale);

+ 12 - 18
src/main/java/me/km/entities/RenderBlackBear.java

@@ -1,22 +1,22 @@
 package me.km.entities;
 
+import com.mojang.blaze3d.platform.GlStateManager;
 import me.km.KajetansMod;
 import net.minecraft.client.Minecraft;
-import net.minecraft.client.model.ModelPolarBear;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.client.renderer.entity.RenderLiving;
+import net.minecraft.client.renderer.entity.MobRenderer;
+import net.minecraft.client.renderer.entity.model.PolarBearModel;
 import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
-@SideOnly(Side.CLIENT)
-public class RenderBlackBear extends RenderLiving<EntityBlackBear>
+@OnlyIn(Dist.CLIENT)
+public class RenderBlackBear extends MobRenderer<EntityBlackBear, PolarBearModel<EntityBlackBear>>
 {
     private static final ResourceLocation BLACK_BEAR_TEXTURE = new ResourceLocation(KajetansMod.MODID + ":textures/entity/bear/blackbear.png");
 
     public RenderBlackBear()
     {
-        super(Minecraft.getMinecraft().getRenderManager(), new ModelPolarBear(), 0.7F);
+        super(Minecraft.getInstance().getRenderManager(), new PolarBearModel<>(), 0.9F);
     }
 
     @Override
@@ -26,15 +26,9 @@ public class RenderBlackBear extends RenderLiving<EntityBlackBear>
     }
 
     @Override
-    public void doRender(EntityBlackBear entity, double x, double y, double z, float entityYaw, float partialTicks)
+    protected void preRenderCallback(EntityBlackBear ent, float partialTickTime)
     {
-        super.doRender(entity, x, y, z, entityYaw, partialTicks);
+        GlStateManager.scalef(1.2F, 1.2F, 1.2F);
+        super.preRenderCallback(ent, partialTickTime);
     }
-
-    @Override
-    protected void preRenderCallback(EntityBlackBear entitylivingbaseIn, float partialTickTime)
-    {
-        GlStateManager.scale(1.2F, 1.2F, 1.2F);
-        super.preRenderCallback(entitylivingbaseIn, partialTickTime);
-    }
-}
+}

+ 14 - 20
src/main/java/me/km/entities/RenderBrownBear.java

@@ -1,40 +1,34 @@
 package me.km.entities;
 
+import com.mojang.blaze3d.platform.GlStateManager;
 import me.km.KajetansMod;
 import net.minecraft.client.Minecraft;
-import net.minecraft.client.model.ModelPolarBear;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.client.renderer.entity.RenderLiving;
+import net.minecraft.client.renderer.entity.MobRenderer;
+import net.minecraft.client.renderer.entity.model.PolarBearModel;
 import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
-@SideOnly(Side.CLIENT)
-public class RenderBrownBear extends RenderLiving<EntityBrownBear>
+@OnlyIn(Dist.CLIENT)
+public class RenderBrownBear extends MobRenderer<EntityBrownBear, PolarBearModel<EntityBrownBear>>
 {
-    private static final ResourceLocation BROWN_BEAR_TEXTURE = new ResourceLocation(KajetansMod.MODID + ":textures/entity/bear/brownbear.png");
+    private static final ResourceLocation BLACK_BEAR_TEXTURE = new ResourceLocation(KajetansMod.MODID + ":textures/entity/bear/brownbear.png");
 
     public RenderBrownBear()
     {
-        super(Minecraft.getMinecraft().getRenderManager(), new ModelPolarBear(), 0.7F);
+        super(Minecraft.getInstance().getRenderManager(), new PolarBearModel<>(), 0.9F);
     }
 
     @Override
     protected ResourceLocation getEntityTexture(EntityBrownBear entity)
     {
-        return BROWN_BEAR_TEXTURE;
+        return BLACK_BEAR_TEXTURE;
     }
 
     @Override
-    public void doRender(EntityBrownBear entity, double x, double y, double z, float entityYaw, float partialTicks)
+    protected void preRenderCallback(EntityBrownBear ent, float partialTickTime)
     {
-        super.doRender(entity, x, y, z, entityYaw, partialTicks);
+        GlStateManager.scalef(1.2F, 1.2F, 1.2F);
+        super.preRenderCallback(ent, partialTickTime);
     }
-
-    @Override
-    protected void preRenderCallback(EntityBrownBear entitylivingbaseIn, float partialTickTime)
-    {
-        GlStateManager.scale(1.2F, 1.2F, 1.2F);
-        super.preRenderCallback(entitylivingbaseIn, partialTickTime);
-    }
-}
+}

+ 81 - 106
src/main/java/me/km/entities/RenderHuman.java

@@ -1,156 +1,131 @@
 package me.km.entities;
 
+import com.mojang.blaze3d.platform.GlStateManager;
 import net.minecraft.client.Minecraft;
-import net.minecraft.client.model.ModelBiped;
-import net.minecraft.client.model.ModelPlayer;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.client.renderer.entity.RenderLivingBase;
-import net.minecraft.client.renderer.entity.layers.LayerArrow;
-import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
-import net.minecraft.client.renderer.entity.layers.LayerCustomHead;
-import net.minecraft.client.renderer.entity.layers.LayerElytra;
-import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
-import net.minecraft.item.EnumAction;
+import net.minecraft.client.renderer.entity.LivingRenderer;
+import net.minecraft.client.renderer.entity.layers.ArrowLayer;
+import net.minecraft.client.renderer.entity.layers.BipedArmorLayer;
+import net.minecraft.client.renderer.entity.layers.ElytraLayer;
+import net.minecraft.client.renderer.entity.layers.HeadLayer;
+import net.minecraft.client.renderer.entity.layers.HeldItemLayer;
+import net.minecraft.client.renderer.entity.model.BipedModel;
+import net.minecraft.item.CrossbowItem;
 import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumHandSide;
+import net.minecraft.item.Items;
+import net.minecraft.item.UseAction;
+import net.minecraft.util.Hand;
 import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
-@SideOnly(Side.CLIENT)
-public class RenderHuman extends RenderLivingBase<EntityHuman>
-{ 
-    /** this field is used to indicate the 3-pixel wide arms */
+@OnlyIn(Dist.CLIENT)
+public class RenderHuman extends LivingRenderer<EntityHuman, ModelHuman>
+{
     private final ModelHuman steve;
     private final ModelHuman alex;
 
     public RenderHuman()
     {
-        super(Minecraft.getMinecraft().getRenderManager(), new ModelHuman(0, false), 0.5f);
-        this.addLayer(new LayerBipedArmor(this));
-        this.addLayer(new LayerHeldItem(this));
-        this.addLayer(new LayerArrow(this));
-        this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead));
-        this.addLayer(new LayerElytra(this));
-        
-        this.steve = this.getMainModel();
-        this.alex = new ModelHuman(0, true);
-    }
+        super(Minecraft.getInstance().getRenderManager(), new ModelHuman(0.0f, false), 0.5f);
+        this.addLayer(new BipedArmorLayer<>(this, new BipedModel(0.5F), new BipedModel(1.0F)));
+        this.addLayer(new HeldItemLayer<>(this));
+        this.addLayer(new ArrowLayer<>(this));
+        this.addLayer(new HeadLayer<>(this));
+        this.addLayer(new ElytraLayer<>(this));
 
-    @Override
-    public final ModelHuman getMainModel()
-    {
-        return (ModelHuman) super.getMainModel();
+        this.steve = this.getEntityModel();
+        this.alex = new ModelHuman(0, true);
     }
 
     @Override
-    public void doRender(EntityHuman h, double x, double y, double z, float entityYaw, float partialTicks)
+    public void doRender(EntityHuman ent, double x, double y, double z, float entityYaw, float partialTicks)
     {
-        double d0 = y;
-        if (h.isSneaking())
-        {
-            d0 = y - 0.125D;
-        }
-        this.setModelVisibilities(h);
-        GlStateManager.enableBlendProfile(GlStateManager.Profile.PLAYER_SKIN);
-        if(h.isSlim())
+        this.setModelVisibilities(ent);
+        GlStateManager.setProfile(GlStateManager.Profile.PLAYER_SKIN);
+        if(ent.isSlim())
         {
-            this.mainModel = alex;
-            super.doRender(h, x, d0, z, entityYaw, partialTicks);
-            this.mainModel = steve;
+            this.field_77045_g = alex;
+            super.doRender(ent, x, y, z, entityYaw, partialTicks);
+            this.field_77045_g = steve;
         }
         else
         {
-            super.doRender(h, x, d0, z, entityYaw, partialTicks);
+            super.doRender(ent, x, y, z, entityYaw, partialTicks);
         }
-        GlStateManager.disableBlendProfile(GlStateManager.Profile.PLAYER_SKIN);
+        GlStateManager.unsetProfile(GlStateManager.Profile.PLAYER_SKIN);
     }
 
-    private void setModelVisibilities(EntityHuman h)
+    private void setModelVisibilities(EntityHuman ent)
     {
-        ModelPlayer modelplayer = this.getMainModel();
+        ModelHuman playermodel = this.getEntityModel();
         
-        modelplayer.setVisible(true);
-        modelplayer.bipedHeadwear.showModel = true;
-        modelplayer.bipedBodyWear.showModel = true;
-        modelplayer.bipedLeftLegwear.showModel = true;
-        modelplayer.bipedRightLegwear.showModel = true;
-        modelplayer.bipedLeftArmwear.showModel = true;
-        modelplayer.bipedRightArmwear.showModel = true;
-        modelplayer.isSneak = false;
-        ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
-        ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;
+        playermodel.setVisible(true);
+        playermodel.bipedHeadwear.showModel = true;
+        playermodel.bipedBodyWear.showModel = true;
+        playermodel.bipedLeftLegwear.showModel = true;
+        playermodel.bipedRightLegwear.showModel = true;
+        playermodel.bipedLeftArmwear.showModel = true;
+        playermodel.bipedRightArmwear.showModel = true;
+        playermodel.isSneak = false;
+        ItemStack mainHand = ent.getHeldItemMainhand();
+        ItemStack offHand = ent.getHeldItemOffhand();
+        playermodel.rightArmPose = getArmPose(ent, mainHand, offHand, Hand.MAIN_HAND);
+        playermodel.leftArmPose = getArmPose(ent, mainHand, offHand, Hand.OFF_HAND);
+    }
 
-        ItemStack mainHand = h.getHeldItemMainhand();
-        
-        if (!mainHand.isEmpty())
+    private BipedModel.ArmPose getArmPose(EntityHuman ent, ItemStack mainStack, ItemStack offStack, Hand hand)
+    {
+        BipedModel.ArmPose pose = BipedModel.ArmPose.EMPTY;
+        ItemStack itemstack = hand == Hand.MAIN_HAND ? mainStack : offStack;
+        if(!itemstack.isEmpty())
         {
-            modelbiped$armpose = ModelBiped.ArmPose.ITEM;
-
-            if (h.getItemInUseCount() > 0)
+            pose = BipedModel.ArmPose.ITEM;
+            if(ent.getItemInUseCount() > 0)
             {
-                EnumAction enumaction = mainHand.getItemUseAction();
-
-                if (enumaction == EnumAction.BLOCK)
+                UseAction useaction = itemstack.getUseAction();
+                if(useaction == UseAction.BLOCK)
+                {
+                    pose = BipedModel.ArmPose.BLOCK;
+                }
+                else if(useaction == UseAction.BOW)
+                {
+                    pose = BipedModel.ArmPose.BOW_AND_ARROW;
+                }
+                else if(useaction == UseAction.SPEAR)
                 {
-                    modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
+                    pose = BipedModel.ArmPose.THROW_SPEAR;
                 }
-                else if (enumaction == EnumAction.BOW)
+                else if(useaction == UseAction.CROSSBOW && hand == ent.getActiveHand())
                 {
-                    modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
+                    pose = BipedModel.ArmPose.CROSSBOW_CHARGE;
                 }
             }
-        }
-        
-        ItemStack offHand = h.getHeldItemMainhand();
-
-        if (!offHand.isEmpty())
-        {
-            modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;
-
-            if (h.getItemInUseCount() > 0)
+            else
             {
-                EnumAction enumaction1 = offHand.getItemUseAction();
-
-                if (enumaction1 == EnumAction.BLOCK)
+                if(mainStack.getItem() == Items.CROSSBOW && CrossbowItem.isCharged(mainStack))
                 {
-                    modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
+                    pose = BipedModel.ArmPose.CROSSBOW_HOLD;
                 }
-                // FORGE: fix MC-88356 allow offhand to use bow and arrow animation
-                else if (enumaction1 == EnumAction.BOW)
+
+                if(offStack.getItem() == Items.CROSSBOW && CrossbowItem.isCharged(offStack) && mainStack.getItem().getUseAction(mainStack) == UseAction.NONE)
                 {
-                    modelbiped$armpose1 = ModelBiped.ArmPose.BOW_AND_ARROW;
+                    pose = BipedModel.ArmPose.CROSSBOW_HOLD;
                 }
             }
         }
 
-        if (h.getPrimaryHand() == EnumHandSide.RIGHT)
-        {
-            modelplayer.rightArmPose = modelbiped$armpose;
-            modelplayer.leftArmPose = modelbiped$armpose1;
-        }
-        else
-        {
-            modelplayer.rightArmPose = modelbiped$armpose1;
-            modelplayer.leftArmPose = modelbiped$armpose;
-        }
-    }
-    
-    @Override
-    public ResourceLocation getEntityTexture(EntityHuman h)
-    {
-        return h.getTexture();
+        return pose;
     }
 
     @Override
-    public void transformHeldFull3DItemLayer()
+    public ResourceLocation getEntityTexture(EntityHuman ent)
     {
-        GlStateManager.translate(0.0F, 0.1875F, 0.0F);
+        return ent.getTexture();
     }
 
     @Override
-    protected void preRenderCallback(EntityHuman entitylivingbaseIn, float partialTickTime)
+    protected void preRenderCallback(EntityHuman ent, float partialTickTime)
     {
-        GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
+        GlStateManager.scalef(0.9375F, 0.9375F, 0.9375F);
     }
-}
+}

+ 3 - 3
src/main/java/me/km/entities/RenderNobody.java

@@ -2,16 +2,16 @@ package me.km.entities;
 
 import me.km.KajetansMod;
 import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.entity.Render;
+import net.minecraft.client.renderer.entity.EntityRenderer;
 import net.minecraft.util.ResourceLocation;
 
-public class RenderNobody extends Render<EntityNobody>
+public class RenderNobody extends EntityRenderer<EntityNobody>
 {
     private static final ResourceLocation LOC = new ResourceLocation(KajetansMod.MODID, "nobody");
     
     public RenderNobody()
     {
-        super(Minecraft.getMinecraft().getRenderManager());
+        super(Minecraft.getInstance().getRenderManager());
         super.setRenderOutlines(false);
     }
     

+ 4 - 4
src/main/java/me/km/events/ArrowHitGroundEvent.java

@@ -1,19 +1,19 @@
 package me.km.events;
 
-import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.entity.projectile.ArrowEntity;
 import net.minecraftforge.event.entity.EntityEvent;
 
 public class ArrowHitGroundEvent extends EntityEvent
 {
-    private final EntityArrow arrow;
+    private final ArrowEntity arrow;
     
-    public ArrowHitGroundEvent(EntityArrow arrow) 
+    public ArrowHitGroundEvent(ArrowEntity arrow) 
     {
         super(arrow);
         this.arrow = arrow;
     }
 
-    public EntityArrow getEntityArrow() 
+    public ArrowEntity getArrow() 
     {
         return arrow;
     }

+ 0 - 29
src/main/java/me/km/events/ArrowLaunchEvent.java

@@ -1,29 +0,0 @@
-package me.km.events;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.projectile.EntityArrow;
-import net.minecraft.world.World;
-import net.minecraftforge.event.entity.player.PlayerEvent;
-
-public class ArrowLaunchEvent extends PlayerEvent
-{
-    private final EntityArrow arrow;
-    private final World world;
-    
-    public ArrowLaunchEvent(EntityPlayer player, EntityArrow arrow, World world) 
-    {
-        super(player);
-        this.arrow = arrow;
-        this.world = world;
-    }
-
-    public EntityArrow getEntityArrow() 
-    {
-        return arrow;
-    }
-
-    public World getWorld() 
-    {
-        return world;
-    }
-}

+ 17 - 26
src/main/java/me/km/events/CustomEventCaller.java

@@ -9,24 +9,24 @@ import me.km.KajetansMod;
 import me.km.scoreboard.ScoreboardUtils;
 import me.km.utils.ReflectionUtils;
 import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.LivingEntity;
 import net.minecraft.entity.SharedMonsterAttributes;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.projectile.EntityArrow;
-import net.minecraft.entity.projectile.EntityThrowable;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.entity.projectile.ArrowEntity;
+import net.minecraft.entity.projectile.ThrowableEntity;
 import net.minecraft.util.CombatRules;
 import net.minecraft.util.DamageSource;
 import net.minecraftforge.common.MinecraftForge;
 import net.minecraftforge.event.entity.EntityJoinWorldEvent;
 import net.minecraftforge.event.entity.living.LivingHurtEvent;
-import net.minecraftforge.fml.common.eventhandler.EventPriority;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.eventbus.api.EventPriority;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
 import net.minecraftforge.fml.common.gameevent.TickEvent;
 
 public class CustomEventCaller 
 {
-    private static final ArrayList<EntityArrow> ARROWS = new ArrayList<>();
+    private static final ArrayList<ArrowEntity> ARROWS = new ArrayList<>();
     
     private static final HashMap<Integer, PlayerMoveData> MOVE_DATA = new HashMap<>();
     
@@ -101,21 +101,12 @@ public class CustomEventCaller
     public void onArrowLaunch(EntityJoinWorldEvent e)
     {       
         Entity ent = e.getEntity();
-        if(ent instanceof EntityArrow)
+        if(ent instanceof ThrowableEntity)
         {
-            EntityArrow arrow = (EntityArrow) ent;
-            if(arrow.shootingEntity instanceof EntityPlayer)
+            ThrowableEntity thrown = (ThrowableEntity) ent;
+            if(thrown.getThrower() instanceof PlayerEntity)
             {
-                ARROWS.add(arrow);
-                MinecraftForge.EVENT_BUS.post(new ArrowLaunchEvent((EntityPlayer) arrow.shootingEntity, arrow, e.getWorld()));
-            }
-        }
-        else if(ent instanceof EntityThrowable)
-        {
-            EntityThrowable thrown = (EntityThrowable) ent;
-            if(thrown.getThrower() instanceof EntityPlayer)
-            {
-                MinecraftForge.EVENT_BUS.post(new ThrowableLaunchEvent((EntityPlayer) thrown.getThrower(), thrown, e.getWorld()));
+                MinecraftForge.EVENT_BUS.post(new ThrowableLaunchEvent((PlayerEntity) thrown.getThrower(), thrown, e.getWorld()));
             }
         }
     }
@@ -123,16 +114,16 @@ public class CustomEventCaller
     @SubscribeEvent
     public void onPlayerHurt(LivingHurtEvent e)
     {      
-        if(e.getEntityLiving() instanceof EntityPlayerMP && !(e instanceof PlayerHurtEvent))
+        if(e.getEntityLiving() instanceof ServerPlayerEntity && !(e instanceof PlayerHurtEvent))
         {
-            PlayerHurtEvent hurt = new PlayerHurtEvent((EntityPlayerMP) e.getEntityLiving(), e.getSource(), e.getAmount());
+            PlayerHurtEvent hurt = new PlayerHurtEvent((ServerPlayerEntity) e.getEntityLiving(), e.getSource(), e.getAmount());
             MinecraftForge.EVENT_BUS.post(hurt);
             e.setAmount(hurt.getAmount());
             e.setCanceled(hurt.isCanceled());
         }
     } 
     
-    private float getRealDamage(float damageAmount, DamageSource ds, EntityLivingBase liv)
+    private float getRealDamage(float damageAmount, DamageSource ds, LivingEntity liv)
     {
         if(ds != DamageSource.LAVA && ds != DamageSource.IN_WALL && ds != DamageSource.CRAMMING && ds != DamageSource.DROWN)
         {
@@ -146,7 +137,7 @@ public class CustomEventCaller
             {
                 ReflectionUtils.damageArmor(liv, damageAmount);
                 int armor = liv.getTotalArmorValue();
-                damageAmount = CombatRules.getDamageAfterAbsorb(damageAmount, armor, (float) liv.getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getAttributeValue());
+                damageAmount = CombatRules.getDamageAfterAbsorb(damageAmount, armor, (float) liv.getAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getValue());
             }           
             damageAmount = ReflectionUtils.applyPotionDamageCalculations(liv, ds, damageAmount);
         }
@@ -168,7 +159,7 @@ public class CustomEventCaller
             e.setCanceled(true);
 
             DamageSource ds = e.getSource();
-            EntityLivingBase liv = e.getEntityLiving();
+            LivingEntity liv = e.getEntityLiving();
 
             float damageAmount = getRealDamage(e.getAmount(), ds, liv);
             float f = damageAmount;

+ 5 - 5
src/main/java/me/km/events/PlayerHurtEvent.java

@@ -1,22 +1,22 @@
 package me.km.events;
 
-import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.entity.player.ServerPlayerEntity;
 import net.minecraft.util.DamageSource;
 import net.minecraftforge.event.entity.living.LivingHurtEvent;
-import net.minecraftforge.fml.common.eventhandler.Cancelable;
+import net.minecraftforge.eventbus.api.Cancelable;
 
 @Cancelable
 public class PlayerHurtEvent extends LivingHurtEvent
 {
-    private final EntityPlayerMP p;
+    private final ServerPlayerEntity p;
     
-    public PlayerHurtEvent(EntityPlayerMP p, DamageSource source, float amount) 
+    public PlayerHurtEvent(ServerPlayerEntity p, DamageSource source, float amount) 
     {
         super(p, source, amount);
         this.p = p;
     }
 
-    public EntityPlayerMP getEntityPlayer() 
+    public ServerPlayerEntity getPlayer() 
     {
         return p;
     }

+ 7 - 8
src/main/java/me/km/events/PlayerMoveData.java

@@ -2,25 +2,24 @@ package me.km.events;
 
 import java.util.function.BiPredicate;
 import me.hammerle.snuviscript.code.Script;
-import me.km.KajetansMod;
 import me.km.utils.Location;
 import me.km.snuviscript.ScriptEvents;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.world.World;
+import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.world.IWorld;
 
 public class PlayerMoveData 
 {
     private static int idCounter = 0;
     
     private final Script sc;
-    private final BiPredicate<EntityPlayerMP, Object> c;
+    private final BiPredicate<ServerPlayerEntity, Object> c;
     private final int coolDown;
     private int ticks;
     private int livingTime;
     
     private Object data;
     
-    private final World w;
+    private final IWorld w;
     private final double minX;
     private final double minY;
     private final double minZ;
@@ -30,7 +29,7 @@ public class PlayerMoveData
     
     private final int id;
     
-    private PlayerMoveData(Script sc, BiPredicate<EntityPlayerMP, Object> c, Location l1, Location l2, int cooldown, int livingTime, Object data)
+    private PlayerMoveData(Script sc, BiPredicate<ServerPlayerEntity, Object> c, Location l1, Location l2, int cooldown, int livingTime, Object data)
     {
         this.id = idCounter++;
         this.sc = sc;
@@ -56,7 +55,7 @@ public class PlayerMoveData
         this(sc, null, l1, l2, cooldown, livingTime, null);
     }
     
-    public PlayerMoveData(BiPredicate<EntityPlayerMP, Object> c, Location l1, Location l2, int cooldown, int livingTime, Object data)
+    public PlayerMoveData(BiPredicate<ServerPlayerEntity, Object> c, Location l1, Location l2, int cooldown, int livingTime, Object data)
     {
         this(null, c, l1, l2, cooldown, livingTime, data);
     }
@@ -97,7 +96,7 @@ public class PlayerMoveData
         return false;
     }
     
-    public boolean check(EntityPlayerMP p)    
+    public boolean check(ServerPlayerEntity p)    
     {
         if(p.world != w || p.posX < minX || p.posX > maxX || p.posZ < minZ || p.posZ > maxZ || p.posY < minY || p.posY > maxY)
         {

+ 5 - 5
src/main/java/me/km/events/ThrowableLaunchEvent.java

@@ -1,23 +1,23 @@
 package me.km.events;
 
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.projectile.EntityThrowable;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.projectile.ThrowableEntity;
 import net.minecraft.world.World;
 import net.minecraftforge.event.entity.player.PlayerEvent;
 
 public class ThrowableLaunchEvent extends PlayerEvent 
 {
-    private final EntityThrowable thrown;
+    private final ThrowableEntity thrown;
     private final World world;
     
-    public ThrowableLaunchEvent(EntityPlayer player, EntityThrowable thrown, World world) 
+    public ThrowableLaunchEvent(PlayerEntity player, ThrowableEntity thrown, World world) 
     {
         super(player);
         this.thrown = thrown;
         this.world = world;
     }
 
-    public EntityThrowable getEntityThrowable() 
+    public ThrowableEntity getThrowable() 
     {
         return thrown;
     }

+ 0 - 208
src/main/java/me/km/fluids/BlockFluidBase.java

@@ -1,208 +0,0 @@
-package me.km.fluids;
-
-import java.util.Random;
-import javax.annotation.Nonnull;
-import me.km.KajetansMod;
-import me.km.utils.ReflectionUtils;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.SoundEvents;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumParticleTypes;
-import net.minecraft.util.SoundCategory;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.BlockFluidClassic;
-import net.minecraftforge.fluids.Fluid;
-
-public abstract class BlockFluidBase extends BlockFluidClassic
-{
-    public BlockFluidBase(Fluid fluid, Material material) 
-    {
-        super(fluid, material);
-        this.setRegistryName(fluid.getName());
-        super.setUnlocalizedName(fluid.getUnlocalizedName());
-        super.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
-    }
-    
-    public void registerBlockModel() 
-    {
-        KajetansMod.proxy.registerFluidModel(this);
-    }   
-
-    @Override
-    public void updateTick(@Nonnull World w, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull Random rand)
-    {
-        if(!isSourceBlock(w, pos))
-        {
-            int adjacentSourceBlocks =
-                    (isSourceBlock(w, pos.north()) ? 1 : 0) +
-                    (isSourceBlock(w, pos.south()) ? 1 : 0) +
-                    (isSourceBlock(w, pos.east()) ? 1 : 0) +
-                    (isSourceBlock(w, pos.west()) ? 1 : 0);
-            if (adjacentSourceBlocks >= 2 && (w.getBlockState(pos.up(densityDir)).getMaterial().isSolid() || isSourceBlock(w, pos.up(densityDir))))
-            {
-                w.setBlockState(pos, state.withProperty(LEVEL, 0));
-            }
-        }
-
-        int quantaRemaining = quantaPerBlock - state.getValue(LEVEL);
-        int expQuanta;
-
-        // check adjacent block levels if non-source
-        if(quantaRemaining < quantaPerBlock)
-        {
-            if (w.getBlockState(pos.add( 0, -densityDir,  0)).getBlock() == this ||
-                w.getBlockState(pos.add(-1, -densityDir,  0)).getBlock() == this ||
-                w.getBlockState(pos.add( 1, -densityDir,  0)).getBlock() == this ||
-                w.getBlockState(pos.add( 0, -densityDir, -1)).getBlock() == this ||
-                w.getBlockState(pos.add( 0, -densityDir,  1)).getBlock() == this)
-            {
-                expQuanta = quantaPerBlock - 1;
-            }
-            else
-            {
-                int maxQuanta = -100;
-                maxQuanta = getLargerQuanta(w, pos.add(-1, 0,  0), maxQuanta);
-                maxQuanta = getLargerQuanta(w, pos.add( 1, 0,  0), maxQuanta);
-                maxQuanta = getLargerQuanta(w, pos.add( 0, 0, -1), maxQuanta);
-                maxQuanta = getLargerQuanta(w, pos.add( 0, 0,  1), maxQuanta);
-
-                expQuanta = maxQuanta - 1;
-            }
-
-            // decay calculation
-            if(expQuanta != quantaRemaining)
-            {
-                quantaRemaining = expQuanta;
-
-                if(expQuanta <= 0)
-                {
-                    w.setBlockToAir(pos);
-                }
-                else
-                {
-                    w.setBlockState(pos, state.withProperty(LEVEL, quantaPerBlock - expQuanta), 2);
-                    w.scheduleUpdate(pos, this, tickRate);
-                    w.notifyNeighborsOfStateChange(pos, this, false);
-                }
-            }
-        }
-        // This is a "source" block, set meta to zero, and send a server only update
-        else if(quantaRemaining >= quantaPerBlock)
-        {
-            w.setBlockState(pos, this.getDefaultState(), 2);
-        }
-
-        // Flow vertically if possible
-        if(canDisplace(w, pos.up(densityDir)))
-        {
-            BlockPos bpos = pos.up(densityDir);
-            Block b = w.getBlockState(bpos).getBlock();
-            if(b == Blocks.LAVA || b == Blocks.WATER || b == Blocks.FLOWING_LAVA || b == Blocks.FLOWING_WATER ||
-                (b != this && b instanceof net.minecraftforge.fluids.BlockFluidBase))
-            {
-                w.setBlockState(bpos, getFlownOnMixingBlock(b, ReflectionUtils.getBlockMaterial(b)));
-                this.triggerMixEffects(w, bpos);
-                return;
-            }
-            flowIntoBlock(w, pos.up(densityDir), 1);
-            return;
-        }
-
-        // Flow outward if possible
-        int flowMeta = quantaPerBlock - quantaRemaining + 1;
-        if(flowMeta >= quantaPerBlock)
-        {
-            return;
-        }
-
-        if(isSourceBlock(w, pos) || !isFlowingVertically(w, pos))
-        {
-            if(w.getBlockState(pos.down(densityDir)).getBlock() == this)
-            {
-                flowMeta = 1;
-            }
-            boolean flowTo[] = getOptimalFlowDirections(w, pos);
-
-            if(flowTo[0]) flowIntoBlock(w, pos.add(-1, 0,  0), flowMeta);
-            if(flowTo[1]) flowIntoBlock(w, pos.add( 1, 0,  0), flowMeta);
-            if(flowTo[2]) flowIntoBlock(w, pos.add( 0, 0, -1), flowMeta);
-            if(flowTo[3]) flowIntoBlock(w, pos.add( 0, 0,  1), flowMeta);
-        }
-    }
-    
-    @Override
-    public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
-    {
-        checkForMixing(worldIn, pos, state);
-        super.onBlockAdded(worldIn, pos, state);
-    }
-
-    @Override
-    public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
-    {
-        checkForMixing(worldIn, pos, state);
-        super.neighborChanged(state, worldIn, pos, blockIn, fromPos);
-    }
-    
-    private boolean checkForMixing(World worldIn, BlockPos pos, IBlockState state)
-    {
-        boolean flag = false;
-        Block b = null;
-        for (EnumFacing enumfacing : EnumFacing.values())
-        {
-            if (enumfacing != EnumFacing.DOWN)
-            {
-                b = worldIn.getBlockState(pos.offset(enumfacing)).getBlock();
-                if(b == Blocks.LAVA || b == Blocks.WATER || b == Blocks.FLOWING_LAVA || b == Blocks.FLOWING_WATER ||
-                    (b != this && b instanceof net.minecraftforge.fluids.BlockFluidBase))
-                {
-                    flag = true;
-                    break;
-                }
-            }
-        }
-        if(flag)
-        {
-            Integer integer = state.getValue(LEVEL);
-            if (integer == 0)
-            {
-                worldIn.setBlockState(pos, getStrongMixingBlock(b, ReflectionUtils.getBlockMaterial(b)));
-                this.triggerMixEffects(worldIn, pos);
-                return true;
-            }
-            else
-            {
-                worldIn.setBlockState(pos, getWeakMixingBlock(b, ReflectionUtils.getBlockMaterial(b)));
-                this.triggerMixEffects(worldIn, pos);
-                return true;
-            }
-        }
-
-        return false;
-    }
-    
-    protected abstract IBlockState getStrongMixingBlock(Block b, Material m);
-    
-    protected abstract IBlockState getWeakMixingBlock(Block b, Material m);
-    
-    protected abstract IBlockState getFlownOnMixingBlock(Block b, Material m);
-    
-    protected void triggerMixEffects(World worldIn, BlockPos pos)
-    {
-        double d0 = pos.getX();
-        double d1 = pos.getY();
-        double d2 = pos.getZ();
-        
-        worldIn.playSound(null, pos, SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F);
-
-        for (int i = 0; i < 8; ++i)
-        {
-            worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d0 + Math.random(), d1 + 1.2d, d2 + Math.random(), 0, 0, 0, new int[0]);
-        }
-    }
-}

+ 0 - 63
src/main/java/me/km/fluids/BlockFluidHoney.java

@@ -1,63 +0,0 @@
-package me.km.fluids;
-
-import net.minecraft.block.Block;
-import static net.minecraft.block.BlockColored.COLOR;
-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.init.Blocks;
-import net.minecraft.init.MobEffects;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.potion.PotionEffect;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.Fluid;
-
-public class BlockFluidHoney extends BlockFluidBase
-{
-    public BlockFluidHoney(Fluid fluid, Material material) 
-    {
-        super(fluid, material);
-    }
-    
-    @Override
-    public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) 
-    {
-        super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
-        if(entityIn instanceof EntityLivingBase)
-        {
-            ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 100, 1));
-        }
-    }
-
-    @Override
-    protected IBlockState getStrongMixingBlock(Block b, Material m) 
-    {
-        if(m == Material.LAVA)
-        {
-            return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.BROWN);
-        }
-        return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.YELLOW);
-    }
-
-    @Override
-    protected IBlockState getWeakMixingBlock(Block b, Material m) 
-    {
-        if(m == Material.LAVA)
-        {
-            return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.BROWN);
-        }
-        return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.YELLOW);
-    }
-    
-    @Override
-    protected IBlockState getFlownOnMixingBlock(Block b, Material m) 
-    {
-        if(m == Material.LAVA)
-        {
-            return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.BROWN);
-        }
-        return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.YELLOW);
-    }
-}

+ 0 - 64
src/main/java/me/km/fluids/BlockFluidPoison.java

@@ -1,64 +0,0 @@
-package me.km.fluids;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockColored;
-import static net.minecraft.block.BlockColored.COLOR;
-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.init.Blocks;
-import net.minecraft.init.MobEffects;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.potion.PotionEffect;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.Fluid;
-
-public class BlockFluidPoison extends BlockFluidBase
-{
-    public BlockFluidPoison(Fluid fluid, Material material) 
-    {
-        super(fluid, material);
-    }
-
-    @Override
-    public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) 
-    {
-        super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
-        if(entityIn instanceof EntityLivingBase)
-        {
-            ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.POISON, 100, 1));
-        }
-    }
-
-    @Override
-    protected IBlockState getStrongMixingBlock(Block b, Material m) 
-    {
-        if(m == Material.LAVA)
-        {
-            return Blocks.COBBLESTONE.getDefaultState();
-        }
-        return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.PURPLE);
-    }
-
-    @Override
-    protected IBlockState getWeakMixingBlock(Block b, Material m) 
-    {
-        if(m == Material.LAVA)
-        {
-            return Blocks.COBBLESTONE.getDefaultState();
-        }
-        return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.PURPLE);
-    }
-    
-    @Override
-    protected IBlockState getFlownOnMixingBlock(Block b, Material m) 
-    {
-        if(m == Material.LAVA)
-        {
-            return Blocks.COBBLESTONE.getDefaultState();
-        }
-        return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.PURPLE);
-    }
-}

+ 0 - 28
src/main/java/me/km/fluids/ModFluids.java

@@ -1,28 +0,0 @@
-package me.km.fluids;
-
-import me.km.KajetansMod;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-
-public class ModFluids 
-{
-    public static Fluid poison;
-    public static Fluid honey;
-    
-    public static void init() 
-    {
-        poison = register("poison").setViscosity(2000);
-        honey = register("honey").setViscosity(4000);
-    }
-
-    private static Fluid register(String name) 
-    {
-        Fluid f = new Fluid(name, 
-                new ResourceLocation(KajetansMod.MODID + ":blocks/" + name + "_still"), 
-                new ResourceLocation(KajetansMod.MODID + ":blocks/" + name + "_flow"));
-        FluidRegistry.registerFluid(f);
-        FluidRegistry.addBucketForFluid(f);
-        return f;
-    }
-}

+ 0 - 153
src/main/java/me/km/inventory/ContainerCampFire.java

@@ -1,153 +0,0 @@
-package me.km.inventory;
-
-import me.km.networking.ModPacketHandler;
-import net.minecraft.advancements.CriteriaTriggers;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.IContainerListener;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.inventory.SlotCrafting;
-import net.minecraft.item.ItemStack;
-import net.minecraft.network.play.server.SPacketSetSlot;
-import net.minecraft.network.play.server.SPacketWindowItems;
-import net.minecraft.network.play.server.SPacketWindowProperty;
-import net.minecraft.util.NonNullList;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-public class ContainerCampFire extends Container
-{
-    private final IInventory fireInv;
-    private int[] cookTime;
-
-    public ContainerCampFire(InventoryPlayer pInv, IInventory fireInv)
-    {
-        this.fireInv = fireInv;
-        this.cookTime = new int[3];
-        super.addSlotToContainer(new Slot(fireInv, 0, 52, 17));
-        super.addSlotToContainer(new Slot(fireInv, 1, 52, 35));
-        super.addSlotToContainer(new Slot(fireInv, 2, 52, 53));
-        super.addSlotToContainer(new Slot(fireInv, 3, 108, 17));
-        super.addSlotToContainer(new Slot(fireInv, 4, 108, 35));
-        super.addSlotToContainer(new Slot(fireInv, 5, 108, 53));
-
-        for(int i = 0; i < 3; i++)
-        {
-            for(int j = 0; j < 9; j++)
-            {
-                super.addSlotToContainer(new Slot(pInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
-            }
-        }
-
-        for(int k = 0; k < 9; k++)
-        {
-            super.addSlotToContainer(new Slot(pInv, k, 8 + k * 18, 142));
-        }
-    }
-
-    @Override
-    public void addListener(IContainerListener listener)
-    {
-        super.addListener(listener);
-        listener.sendAllWindowProperties(this, this.fireInv);
-    }
-
-    @Override
-    public void detectAndSendChanges()
-    {
-        super.detectAndSendChanges();
-        for(int i = 0; i < this.listeners.size(); ++i)
-        {
-            IContainerListener icontainerlistener = this.listeners.get(i);
-            if(this.cookTime[0] != this.fireInv.getField(0))
-            {
-                icontainerlistener.sendWindowProperty(this, 0, this.fireInv.getField(0));
-            }
-            if(this.cookTime[1] != this.fireInv.getField(1))
-            {
-                icontainerlistener.sendWindowProperty(this, 1, this.fireInv.getField(1));
-            }
-            if(this.cookTime[2] != this.fireInv.getField(2))
-            {
-                icontainerlistener.sendWindowProperty(this, 2, this.fireInv.getField(2));
-            }
-        }
-        this.cookTime[0] = this.fireInv.getField(0);
-        this.cookTime[1] = this.fireInv.getField(1);
-        this.cookTime[2] = this.fireInv.getField(2);
-    }
-
-    @SideOnly(Side.CLIENT)
-    @Override
-    public void updateProgressBar(int id, int data)
-    {
-        this.fireInv.setField(id, data);
-    }
-
-    @Override
-    public boolean canInteractWith(EntityPlayer p)
-    {
-        return this.fireInv.isUsableByPlayer(p);
-    }
-
-    @Override
-    public ItemStack transferStackInSlot(EntityPlayer p, int index)
-    {
-        return ItemStack.EMPTY;
-    }
-    
-    public void openForPlayer(EntityPlayerMP p)
-    {
-        if(p.openContainer != p.inventoryContainer)
-        {
-            p.closeScreen();
-        }
-        p.getNextWindowId();
-        p.openContainer = this;
-        p.openContainer.windowId = p.currentWindowId;
-        ModPacketHandler.sendCampFireInventory(p, windowId, fireInv.getName());
-        p.openContainer.addListener(new IContainerListener() 
-        {
-            @Override
-            public void sendAllContents(Container containerToSend, NonNullList<ItemStack> itemsList) 
-            {
-                p.connection.sendPacket(new SPacketWindowItems(containerToSend.windowId, itemsList));
-                p.connection.sendPacket(new SPacketSetSlot(-1, -1, p.inventory.getItemStack()));
-            }
-
-            @Override
-            public void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack) 
-            {
-                if(!(containerToSend.getSlot(slotInd) instanceof SlotCrafting))
-                {
-                    if(containerToSend == p.inventoryContainer)
-                    {
-                        CriteriaTriggers.INVENTORY_CHANGED.trigger(p, p.inventory);
-                    }
-                    if(!p.isChangingQuantityOnly)
-                    {
-                        p.connection.sendPacket(new SPacketSetSlot(containerToSend.windowId, slotInd, stack));
-                    }
-                }
-            }
-
-            @Override
-            public void sendWindowProperty(Container containerIn, int varToUpdate, int newValue) 
-            {
-                p.connection.sendPacket(new SPacketWindowProperty(containerIn.windowId, varToUpdate, newValue));
-            }
-
-            @Override
-            public void sendAllWindowProperties(Container containerIn, IInventory inventory) 
-            {
-                for(int i = 0; i < inventory.getFieldCount(); i++)
-                {
-                    p.connection.sendPacket(new SPacketWindowProperty(containerIn.windowId, i, inventory.getField(i)));
-                }
-            }
-        });
-    }
-}

+ 16 - 9
src/main/java/me/km/inventory/CustomContainer.java

@@ -1,18 +1,25 @@
 package me.km.inventory;
 
 import me.km.KajetansMod;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.inventory.ClickType;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.inventory.container.ClickType;
 import net.minecraft.item.ItemStack;
+import net.minecraft.util.text.ITextComponent;
 
 public class CustomContainer extends CustomContainerBase
 {
     private boolean canBeClosed;
     
-    public CustomContainer(InventoryBase inv, EntityPlayer p) 
+    public CustomContainer(InventoryBase inv, ServerPlayerEntity p, ITextComponent title) 
     {
-        super(inv, p);
+        super(inv, p, title);
+        canBeClosed = true;
+    }
+    
+    public CustomContainer(InventoryBase inv, PlayerEntity p, ITextComponent title, int id) 
+    {
+        super(inv, p, title, id);
         canBeClosed = true;
     }
     
@@ -55,7 +62,7 @@ public class CustomContainer extends CustomContainerBase
     }
     
     @Override
-    public final ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer p) 
+    public final ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, PlayerEntity p) 
     {
         if(slotId < 0 || slotId >= inv.getSizeInventory())
         {
@@ -69,7 +76,7 @@ public class CustomContainer extends CustomContainerBase
                 if(isServerSide)
                 {
                     //System.out.println("Button was pressed");
-                    EntityPlayerMP player = (EntityPlayerMP) p;
+                    ServerPlayerEntity player = (ServerPlayerEntity) p;
                     canBeClosed = false;
                     onButtonClick(slotId, dragType, clickTypeIn, player);
                     canBeClosed = true;
@@ -79,7 +86,7 @@ public class CustomContainer extends CustomContainerBase
                 if(isServerSide)
                 {
                     //System.out.println("Button was pressed, serverside cancel possible");
-                    EntityPlayerMP player = (EntityPlayerMP) p;
+                    ServerPlayerEntity player = (ServerPlayerEntity) p;
                     canBeClosed = false;
                     if(onButtonClick(slotId, dragType, clickTypeIn, player))
                     {
@@ -93,7 +100,7 @@ public class CustomContainer extends CustomContainerBase
         return ItemStack.EMPTY;
     }  
     
-    public boolean onButtonClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayerMP player)
+    public boolean onButtonClick(int slotId, int dragType, ClickType clickTypeIn, ServerPlayerEntity player)
     {
         return false;
     }

+ 49 - 37
src/main/java/me/km/inventory/CustomContainerBase.java

@@ -2,31 +2,40 @@ package me.km.inventory;
 
 import me.km.networking.ModPacketHandler;
 import net.minecraft.advancements.CriteriaTriggers;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.IContainerListener;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.inventory.SlotCrafting;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.inventory.container.Container;
+import net.minecraft.inventory.container.IContainerListener;
+import net.minecraft.inventory.container.Slot;
+import net.minecraft.inventory.container.CraftingResultSlot;
 import net.minecraft.item.ItemStack;
-import net.minecraft.network.play.server.SPacketSetSlot;
-import net.minecraft.network.play.server.SPacketWindowItems;
+import net.minecraft.network.play.server.SSetSlotPacket;
+import net.minecraft.network.play.server.SWindowItemsPacket;
 import net.minecraft.util.NonNullList;
+import net.minecraft.util.text.ITextComponent;
 
 public abstract class CustomContainerBase extends Container
 {
-    protected final EntityPlayer viewer;
+    protected final PlayerEntity viewer;
     protected final boolean isServerSide;
     protected final InventoryBase inv;
     private final int numRows;
+    private final ITextComponent title;
 
-    protected CustomContainerBase(InventoryBase inv, EntityPlayer viewer)
+    private static int getId(ServerPlayerEntity p)
     {
+        p.getNextWindowId();
+        return p.currentWindowId;
+    }
+    
+    protected CustomContainerBase(InventoryBase inv, PlayerEntity viewer, ITextComponent title, int id)
+    {
+        super(null, id);
         // basic stuff
+        this.title = title;
         this.viewer = viewer;
-        this.isServerSide = viewer instanceof EntityPlayerMP;
+        this.isServerSide = viewer instanceof ServerPlayerEntity;
         this.inv = inv;
         this.numRows = inv.getRows();
         int i = (this.numRows - 4) * 18;
@@ -39,26 +48,36 @@ public abstract class CustomContainerBase extends Container
             {
                 if(inv.isSlotValid(x, y))
                 {
-                    super.addSlotToContainer(new Slot(inv, counter, 8 + x * 18, 18 + y * 18));
+                    super.addSlot(new Slot(inv, counter, 8 + x * 18, 18 + y * 18));
                     counter++;
                 }
             }
         }
 
-        InventoryPlayer pInv = this.viewer.inventory;
+        PlayerInventory pInv = this.viewer.inventory;
         // plaver inventory slots
         for(int y = 0; y < 3; y++)
         {
             for(int x = 0; x < 9; x++)
             {
-                super.addSlotToContainer(new Slot(pInv, x + y * 9 + 9, 8 + x * 18, 103 + y * 18 + i));
+                super.addSlot(new Slot(pInv, x + y * 9 + 9, 8 + x * 18, 103 + y * 18 + i));
             }
         }
         for(int x = 0; x < 9; x++)
         {
-            super.addSlotToContainer(new Slot(pInv, x, 8 + x * 18, 161 + i));
+            super.addSlot(new Slot(pInv, x, 8 + x * 18, 161 + i));
         }
     }
+    
+    protected CustomContainerBase(InventoryBase inv, ServerPlayerEntity viewer, ITextComponent title)
+    {
+        this(inv, viewer, title, getId(viewer));
+    }
+
+    public ITextComponent getTitle()
+    {
+        return title;
+    }
 
     public InventoryBase getInventoryBase() 
     {
@@ -74,36 +93,34 @@ public abstract class CustomContainerBase extends Container
     {
         if(isServerSide)
         {
-            EntityPlayerMP p = (EntityPlayerMP) viewer;
-            if(p.openContainer != p.inventoryContainer)
+            ServerPlayerEntity p = (ServerPlayerEntity) viewer;
+            if(p.openContainer != p.container)
             {
                 p.closeScreen();
             }
-            p.getNextWindowId();
             p.openContainer = this;
-            p.openContainer.windowId = p.currentWindowId;
-            ModPacketHandler.sendCustomInventory(p, windowId, inv);
+            ModPacketHandler.sendCustomInventory(p, windowId, title, inv);
             p.openContainer.addListener(new IContainerListener() 
             {
                 @Override
                 public void sendAllContents(Container containerToSend, NonNullList<ItemStack> itemsList) 
                 {
-                    p.connection.sendPacket(new SPacketWindowItems(containerToSend.windowId, itemsList));
-                    p.connection.sendPacket(new SPacketSetSlot(-1, -1, p.inventory.getItemStack()));
+                    p.connection.sendPacket(new SWindowItemsPacket(containerToSend.windowId, itemsList));
+                    p.connection.sendPacket(new SSetSlotPacket(-1, -1, p.inventory.getItemStack()));
                 }
 
                 @Override
                 public void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack) 
                 {
-                    if(!(containerToSend.getSlot(slotInd) instanceof SlotCrafting))
+                    if(!(containerToSend.getSlot(slotInd) instanceof CraftingResultSlot))
                     {
-                        if(containerToSend == p.inventoryContainer)
+                        if(containerToSend == p.container)
                         {
                             CriteriaTriggers.INVENTORY_CHANGED.trigger(p, p.inventory);
                         }
                         if(!p.isChangingQuantityOnly)
                         {
-                            p.connection.sendPacket(new SPacketSetSlot(containerToSend.windowId, slotInd, stack));
+                            p.connection.sendPacket(new SSetSlotPacket(containerToSend.windowId, slotInd, stack));
                         }
                     }
                 }
@@ -112,24 +129,19 @@ public abstract class CustomContainerBase extends Container
                 public void sendWindowProperty(Container containerIn, int varToUpdate, int newValue) 
                 {
                 }
-
-                @Override
-                public void sendAllWindowProperties(Container containerIn, IInventory inventory) 
-                {
-                }
             });
         }
     }
 
     @Override
-    public boolean canInteractWith(EntityPlayer p)
+    public boolean canInteractWith(PlayerEntity p)
     {
         return this.inv.isUsableByPlayer(p);
     }
 
     // ignore special slots stuff
     @Override
-    public ItemStack transferStackInSlot(EntityPlayer p, int index)
+    public ItemStack transferStackInSlot(PlayerEntity p, int index)
     {
         ItemStack stack = ItemStack.EMPTY;
         Slot slot = this.inventorySlots.get(index);
@@ -206,7 +218,7 @@ public abstract class CustomContainerBase extends Container
                     Slot slot = this.inventorySlots.get(i);
                     ItemStack itemstack = slot.getStack();
 
-                    if (!itemstack.isEmpty() && itemstack.getItem() == stack.getItem() && (!stack.getHasSubtypes() || stack.getMetadata() == itemstack.getMetadata()) && ItemStack.areItemStackTagsEqual(stack, itemstack))
+                    if (!itemstack.isEmpty() && ItemStack.areItemStackTagsEqual(stack, itemstack))
                     {
                         int j = itemstack.getCount() + stack.getCount();
                         int maxSize = Math.min(slot.getSlotStackLimit(), stack.getMaxStackSize());
@@ -273,11 +285,11 @@ public abstract class CustomContainerBase extends Container
                     {
                         if (stack.getCount() > slot1.getSlotStackLimit())
                         {
-                            slot1.putStack(stack.splitStack(slot1.getSlotStackLimit()));
+                            slot1.putStack(stack.split(slot1.getSlotStackLimit()));
                         }
                         else
                         {
-                            slot1.putStack(stack.splitStack(stack.getCount()));
+                            slot1.putStack(stack.split(stack.getCount()));
                         }
 
                         slot1.onSlotChanged();

+ 8 - 8
src/main/java/me/km/inventory/InventoryBase.java

@@ -2,10 +2,10 @@ package me.km.inventory;
 
 import java.util.Arrays;
 import net.minecraft.entity.Entity;
-import net.minecraft.inventory.InventoryBasic;
+import net.minecraft.inventory.Inventory;
 import net.minecraft.item.ItemStack;
 
-public class InventoryBase extends InventoryBasic
+public class InventoryBase extends Inventory
 {
     private final Entity owner;
     private final int allSlots;
@@ -13,9 +13,9 @@ public class InventoryBase extends InventoryBasic
     private final byte[] data;
     private final byte[] smallData;
     
-    public InventoryBase(String title, byte[] data, int slots, int allSlots, Entity owner) 
+    public InventoryBase(byte[] data, int slots, int allSlots, Entity owner) 
     {
-        super(title, true, slots);
+        super(slots);
         this.owner = owner;
         this.allSlots = allSlots;
         this.rows = allSlots / 9 + (allSlots % 9 == 0 ? 0 : 1);
@@ -72,9 +72,9 @@ public class InventoryBase extends InventoryBasic
         return b;
     }
     
-    public InventoryBase(String title, String slots, Entity owner) 
+    public InventoryBase(String slots, Entity owner) 
     {
-        super(title, true, Math.min(54, slots.length() - countZeros(slots)));
+        super(Math.min(54, slots.length() - countZeros(slots)));
         this.owner = owner;
         
         allSlots = Math.min(54, slots.length());
@@ -110,9 +110,9 @@ public class InventoryBase extends InventoryBasic
         this.smallData = deleteZeros(data);
     }
     
-    public InventoryBase(String title, int slots, Entity owner) 
+    public InventoryBase(int slots, Entity owner) 
     {
-        super(title, true, Math.max(9, Math.min(54, ((slots / 9) + ((slots % 9) == 0 ? 0 : 1)) * 9)));
+        super(Math.max(9, Math.min(54, ((slots / 9) + ((slots % 9) == 0 ? 0 : 1)) * 9)));
         this.owner = owner;
         this.allSlots = super.getSizeInventory();
         this.rows = allSlots / 9;

+ 4 - 4
src/main/java/me/km/inventory/InventoryUtils.java

@@ -86,7 +86,7 @@ public class InventoryUtils
         }
         else
         {
-            if(add.isItemDamaged())
+            if(add.isDamaged())
             {
                 int j = getFirstEmptyStack(inv);
                 if(j >= 0)
@@ -132,9 +132,9 @@ public class InventoryUtils
         {
             stack = add.copy();
             stack.setCount(0);
-            if(add.hasTagCompound())
+            if(add.hasTag())
             {
-                stack.setTagCompound(add.getTagCompound().copy());
+                stack.setTag(add.getTag().copy());
             }
             inv.setInventorySlotContents(j, stack);
         }
@@ -181,7 +181,7 @@ public class InventoryUtils
     
     public static boolean stackEqualExact(ItemStack first, ItemStack sec)
     {
-        return first.getItem() == sec.getItem() && (!first.getHasSubtypes() || first.getMetadata() == sec.getMetadata()) && ItemStack.areItemStackTagsEqual(first, sec);
+        return first.getItem() == sec.getItem() && ItemStack.areItemStackTagsEqual(first, sec);
     }
     
     public static int getFirstEmptyStack(IInventory inv)

+ 0 - 24
src/main/java/me/km/items/ItemArmor.java

@@ -1,24 +0,0 @@
-package me.km.items;
-
-import me.km.KajetansMod;
-import net.minecraft.inventory.EntityEquipmentSlot;
-import net.minecraft.item.Item;
-
-public class ItemArmor extends net.minecraft.item.ItemArmor implements ItemModelProvider
-{
-    protected String name;
-
-    public ItemArmor(ArmorMaterial m, EntityEquipmentSlot slot, String name, String local) 
-    {
-        super(m, 0, slot);
-        this.name = name;
-        super.setUnlocalizedName(local);
-        this.setRegistryName(KajetansMod.MODID, name);
-    }
-
-    @Override
-    public void registerItemModel(Item item) 
-    {
-        KajetansMod.proxy.registerItemRenderer(this, 0, name);
-    }
-}

+ 0 - 30
src/main/java/me/km/items/ItemBase.java

@@ -1,30 +0,0 @@
-package me.km.items;
-
-import me.km.KajetansMod;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-
-public class ItemBase extends Item implements ItemModelProvider
-{
-    protected String name;
-
-    public ItemBase(String name, String local) 
-    {
-        this.name = name;
-        super.setUnlocalizedName(local);
-        this.setRegistryName(KajetansMod.MODID, name);
-    }
-
-    @Override
-    public void registerItemModel(Item item) 
-    {
-        KajetansMod.proxy.registerItemRenderer(this, 0, name);
-    }
-    
-    @Override
-    public ItemBase setCreativeTab(CreativeTabs tab) 
-    {
-        super.setCreativeTab(tab);
-        return this;
-    }
-}

+ 0 - 84
src/main/java/me/km/items/ItemBed.java

@@ -1,84 +0,0 @@
-package me.km.items;
-
-import me.km.blocks.ModBlocks;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockBed;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-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.util.math.MathHelper;
-import net.minecraft.world.World;
-
-public class ItemBed extends ItemBase
-{
-    public ItemBed(String name, String local) 
-    {
-        super(name, local);
-        super.setCreativeTab(CreativeTabs.DECORATIONS);
-    }
-
-    @Override
-    public EnumActionResult onItemUse(EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
-    {
-        if(w.isRemote)
-        {
-            return EnumActionResult.SUCCESS;
-        }
-        else if(facing != EnumFacing.UP)
-        {
-            return EnumActionResult.FAIL;
-        }
-        else
-        {
-            IBlockState iblockstate = w.getBlockState(pos);
-            Block block = iblockstate.getBlock();
-            boolean flag = block.isReplaceable(w, pos);
-
-            if (!flag)
-            {
-                pos = pos.up();
-            }
-
-            int i = MathHelper.floor((double)(p.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
-            EnumFacing enumfacing = EnumFacing.getHorizontal(i);
-            BlockPos blockpos = pos.offset(enumfacing);
-            ItemStack itemstack = p.getHeldItem(hand);
-
-            if (p.canPlayerEdit(pos, facing, itemstack) && p.canPlayerEdit(blockpos, facing, itemstack))
-            {
-                IBlockState iblockstate1 = w.getBlockState(blockpos);
-                boolean flag1 = iblockstate1.getBlock().isReplaceable(w, blockpos);
-                boolean flag2 = flag || w.isAirBlock(pos);
-                boolean flag3 = flag1 || w.isAirBlock(blockpos);
-
-                if (flag2 && flag3 && w.getBlockState(pos.down()).isTopSolid() && w.getBlockState(blockpos.down()).isTopSolid())
-                {
-                    IBlockState iblockstate2 = ModBlocks.realHayBed.getDefaultState().withProperty(BlockBed.OCCUPIED, false).withProperty(BlockBed.FACING, enumfacing).withProperty(BlockBed.PART, BlockBed.EnumPartType.FOOT);
-                    w.setBlockState(pos, iblockstate2, 10);
-                    w.setBlockState(blockpos, iblockstate2.withProperty(BlockBed.PART, BlockBed.EnumPartType.HEAD), 10);
-                    w.notifyNeighborsRespectDebug(pos, block, false);
-                    w.notifyNeighborsRespectDebug(blockpos, iblockstate1.getBlock(), false);
-                    SoundType soundtype = iblockstate2.getBlock().getSoundType(iblockstate2, w, pos, p);
-                    w.playSound((EntityPlayer)null, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
-                    itemstack.shrink(1);
-                    return EnumActionResult.SUCCESS;
-                }
-                else
-                {
-                    return EnumActionResult.FAIL;
-                }
-            }
-            else
-            {
-                return EnumActionResult.FAIL;
-            }
-        }
-    }
-}

+ 0 - 32
src/main/java/me/km/items/ItemBlockSpecial.java

@@ -1,32 +0,0 @@
-package me.km.items;
-
-import me.km.KajetansMod;
-import net.minecraft.block.Block;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-
-public class ItemBlockSpecial extends net.minecraft.item.ItemBlockSpecial implements ItemModelProvider
-{
-    protected String name;
-    
-    public ItemBlockSpecial(String registry, String name, String local, Block block) 
-    {
-        super(block);
-        this.name = name;
-        super.setUnlocalizedName(local);
-        this.setRegistryName(KajetansMod.MODID, registry);
-    }
-
-    @Override
-    public void registerItemModel(Item item) 
-    {
-        KajetansMod.proxy.registerItemRenderer(this, 0, name);
-    }
-    
-    @Override
-    public ItemBlockSpecial setCreativeTab(CreativeTabs tab) 
-    {
-        super.setCreativeTab(tab);
-        return this;
-    }
-}

+ 158 - 173
src/main/java/me/km/items/ItemColoredSoup.java

@@ -4,269 +4,254 @@ import java.util.LinkedList;
 import java.util.List;
 import me.km.blocks.cookingpot.CookingPotColorMixer;
 import net.minecraft.client.util.ITooltipFlag;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.init.MobEffects;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.block.Blocks;
+import net.minecraft.item.Items;
 import net.minecraft.item.Item;
-import net.minecraft.item.ItemFishFood;
+import net.minecraft.item.Food;
+import net.minecraft.item.ItemGroup;
 import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.nbt.NBTTagString;
-import net.minecraft.potion.PotionEffect;
+import net.minecraft.nbt.CompoundNBT;
+import net.minecraft.nbt.ListNBT;
+import net.minecraft.nbt.StringNBT;
+import net.minecraft.potion.EffectInstance;
+import net.minecraft.potion.Effects;
+import net.minecraft.util.text.ITextComponent;
+import net.minecraft.util.text.StringTextComponent;
 import net.minecraft.util.text.TextFormatting;
-import net.minecraft.util.text.translation.I18n;
+import net.minecraft.util.text.translation.LanguageMap;
 import net.minecraft.world.World;
 import net.minecraftforge.common.capabilities.ICapabilityProvider;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
 public class ItemColoredSoup extends ItemFood
 {
-    public ItemColoredSoup(String name, String local) 
+    public ItemColoredSoup() 
     {
-        super(name, local, 0, 0, false);
-        super.setMaxStackSize(1);
+        super(new Properties().group(ItemGroup.FOOD).food(new Food.Builder().build()).maxStackSize(1));
     }
 
     @Override
-    public ItemStack onItemUseFinish(ItemStack stack, World w, EntityLivingBase liv)
+    public ItemStack onItemUseFinish(ItemStack stack, World w, LivingEntity liv)
     {
         super.onItemUseFinish(stack, w, liv);
         return new ItemStack(Items.BOWL);
     }
 
     @Override
-    public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) 
+    public ICapabilityProvider initCapabilities(ItemStack stack, CompoundNBT nbt) 
     {
         getTagCompound(stack);
         return null;
     }  
     
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     @Override
-    public void addInformation(ItemStack stack, World w, List<String> lore, ITooltipFlag flag) 
+    public void addInformation(ItemStack stack, World w, List<ITextComponent> lore, ITooltipFlag flag) 
     {
         String text = getLocalizedIngredientList(stack);
         if(!text.isEmpty())
         {
-            lore.add(1, text);
+            lore.add(1, new StringTextComponent(text));
         }
     }
     
-    private NBTTagCompound getTagCompound(ItemStack stack)
+    private static CompoundNBT getTagCompound(ItemStack stack)
     {
-        NBTTagCompound com = stack.getTagCompound();
+        CompoundNBT com = stack.getTag();
         if(com == null)
         {
-            com = new NBTTagCompound();
-            com.setInteger("color", CookingPotColorMixer.DEFAULT.getRGB());
-            com.setTag("ingredients", new NBTTagList());
-            com.setFloat("saturation", 0);
-            com.setInteger("food", 0);
-            stack.setTagCompound(com);
+            com = new CompoundNBT();
+            com.putInt("color", CookingPotColorMixer.DEFAULT.getRGB());
+            com.put("ingredients", new ListNBT());
+            com.putFloat("saturation", 0.0f);
+            com.putInt("food", 0);
+            stack.setTag(com);
         }
         else
         {
-            if(!com.hasKey("color"))
+            if(!com.hasUniqueId("color"))
             {
-                com.setInteger("color", CookingPotColorMixer.DEFAULT.getRGB());   
+                com.putInt("color", CookingPotColorMixer.DEFAULT.getRGB());   
             }
-            if(!com.hasKey("ingredients", 9))
+            if(!com.hasUniqueId("ingredients"))
             {
-                com.setTag("ingredients", new NBTTagList());   
+                com.put("ingredients", new ListNBT());   
             }
-            if(!com.hasKey("saturation"))
+            if(!com.hasUniqueId("saturation"))
             {
-                com.setFloat("saturation", 0);   
+                com.putFloat("saturation", 0);   
             }
-            if(!com.hasKey("food"))
+            if(!com.hasUniqueId("food"))
             {
-                com.setInteger("food", 0);   
+                com.putInt("food", 0);   
             }
         }
         return com;
     }
     
     @SuppressWarnings(value = "")
-    public void addIngredient(ItemStack stew, Iterable<ItemStack> stacks)     
+    public static void addIngredient(ItemStack stew, Iterable<ItemStack> stacks)     
     {
-        NBTTagCompound com = stew.getTagCompound();
-        NBTTagList list = com.getTagList("ingredients", 8);
+        CompoundNBT com = stew.getTag();
+        ListNBT list = com.getList("ingredients", 8);
         for(ItemStack stack : stacks)
         {
-            list.appendTag(new NBTTagString(stack.getUnlocalizedName() + ".name"));
+            list.add(new StringNBT(stack.getTranslationKey()));
         }
     }
     
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     @SuppressWarnings(value = "")
-    public String getLocalizedIngredientList(ItemStack stack)
+    private String getLocalizedIngredientList(ItemStack stack)
     {
-        NBTTagCompound com = stack.getTagCompound();
-        NBTTagList list = com.getTagList("ingredients", 8);
-        switch(list.tagCount())
+        CompoundNBT com = stack.getTag();
+        ListNBT list = com.getList("ingredients", 8);
+        switch(list.size())
         {
             case 0: return "";
-            case 1: return TextFormatting.GRAY + I18n.translateToLocal(list.getStringTagAt(0));
+            case 1: return TextFormatting.GRAY + LanguageMap.getInstance().translateKey(list.getString(0));
             default:
                 StringBuilder sb = new StringBuilder(TextFormatting.GRAY.toString());
-                sb.append(I18n.translateToLocal(list.getStringTagAt(0)));
-                for(int i = 1; i < list.tagCount(); i++)
+                sb.append(LanguageMap.getInstance().translateKey(list.getString(0)));
+                for(int i = 1; i < list.size(); i++)
                 {
                     sb.append(", ");
-                    sb.append(I18n.translateToLocal(list.getStringTagAt(i)));
+                    sb.append(LanguageMap.getInstance().translateKey(list.getString(i)));
                 }
                 return sb.toString();
         }
     }
 
-    public void setColor(ItemStack stack, int color)
+    public static void setColor(ItemStack stack, int color)
     {
-        getTagCompound(stack).setInteger("color", color);
+        getTagCompound(stack).putInt("color", color);
     }
     
-    public int getColor(ItemStack stack)
+    public static int getColor(ItemStack stack)
     {
-        return getTagCompound(stack).getInteger("color");
+        return getTagCompound(stack).getInt("color");
     }
     
-    public void setFoodStats(ItemStack stack, LinkedList<ItemStack> ingredients)
+    public static void setFoodStats(ItemStack soup, LinkedList<ItemStack> ingredients)
     {
-        float saturation = 0;
+        float saturation = 0.0f;
         int food = 0;
         
-        for(ItemStack item : ingredients)
+        for(ItemStack stack : ingredients)
         {
-            switch(Item.getIdFromItem(item.getItem()))
+            Item item = stack.getItem();
+            if(item == Item.getItemFromBlock(Blocks.PUMPKIN))
             {
-                case 86: // pumpkin
-                    food += 6;
-                    saturation += 0.3F;
-                    break;  
-                case 260: // apple
-                    food += 4;
-                    saturation += 0.3F;
-                    break;   
-                case 322: // golden Apple
-                    food += 4;
-                    saturation += 1.2F;
-                    break;   
-                case 435: // beetroot Seeds
-                case 362: // melon Seeds
-                case 361: // pumpkin Seeds
-                case 295: // wheat Seeds
-                    food += 1;
-                    saturation += 0.1F;
-                    break; 
-                case 363: // beef
-                case 319: // pork
-                    food += 8;
-                    saturation += 0.8F;
-                    break;             
-                case 349: // fish
-                    switch(ItemFishFood.FishType.byItemStack(item))
-                    {
-                        case CLOWNFISH:
-                            food += 1;
-                            saturation += 0.1F;
-                            break;
-                        case COD:
-                            food += 5;
-                            saturation += 0.6F;
-                            break;
-                        case PUFFERFISH:
-                            food -= 75;
-                            saturation -= 0.8F;
-                            break;
-                        case SALMON:
-                            food += 6;
-                            saturation += 0.8F;
-                            break;
-                    }
-                    break; 
-                case 353: // sugar
-                    food += 1;
-                    saturation += 0.1F;
-                    break;  
-                case 382: // golden melon
-                case 360: // melon
-                    food += 2;
-                    saturation += 0.3F;
-                    break; 
-                case 365: // chicken
-                    food += 6;
-                    saturation += 0.6F;
-                    break; 
-                case 394: // poison potato
-                case 375: // spider eye
-                    food += -25;
-                    saturation -= 0.2F;
-                    break; 
-                case 414: // rabbit foot
-                case 372: // nether wart
-                case 376: // spider eye fermented
-                    food += 1;
-                    saturation += 0.1F;
-                    break; 
-                /*case 378: // magma cream    
-                case 377: // blaze powder
-                    food -= 1;
-                    saturation -= 0.1F;
-                    break; */
-                case 396: // golden carrot
-                case 391: // carrot
-                    food += 3;
-                    saturation += 0.6F;
-                    break; 
-                case 411: // rabbit
-                case 392: // potato
-                    food += 5;
-                    saturation += 0.6F;
-                    break;     
-                case 423: // mutton
-                    food += 6;
-                    saturation += 0.8F;
-                    break; 
-                case 434: // beetroot
-                    food += 1;
-                    saturation += 0.6F;
-                    break; 
+                food += 6;
+                saturation += 0.3F;
+            }
+            else if(item == Items.APPLE)
+            {
+                food += 4;
+                saturation += 0.3F;
+            }
+            else if(item == Items.GOLDEN_APPLE)
+            {
+                food += 4;
+                saturation += 1.2F;
+            }
+            else if(item == Items.BEETROOT_SEEDS || item == Items.MELON_SEEDS || item == Items.PUMPKIN_SEEDS || item == Items.WHEAT_SEEDS)
+            {
+                food += 1;
+                saturation += 0.1F;
+            }
+            else if(item == Items.BEEF || item == Items.PORKCHOP)
+            {
+                food += 8;
+                saturation += 0.8F;
+            }          
+            else if(item == Items.TROPICAL_FISH)
+            {
+                food += 1;
+                saturation += 0.1F;
+            }
+            else if(item == Items.COD)
+            {
+                food += 5;
+                saturation += 0.6F;
+            }
+            else if(item == Items.PUFFERFISH)
+            {
+                food -= 75;
+                saturation -= 0.8F;
+            }
+            else if(item == Items.SALMON)
+            {
+                food += 6;
+                saturation += 0.8F;
+            }
+            else if(item == Items.SUGAR)
+            {
+                food += 1;
+                saturation += 0.1F;
+            }
+            else if(item == Items.MELON_SLICE || item == Items.GLISTERING_MELON_SLICE)
+            {
+                food += 2;
+                saturation += 0.3F;
+            }
+            else if(item == Items.CHICKEN)
+            {
+                food += 6;
+                saturation += 0.6F;
+            }
+            else if(item == Items.POISONOUS_POTATO || item == Items.SPIDER_EYE)
+            {
+                food += -25;
+                saturation -= 0.2F;
+            }
+            else if(item == Items.RABBIT_FOOT || item == Items.NETHER_WART || item == Items.FERMENTED_SPIDER_EYE)
+            {
+                food += 1;
+                saturation += 0.1F;
+            }
+            else if(item == Items.GOLDEN_CARROT || item == Items.CARROT)
+            {
+                food += 3;
+                saturation += 0.6F;
+            }
+            else if(item == Items.RABBIT || item == Items.POTATO)
+            {
+                food += 5;
+                saturation += 0.6F;
+            }
+            else if(item == Items.MUTTON)
+            {
+                food += 6;
+                saturation += 0.8F;
+            }
+            else if(item == Items.BEETROOT)
+            {
+                food += 1;
+                saturation += 0.6F;
             }
         }
         
-        getTagCompound(stack).setFloat("saturation", saturation);
-        getTagCompound(stack).setInteger("food", food);
+        getTagCompound(soup).putFloat("saturation", saturation);
+        getTagCompound(soup).putInt("food", food);
     }
 
     @Override
-    public float getSaturationModifier(ItemStack stack) 
+    public void onFoodEaten(ItemStack stack, World w, LivingEntity liv)
     {
-        return getTagCompound(stack).getFloat("saturation");
-    }
-
-    @Override
-    public int getHealAmount(ItemStack stack) 
-    {
-        int food = getTagCompound(stack).getInteger("food");
-        if(food < 0)
+        int food = getTagCompound(stack).getInt("food");
+        if(food < 0 && !w.isRemote)
         {
-            return 0;
+            liv.addPotionEffect(new EffectInstance(Effects.POISON, 100, -food / 25));
+            food = 0;
         }
-        return food;
-    }
-    
-    @Override
-    protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
-    {
-        if(!worldIn.isRemote)
+        float saturation = getTagCompound(stack).getFloat("saturation");
+        if(liv instanceof PlayerEntity && !w.isRemote)
         {
-            int food = getTagCompound(stack).getInteger("food");
-            if(food < 0)
-            {
-                player.addPotionEffect(new PotionEffect(MobEffects.POISON, 100, (-food) / 25));
-            }
+            ((PlayerEntity) liv).getFoodStats().addStats(food, saturation);
         }
     }
 }

+ 16 - 12
src/main/java/me/km/items/ItemCylinder.java

@@ -1,25 +1,29 @@
 package me.km.items;
 
 import me.km.KajetansMod;
-import net.minecraft.client.model.ModelBiped;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.inventory.EntityEquipmentSlot;
+import net.minecraft.client.renderer.entity.model.BipedModel;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.inventory.EquipmentSlotType;
+import net.minecraft.item.IArmorMaterial;
+import net.minecraft.item.Item;
+import net.minecraft.item.ArmorItem;
+import net.minecraft.item.ItemGroup;
 import net.minecraft.item.ItemStack;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
-public class ItemCylinder extends ItemArmor
+public class ItemCylinder extends ArmorItem
 {
-    public ItemCylinder(ArmorMaterial m, String name, String local) 
+    public ItemCylinder(IArmorMaterial am, Item.Properties builder) 
     {
-        super(m, EntityEquipmentSlot.HEAD, name, local);
+        super(am, EquipmentSlotType.HEAD, builder.group(ItemGroup.COMBAT));
     }
-    
-    @SideOnly(Side.CLIENT)
+
+    @OnlyIn(Dist.CLIENT)
     @Override
-    public ModelBiped getArmorModel(EntityLivingBase liv, ItemStack stack, EntityEquipmentSlot slot, ModelBiped normal) 
+    public BipedModel getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, BipedModel normal)
     {
-        if(slot != EntityEquipmentSlot.HEAD)
+        if(slot != EquipmentSlotType.HEAD)
         {
             return normal;
         }

+ 15 - 11
src/main/java/me/km/items/ItemFood.java

@@ -1,23 +1,27 @@
 package me.km.items;
 
-import me.km.KajetansMod;
+import net.minecraft.entity.LivingEntity;
 import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
 
-public class ItemFood extends net.minecraft.item.ItemFood implements ItemModelProvider
+public abstract class ItemFood extends Item
 {
-    protected String name;
-    
-    public ItemFood(String name, String local, int amount, float saturation, boolean isWolfFood) 
+    public ItemFood(Properties properties)
     {
-        super(amount, saturation, isWolfFood);
-        this.name = name;
-        super.setUnlocalizedName(local);
-        this.setRegistryName(KajetansMod.MODID, name);
+        super(properties);
     }
 
     @Override
-    public void registerItemModel(Item item) 
+    public ItemStack onItemUseFinish(ItemStack stack, World worldIn, LivingEntity liv)
     {
-        KajetansMod.proxy.registerItemRenderer(this, 0, name);
+        if(this.isFood())
+        {
+            onFoodEaten(stack, worldIn, liv);
+            return liv.onFoodEaten(worldIn, stack);
+        }
+        return stack;
     }
+    
+    public abstract void onFoodEaten(ItemStack stack, World worldIn, LivingEntity liv);
 }

+ 16 - 16
src/main/java/me/km/items/ItemGemStone.java

@@ -1,39 +1,39 @@
 package me.km.items;
 
-import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemGroup;
 import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.CompoundNBT;
 import net.minecraftforge.common.capabilities.ICapabilityProvider;
 
-public class ItemGemStone extends ItemBase
+public class ItemGemStone extends Item
 {
-    public ItemGemStone(String name, String local) 
+    public ItemGemStone() 
     {
-        super(name, local);
-        super.setCreativeTab(CreativeTabs.MATERIALS);
+        super(new Properties().group(ItemGroup.MATERIALS));
     }
 
     @Override
-    public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) 
+    public ICapabilityProvider initCapabilities(ItemStack stack, CompoundNBT nbt) 
     {
         getTagCompound(stack);
         return null;
     }  
     
-    private NBTTagCompound getTagCompound(ItemStack stack)
+    private CompoundNBT getTagCompound(ItemStack stack)
     {
-        NBTTagCompound com = stack.getTagCompound();
+        CompoundNBT com = stack.getTag();
         if(com == null)
         {
-            com = new NBTTagCompound();
-            com.setInteger("color", 0xFFFFFF);
-            stack.setTagCompound(com);
+            com = new CompoundNBT();
+            com.putInt("color", 0xFFFFFF);
+            stack.setTag(com);
         }
         else
         {
-            if(!com.hasKey("color"))
+            if(!com.hasUniqueId("color"))
             {
-                com.setInteger("color", 0xFFFFFF);   
+                com.putInt("color", 0xFFFFFF);   
             }
         }
         return com;
@@ -41,11 +41,11 @@ public class ItemGemStone extends ItemBase
     
     public void setColor(ItemStack stack, int color)
     {
-        getTagCompound(stack).setInteger("color", color);
+        getTagCompound(stack).putInt("color", color);
     }
     
     public int getColor(ItemStack stack)
     {
-        return getTagCompound(stack).getInteger("color");
+        return getTagCompound(stack).getInt("color");
     }
 }

+ 15 - 11
src/main/java/me/km/items/ItemHat.java

@@ -1,25 +1,29 @@
 package me.km.items;
 
 import me.km.KajetansMod;
-import net.minecraft.client.model.ModelBiped;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.inventory.EntityEquipmentSlot;
+import net.minecraft.client.renderer.entity.model.BipedModel;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.inventory.EquipmentSlotType;
+import net.minecraft.item.IArmorMaterial;
+import net.minecraft.item.Item;
+import net.minecraft.item.ArmorItem;
+import net.minecraft.item.ItemGroup;
 import net.minecraft.item.ItemStack;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
-public class ItemHat extends ItemArmor
+public class ItemHat extends ArmorItem
 {
-    public ItemHat(ArmorMaterial m, String name, String local) 
+    public ItemHat(IArmorMaterial am, Item.Properties builder) 
     {
-        super(m, EntityEquipmentSlot.HEAD, name, local);
+        super(am, EquipmentSlotType.HEAD, builder.group(ItemGroup.COMBAT));
     }
     
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     @Override
-    public ModelBiped getArmorModel(EntityLivingBase liv, ItemStack stack, EntityEquipmentSlot slot, ModelBiped normal) 
+    public BipedModel getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, BipedModel normal)
     {
-        if(slot != EntityEquipmentSlot.HEAD)
+        if(slot != EquipmentSlotType.HEAD)
         {
             return normal;
         }

+ 15 - 15
src/main/java/me/km/items/ItemKey.java

@@ -2,42 +2,42 @@ package me.km.items;
 
 import java.util.List;
 import net.minecraft.client.util.ITooltipFlag;
-import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.IItemTier;
 import net.minecraft.item.Item;
+import net.minecraft.item.ItemGroup;
 import net.minecraft.item.ItemStack;
+import net.minecraft.util.text.ITextComponent;
 import net.minecraft.util.text.TextFormatting;
 import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 
-public class ItemKey extends ItemBase
+public class ItemKey extends Item
 {
-    private final Item.ToolMaterial toolMaterial;
+    private final IItemTier it;
     
-    public ItemKey(String name, String local, Item.ToolMaterial materialIn)
+    public ItemKey(IItemTier it)
     {
-        super(name, local);
-        this.toolMaterial = materialIn;
-        this.maxStackSize = 1;
-        super.setCreativeTab(CreativeTabs.MISC);
+        super(new Item.Properties().group(ItemGroup.MISC).maxStackSize(1));
+        this.it = it;
     }
     
     public int getLockPickResistance()
     {
-        return toolMaterial.getHarvestLevel() + 1;
+        return it.getHarvestLevel() + 1;
     }
     
-    @SideOnly(Side.CLIENT)
+    @OnlyIn(Dist.CLIENT)
     @Override
-    public void addInformation(ItemStack stack, World w, List<String> lore, ITooltipFlag flag) 
+    public void addInformation(ItemStack stack, World w, List<ITextComponent> lore, ITooltipFlag flag)
     {
         if(stack.hasDisplayName())
         {
-            lore.set(0, TextFormatting.GREEN + getItemStackDisplayName(stack));
+            lore.get(0).applyTextStyle(TextFormatting.GREEN);
         }
         else
         {
-            lore.set(0, TextFormatting.RED + getItemStackDisplayName(stack));
+            lore.get(0).applyTextStyle(TextFormatting.RED);
         }
     }
 }

+ 0 - 29
src/main/java/me/km/items/ItemMetal.java

@@ -1,29 +0,0 @@
-package me.km.items;
-
-import me.km.blocks.EnumMetals;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-
-public class ItemMetal extends ItemBlock
-{
-    // everything inspired by net.minecraft.item.ItemCloth
-    public ItemMetal(Block block)
-    {
-        super(block);
-        super.setMaxDamage(0);
-        super.setHasSubtypes(true);
-    }
-    
-    @Override
-    public int getMetadata(int damage)
-    {
-        return damage;
-    }
-
-    @Override
-    public String getUnlocalizedName(ItemStack stack)
-    {
-        return super.getUnlocalizedName() + "." + EnumMetals.byMetadata(stack.getMetadata()).getUnlocalizedName();
-    }
-}

+ 0 - 8
src/main/java/me/km/items/ItemModelProvider.java

@@ -1,8 +0,0 @@
-package me.km.items;
-
-import net.minecraft.item.Item;
-
-public interface ItemModelProvider 
-{
-    void registerItemModel(Item item);
-}

+ 23 - 0
src/main/java/me/km/items/ItemNoGlintLingeringPotion.java

@@ -0,0 +1,23 @@
+package me.km.items;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemGroup;
+import net.minecraft.item.LingeringPotionItem;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
+
+public class ItemNoGlintLingeringPotion extends LingeringPotionItem
+{
+    public ItemNoGlintLingeringPotion()
+    {
+        super(new Item.Properties().maxStackSize(16).group(ItemGroup.BREWING));
+    }
+    
+    @OnlyIn(Dist.CLIENT)
+    @Override
+    public boolean hasEffect(ItemStack stack)
+    {
+        return stack.isEnchanted();
+    }
+}

Some files were not shown because too many files changed in this diff