diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-11-30 15:28:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 15:28:14 -0500 |
commit | 886402bdcd8d68e6d1076c86d53baab47070dd63 (patch) | |
tree | 80b30cfa6fd5127a63d51ae1037bbd129dbee1af /src/main/java/me/Danker/utils/Utils.java | |
parent | 016814851e46acdbc7a8fce44746eb67feef5905 (diff) | |
parent | 7091007cdd4f214ab47d1fb18c951eb25cb67852 (diff) | |
download | SkyblockMod-886402bdcd8d68e6d1076c86d53baab47070dd63.tar.gz SkyblockMod-886402bdcd8d68e6d1076c86d53baab47070dd63.tar.bz2 SkyblockMod-886402bdcd8d68e6d1076c86d53baab47070dd63.zip |
1.8.3
Merge pull request #32 from bowser0000/development
I forgot to pull request when releasing
Diffstat (limited to 'src/main/java/me/Danker/utils/Utils.java')
-rw-r--r-- | src/main/java/me/Danker/utils/Utils.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 29e61ed..245d071 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -23,6 +23,7 @@ import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.scoreboard.ScoreObjective; @@ -31,6 +32,7 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; import net.minecraft.util.Vec3; +import net.minecraft.world.World; public class Utils { @@ -403,4 +405,19 @@ public class Utils { return closestBlock; } + public static BlockPos getBlockUnderItemFrame(World world, EntityItemFrame itemFrame) { + switch (itemFrame.facingDirection) { + case NORTH: + return new BlockPos(itemFrame.posX, itemFrame.posY, itemFrame.posZ + 1); + case EAST: + return new BlockPos(itemFrame.posX - 1, itemFrame.posY, itemFrame.posZ - 0.5); + case SOUTH: + return new BlockPos(itemFrame.posX, itemFrame.posY, itemFrame.posZ - 1); + case WEST: + return new BlockPos(itemFrame.posX + 1, itemFrame.posY, itemFrame.posZ - 0.5); + default: + return null; + } + } + } |