File tree 2 files changed +20
-0
lines changed
magiclib-minecraft-api/src/main/java/top/hendrixshen/magiclib
api/compat/minecraft/world/level
impl/compat/minecraft/world/level
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
package top .hendrixshen .magiclib .api .compat .minecraft .world .level ;
2
2
3
+ import net .minecraft .core .BlockPos ;
3
4
import net .minecraft .resources .ResourceLocation ;
4
5
import net .minecraft .world .level .Level ;
6
+ import net .minecraft .world .level .block .state .BlockState ;
5
7
import org .jetbrains .annotations .NotNull ;
8
+ import top .hendrixshen .magiclib .api .compat .minecraft .world .level .state .BlockStateCompat ;
6
9
import top .hendrixshen .magiclib .impl .compat .minecraft .world .level .LevelCompatImpl ;
7
10
import top .hendrixshen .magiclib .util .collect .Provider ;
8
11
@@ -11,6 +14,10 @@ public interface LevelCompat extends Provider<Level> {
11
14
return new LevelCompatImpl (level );
12
15
}
13
16
17
+ BlockState getBlockState (BlockPos blockPos );
18
+
19
+ BlockStateCompat getBlockStateCompat (BlockPos blockPos );
20
+
14
21
ResourceLocation getDimensionLocation ();
15
22
16
23
int getMinBuildHeight ();
Original file line number Diff line number Diff line change 1
1
package top .hendrixshen .magiclib .impl .compat .minecraft .world .level ;
2
2
3
+ import net .minecraft .core .BlockPos ;
3
4
import net .minecraft .resources .ResourceLocation ;
4
5
import net .minecraft .world .level .Level ;
6
+ import net .minecraft .world .level .block .state .BlockState ;
5
7
import org .jetbrains .annotations .NotNull ;
6
8
import top .hendrixshen .magiclib .api .compat .AbstractCompat ;
7
9
import top .hendrixshen .magiclib .api .compat .minecraft .world .level .LevelCompat ;
10
+ import top .hendrixshen .magiclib .api .compat .minecraft .world .level .state .BlockStateCompat ;
8
11
import top .hendrixshen .magiclib .impl .compat .minecraft .world .level .dimension .DimensionWrapper ;
9
12
10
13
public class LevelCompatImpl extends AbstractCompat <Level > implements LevelCompat {
11
14
public LevelCompatImpl (@ NotNull Level type ) {
12
15
super (type );
13
16
}
14
17
18
+ @ Override
19
+ public BlockState getBlockState (BlockPos blockPos ) {
20
+ return this .get ().getBlockState (blockPos );
21
+ }
22
+
23
+ @ Override
24
+ public BlockStateCompat getBlockStateCompat (BlockPos blockPos ) {
25
+ return BlockStateCompat .of (this .getBlockState (blockPos ));
26
+ }
27
+
15
28
@ Override
16
29
public ResourceLocation getDimensionLocation () {
17
30
return DimensionWrapper .of (this .get ()).getResourceLocation ();
You can’t perform that action at this time.
0 commit comments