mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:06:11 +03:00
43 lines
1.3 KiB
Diff
43 lines
1.3 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/Block.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/Block.java
|
|
@@ -43,6 +43,7 @@
|
|
import net.minecraft.world.World;
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
+import org.spigotmc.AsyncCatcher;
|
|
|
|
public class Block extends net.minecraftforge.fml.common.registry.IForgeRegistryEntry.Impl<Block>
|
|
{
|
|
@@ -505,10 +506,12 @@
|
|
|
|
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
|
|
{
|
|
+ AsyncCatcher.catchOp( "block onPlace"); // Spigot
|
|
}
|
|
|
|
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
|
{
|
|
+ AsyncCatcher.catchOp( "block remove"); // Spigot
|
|
if (hasTileEntity(state) && !(this instanceof BlockContainer))
|
|
{
|
|
worldIn.removeTileEntity(pos);
|
|
@@ -2386,7 +2389,17 @@
|
|
{
|
|
registerBlock(id, new ResourceLocation(textualID), block_);
|
|
}
|
|
-
|
|
+ // Spigot start
|
|
+ public static float range(float min, float value, float max) {
|
|
+ if (value < min) {
|
|
+ return min;
|
|
+ }
|
|
+ if (value > max) {
|
|
+ return max;
|
|
+ }
|
|
+ return value;
|
|
+ }
|
|
+ // Spigot end
|
|
@SideOnly(Side.CLIENT)
|
|
public static enum EnumOffsetType
|
|
{
|