Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 02:50:06 +01:00
Look up BlockBase.Info field in actual class instead of subclass
Dieser Commit ist enthalten in:
Ursprung
2bdf6ae18a
Commit
798e18ecc2
@ -31,7 +31,7 @@ public class BlockMaterial_1_16_1 implements BlockMaterial {
|
|||||||
this.material = defaultState.getMaterial();
|
this.material = defaultState.getMaterial();
|
||||||
this.craftBlockData = CraftBlockData.fromData(defaultState);
|
this.craftBlockData = CraftBlockData.fromData(defaultState);
|
||||||
this.craftMaterial = craftBlockData.getMaterial();
|
this.craftMaterial = craftBlockData.getMaterial();
|
||||||
BlockBase.Info blockInfo = ReflectionUtil.getField(Block.class, block, "aB");
|
BlockBase.Info blockInfo = ReflectionUtil.getField(BlockBase.class, block, "aB");
|
||||||
this.isTranslucent = !(boolean)ReflectionUtil.getField(BlockBase.Info.class, blockInfo, "n");
|
this.isTranslucent = !(boolean)ReflectionUtil.getField(BlockBase.Info.class, blockInfo, "n");
|
||||||
opacity = defaultState.b(BlockAccessAir.INSTANCE, BlockPosition.ZERO);
|
opacity = defaultState.b(BlockAccessAir.INSTANCE, BlockPosition.ZERO);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class BlockMaterial_1_16_2 implements BlockMaterial {
|
|||||||
this.material = defaultState.getMaterial();
|
this.material = defaultState.getMaterial();
|
||||||
this.craftBlockData = CraftBlockData.fromData(defaultState);
|
this.craftBlockData = CraftBlockData.fromData(defaultState);
|
||||||
this.craftMaterial = craftBlockData.getMaterial();
|
this.craftMaterial = craftBlockData.getMaterial();
|
||||||
BlockBase.Info blockInfo = ReflectionUtil.getField(Block.class, block, "aB");
|
BlockBase.Info blockInfo = ReflectionUtil.getField(BlockBase.class, block, "aB");
|
||||||
this.isTranslucent = !(boolean)ReflectionUtil.getField(BlockBase.Info.class, blockInfo, "n");
|
this.isTranslucent = !(boolean)ReflectionUtil.getField(BlockBase.Info.class, blockInfo, "n");
|
||||||
opacity = defaultState.b(BlockAccessAir.INSTANCE, BlockPosition.ZERO);
|
opacity = defaultState.b(BlockAccessAir.INSTANCE, BlockPosition.ZERO);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,9 @@ import net.minecraft.server.v1_16_R3.ITileEntity;
|
|||||||
import net.minecraft.server.v1_16_R3.Material;
|
import net.minecraft.server.v1_16_R3.Material;
|
||||||
import org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData;
|
import org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData;
|
||||||
|
|
||||||
|
import java.lang.invoke.MethodHandle;
|
||||||
|
import java.lang.invoke.MethodHandles;
|
||||||
|
|
||||||
public class BlockMaterial_1_16_5 implements BlockMaterial {
|
public class BlockMaterial_1_16_5 implements BlockMaterial {
|
||||||
private final Block block;
|
private final Block block;
|
||||||
private final IBlockData defaultState;
|
private final IBlockData defaultState;
|
||||||
@ -31,7 +34,7 @@ public class BlockMaterial_1_16_5 implements BlockMaterial {
|
|||||||
this.material = defaultState.getMaterial();
|
this.material = defaultState.getMaterial();
|
||||||
this.craftBlockData = CraftBlockData.fromData(defaultState);
|
this.craftBlockData = CraftBlockData.fromData(defaultState);
|
||||||
this.craftMaterial = craftBlockData.getMaterial();
|
this.craftMaterial = craftBlockData.getMaterial();
|
||||||
BlockBase.Info blockInfo = ReflectionUtil.getField(Block.class, block, "aB");
|
BlockBase.Info blockInfo = ReflectionUtil.getField(BlockBase.class, block, "aB");
|
||||||
this.isTranslucent = !(boolean)ReflectionUtil.getField(BlockBase.Info.class, blockInfo, "n");
|
this.isTranslucent = !(boolean)ReflectionUtil.getField(BlockBase.Info.class, blockInfo, "n");
|
||||||
opacity = defaultState.b(BlockAccessAir.INSTANCE, BlockPosition.ZERO);
|
opacity = defaultState.b(BlockAccessAir.INSTANCE, BlockPosition.ZERO);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren