Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Brewing stand, cauldron, hopper, end portal frame.
- Loading branch information
Showing
5 changed files
with
117 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...it/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/model/BukkitEndPortalFrame.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package fr.neatmonster.nocheatplus.compat.bukkit.model; | ||
|
||
import org.bukkit.World; | ||
import org.bukkit.block.Block; | ||
import org.bukkit.block.BlockState; | ||
import org.bukkit.block.data.BlockData; | ||
import org.bukkit.block.data.type.EndPortalFrame; | ||
|
||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache; | ||
|
||
public class BukkitEndPortalFrame implements BukkitShapeModel { | ||
|
||
@Override | ||
public double[] getShape(final BlockCache blockCache, | ||
final World world, final int x, final int y, final int z) { | ||
final Block block = world.getBlockAt(x, y, z); | ||
final BlockState state = block.getState(); | ||
final BlockData blockData = state.getBlockData(); | ||
if (blockData instanceof EndPortalFrame) { | ||
return ((EndPortalFrame) blockData).hasEye() | ||
? new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0} | ||
: new double[] {0.0, 0.0, 0.0, 1.0, 0.8125, 1.0}; | ||
} | ||
else { | ||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0}; | ||
} | ||
} | ||
|
||
@Override | ||
public int getFakeData(final BlockCache blockCache, | ||
final World world, final int x, final int y, final int z) { | ||
final Block block = world.getBlockAt(x, y, z); | ||
final BlockState state = block.getState(); | ||
final BlockData blockData = state.getBlockData(); | ||
if (blockData instanceof EndPortalFrame) { | ||
return ((EndPortalFrame) blockData).hasEye() ? 0x4 : 0; | ||
} | ||
else { | ||
return 0; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters