-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from PTOM76/1.17.1
1.17.1
- Loading branch information
Showing
66 changed files
with
1,091 additions
and
106 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
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
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,17 @@ | ||
package ml.pkom.enhancedquarries; | ||
|
||
import ml.pkom.enhancedquarries.registry.Registry; | ||
|
||
public class FillerModules { | ||
public static void init() { | ||
Registry.register(EnhancedQuarries.id("vertical_layer"), Items.fillerVERTICAL_LAYER); | ||
Registry.register(EnhancedQuarries.id("horizontal_layer"), Items.fillerHORIZONTAL_LAYER); | ||
Registry.register(EnhancedQuarries.id("tower"), Items.fillerTOWER); | ||
Registry.register(EnhancedQuarries.id("delete_fluid"), Items.fillerDELETE_FLUID); | ||
Registry.register(EnhancedQuarries.id("floor_replace"), Items.fillerFLOOR_REPLACE); | ||
Registry.register(EnhancedQuarries.id("stairs"), Items.fillerSTAIRS); | ||
Registry.register(EnhancedQuarries.id("pyramid"), Items.fillerPYRAMID); | ||
Registry.register(EnhancedQuarries.id("cut_stairs"), Items.fillerCUT_STAIRS); | ||
Registry.register(EnhancedQuarries.id("cut_pyramid"), Items.fillerCUT_PYRAMID); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
package ml.pkom.enhancedquarries; | ||
|
||
import ml.pkom.enhancedquarries.screen.FillerScreenHandler; | ||
import ml.pkom.enhancedquarries.screen.FillerWithChestScreenHandler; | ||
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry; | ||
import net.minecraft.screen.ScreenHandlerType; | ||
|
||
public class ScreenHandlers { | ||
public static ScreenHandlerType<FillerScreenHandler> FILLER_SCREEN_HANDLER_TYPE; | ||
public static ScreenHandlerType<FillerWithChestScreenHandler> FILLER_WITH_CHEST_SCREEN_HANDLER_TYPE; | ||
|
||
public static void init() { | ||
FILLER_SCREEN_HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(EnhancedQuarries.id("filler"), FillerScreenHandler::new); | ||
FILLER_WITH_CHEST_SCREEN_HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(EnhancedQuarries.id("filler_with_chest"), FillerWithChestScreenHandler::new); | ||
} | ||
} |
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
62 changes: 62 additions & 0 deletions
62
src/main/java/ml/pkom/enhancedquarries/block/EnhancedFillerWithChest.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,62 @@ | ||
package ml.pkom.enhancedquarries.block; | ||
|
||
import ml.pkom.enhancedquarries.block.base.Filler; | ||
import ml.pkom.enhancedquarries.event.TileCreateEvent; | ||
import ml.pkom.enhancedquarries.screen.FillerWithChestScreenHandler; | ||
import ml.pkom.enhancedquarries.tile.EnhancedFillerWithChestTile; | ||
import ml.pkom.enhancedquarries.tile.base.FillerTile; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.screen.NamedScreenHandlerFactory; | ||
import net.minecraft.screen.SimpleNamedScreenHandlerFactory; | ||
import net.minecraft.text.LiteralText; | ||
import net.minecraft.util.ActionResult; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.hit.BlockHitResult; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class EnhancedFillerWithChest extends Filler { | ||
|
||
public EnhancedFillerWithChest() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public BlockEntity createBlockEntity(TileCreateEvent event) { | ||
return new EnhancedFillerWithChestTile(event); | ||
} | ||
|
||
// instance | ||
public static Filler INSTANCE = new EnhancedFillerWithChest(); | ||
|
||
public static Filler getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
public static Filler getFiller() { | ||
return getInstance(); | ||
} | ||
// ---- | ||
|
||
@Override | ||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hitResult) { | ||
if (world.isClient()) | ||
return ActionResult.SUCCESS; | ||
NamedScreenHandlerFactory namedScreenHandlerFactory = createScreenHandlerFactory(state, world, pos); | ||
if (namedScreenHandlerFactory != null) { | ||
player.openHandledScreen(namedScreenHandlerFactory); | ||
} | ||
|
||
return ActionResult.CONSUME; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public NamedScreenHandlerFactory createScreenHandlerFactory(BlockState state, World world, BlockPos pos) { | ||
FillerTile fillerTile = (FillerTile) world.getBlockEntity(pos); | ||
return new SimpleNamedScreenHandlerFactory((i, playerInventory, playerEntity) -> new FillerWithChestScreenHandler(i, playerInventory, fillerTile.getInventory(), fillerTile.getCraftingInventory()), new LiteralText("")); | ||
} | ||
} |
Oops, something went wrong.