44import gregtech .api .color .containers .BedColorContainer ;
55import gregtech .api .color .containers .GTPipeColorContainer ;
66import gregtech .api .color .containers .MTEColorContainer ;
7- import gregtech .api .color .containers .NullColorContainer ;
87import gregtech .api .color .containers .VanillaColorContainer ;
98import gregtech .api .util .GTUtility ;
109import gregtech .api .util .Mods ;
11- import gregtech .common .items .behaviors .spray .AbstractSprayBehavior ;
1210
1311import net .minecraft .entity .player .EntityPlayer ;
1412import net .minecraft .item .EnumDyeColor ;
13+ import net .minecraft .util .EnumActionResult ;
1514import net .minecraft .util .EnumFacing ;
1615import net .minecraft .util .ResourceLocation ;
1716import net .minecraft .util .math .BlockPos ;
@@ -47,16 +46,20 @@ public static void registerContainer(@NotNull ColoredBlockContainer container) {
4746 CONTAINERS .put (id , container );
4847 }
4948
50- public static @ NotNull ColoredBlockContainer getContainer (@ NotNull World world , @ NotNull BlockPos pos ,
51- @ NotNull EnumFacing facing ,
52- @ NotNull EntityPlayer player ) {
49+ /**
50+ * Get the color container for the block or tile entity at the provided position. <br/>
51+ * Will return {@code null} if no container was valid.
52+ */
53+ public static @ Nullable ColoredBlockContainer getContainer (@ NotNull World world , @ NotNull BlockPos pos ,
54+ @ NotNull EnumFacing facing ,
55+ @ NotNull EntityPlayer player ) {
5356 for (ColoredBlockContainer container : CONTAINERS .values ()) {
5457 if (container .isBlockValid (world , pos , facing , player )) {
5558 return container ;
5659 }
5760 }
5861
59- return NullColorContainer . NULL_CONTAINER ;
62+ return null ;
6063 }
6164
6265 @ ApiStatus .Internal
@@ -80,19 +83,26 @@ public ColoredBlockContainer(@NotNull ResourceLocation id) {
8083 public abstract boolean isBlockValid (@ NotNull World world , @ NotNull BlockPos pos , @ NotNull EnumFacing facing ,
8184 @ NotNull EntityPlayer player );
8285
83- public abstract boolean setColor (@ NotNull World world , @ NotNull BlockPos pos , @ NotNull EnumFacing facing ,
84- @ NotNull EntityPlayer player , @ Nullable EnumDyeColor newColor );
86+ public @ NotNull EnumActionResult setColor (@ NotNull World world , @ NotNull BlockPos pos , @ NotNull EnumFacing facing ,
87+ @ NotNull EntityPlayer player , @ Nullable EnumDyeColor newColor ) {
88+ return EnumActionResult .PASS ;
89+ }
8590
86- public boolean setColor (@ NotNull World world , @ NotNull BlockPos pos , @ NotNull EnumFacing facing ,
87- @ NotNull EntityPlayer player , int newColor ) {
88- return false ;
91+ public @ NotNull EnumActionResult setColor (@ NotNull World world , @ NotNull BlockPos pos , @ NotNull EnumFacing facing ,
92+ @ NotNull EntityPlayer player , int newColor ) {
93+ return EnumActionResult . PASS ;
8994 }
9095
91- public abstract boolean removeColor (@ NotNull World world , @ NotNull BlockPos pos , @ NotNull EnumFacing facing ,
92- @ NotNull EntityPlayer player );
96+ public @ NotNull EnumActionResult removeColor (@ NotNull World world , @ NotNull BlockPos pos ,
97+ @ NotNull EnumFacing facing ,
98+ @ NotNull EntityPlayer player ) {
99+ return EnumActionResult .PASS ;
100+ }
93101
94- public abstract @ Nullable EnumDyeColor getColor (@ NotNull World world , @ NotNull BlockPos pos ,
95- @ NotNull EnumFacing facing , @ NotNull EntityPlayer player );
102+ public @ Nullable EnumDyeColor getColor (@ NotNull World world , @ NotNull BlockPos pos ,
103+ @ NotNull EnumFacing facing , @ NotNull EntityPlayer player ) {
104+ return null ;
105+ }
96106
97107 public int getColorInt (@ NotNull World world , @ NotNull BlockPos pos , @ NotNull EnumFacing facing ,
98108 @ NotNull EntityPlayer player ) {
@@ -110,5 +120,5 @@ public boolean colorMatches(@NotNull World world, @NotNull BlockPos pos, @NotNul
110120 return getColorInt (world , pos , facing , player ) == color ;
111121 }
112122
113- public abstract boolean supportsMode ( @ NotNull AbstractSprayBehavior . ColorMode colorMode );
123+ public abstract @ NotNull ColorModeSupport getSupportedColorMode ( );
114124}
0 commit comments