-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
109 additions
and
71 deletions.
There are no files selected for viewing
32 changes: 0 additions & 32 deletions
32
src/main/java/com/fureniku/roads/blockentities/BlockEntityFactoryManager.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/main/java/com/fureniku/roads/blockentities/BlockType.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,6 @@ | ||
package com.fureniku.roads.blockentities; | ||
|
||
public enum BlockType { | ||
CRUSHER, | ||
FABRICATOR | ||
} |
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
14 changes: 7 additions & 7 deletions
14
src/main/java/com/fureniku/roads/blockentities/menus/CrusherMenu.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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/fureniku/roads/blocks/entityblock/CrusherEntityBlock.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 |
---|---|---|
@@ -1,23 +1,52 @@ | ||
package com.fureniku.roads.blocks.entityblock; | ||
|
||
import com.fureniku.metropolis.blockentity.MetroBlockEntity; | ||
import com.fureniku.metropolis.blocks.decorative.MetroEntityBlockDecorative; | ||
import com.fureniku.metropolis.datagen.TextureSet; | ||
import com.fureniku.metropolis.menus.MetroMenu; | ||
import com.fureniku.metropolis.utils.Debug; | ||
import com.fureniku.roads.blockentities.CrusherBlockEntity; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.world.InteractionResult; | ||
import net.minecraft.world.MenuProvider; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
import net.neoforged.neoforge.network.NetworkHooks; | ||
import net.neoforged.neoforge.registries.RegistryObject; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public abstract class CrusherEntityBlock extends MetroEntityBlockDecorative { | ||
|
||
public static RegistryObject<BlockEntityType<MetroBlockEntity>> ENTITY; | ||
public static RegistryObject<MetroMenu> MENU; | ||
|
||
public CrusherEntityBlock(Properties props, VoxelShape shape, String modelDir, String modelName, String tag, boolean dynamicShape, TextureSet... textures) { | ||
super(props, shape, modelDir, modelName, tag, dynamicShape, textures); | ||
} | ||
|
||
@Override | ||
@Nullable | ||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { | ||
Debug.Log("Overriding entity correctly"); | ||
return new CrusherBlockEntity(pos, state); | ||
} | ||
|
||
@Override | ||
public MenuProvider getMenu(BlockState state, Level level, BlockPos pos) { //TODO | ||
return null; | ||
} | ||
|
||
@Override | ||
protected InteractionResult onRightClick(BlockState state, Level level, BlockPos pos, Player player) { | ||
if (!level.isClientSide && player instanceof ServerPlayer serverPlayer) { | ||
NetworkHooks.openScreen(serverPlayer, state.getMenuProvider(level, pos)); | ||
return InteractionResult.CONSUME; | ||
} | ||
return InteractionResult.PASS; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/fureniku/roads/blocks/entityblock/FabricatorEntityBlock.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
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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/fureniku/roads/registrations/RoadMenuTypes.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,10 @@ | ||
package com.fureniku.roads.registrations; | ||
|
||
import com.fureniku.roads.blockentities.menus.CrusherMenu; | ||
import net.minecraft.world.inventory.MenuType; | ||
import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; | ||
|
||
public class RoadMenuTypes { | ||
|
||
public static final MenuType<CrusherMenu> CRUSHER_MENU = IMenuTypeExtension.create((windowId, inv, data) -> new CrusherMenu(windowId, inv, data)); | ||
} |