Skip to content

Commit

Permalink
Menus 2/2
Browse files Browse the repository at this point in the history
  • Loading branch information
ReclipseTheOne committed Dec 16, 2024
1 parent d1a24b5 commit 9f6d26e
Show file tree
Hide file tree
Showing 21 changed files with 256 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.21.1 2024-12-16T01:42:11.7301004 Item Models: nautec
// 1.21.1 2024-12-16T12:56:36.5432444 Item Models: nautec
53692692f57914fc54eb6ebf416ce1cb7789e57b assets/nautec/models/item/air_bottle.json
cc6ee3887ec6e0c53216dc681ac7b32b34182253 assets/nautec/models/item/anchor.json
2e336fce57acffa1d0eb621baa30a26f665b4924 assets/nautec/models/item/aquarine_steel_axe.json
Expand All @@ -24,6 +24,7 @@ f60b23b8ca6d44e339c9c415f53102833b4ff633 assets/nautec/models/item/atlantic_gold
a95dff0d56139e74443ee5069394ccbe31bc875a assets/nautec/models/item/atlantic_gold_nugget.json
6338d151fe16332a6bd885776f58d9c9a4ffad62 assets/nautec/models/item/augmentation_station.json
f616877025b33a5d417689bd59cba3385b11e5c9 assets/nautec/models/item/augmentation_station_extension.json
77496bd37cb0cd85dfb77e146366322e44bfcd63 assets/nautec/models/item/bacterial_analyzer.json
cd68bca3502f5a671aa5c4bbd828397047b19b8b assets/nautec/models/item/bio_reactor.json
b1e3c9080ae5a0f78b06fa90f3c5da5b3805f842 assets/nautec/models/item/broken_whisk.json
cf1524c962ddbbf1cb5e8782d764e71888a03eb1 assets/nautec/models/item/brown_polymer.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21.1 2024-12-15T20:55:07.97208459 Languages: en_us
02e2bf78f797075e71df78423d05779abc093c05 assets/nautec/lang/en_us.json
// 1.21.1 2024-12-16T12:56:36.5452448 Languages: en_us
cb59c9cda54c192d94a6d91598a550f3a0a55062 assets/nautec/lang/en_us.json
6 changes: 6 additions & 0 deletions src/generated/resources/assets/nautec/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"block.nautec.augmentation_station": "Augmentation Station",
"block.nautec.augmentation_station_extension": "Augmentation Station Extension",
"block.nautec.augmentation_station_part": "Augmentation Station",
"block.nautec.bacterial_analyzer": "Bacterial Analyzer",
"block.nautec.bio_reactor": "Bio Reactor",
"block.nautec.charger": "Charger",
"block.nautec.chiseled_dark_prismarine": "Chiseled Dark Prismarine",
Expand Down Expand Up @@ -194,6 +195,7 @@
"item.nautec.guardian_eye": "Guardian Eye",
"item.nautec.laser_channeling_coil": "Laser Channeling Coil",
"item.nautec.neptunes_trident": "Neptune's Trident",
"item.nautec.petri_dish": "Petri Dish",
"item.nautec.prism_monocle": "Prism Monocle",
"item.nautec.prismarine_crystal_shard": "Prismarine Crystal Shard",
"item.nautec.prismatic_battery": "Prismatic Battery",
Expand Down Expand Up @@ -226,5 +228,9 @@
"nautec.tool.shovel.ability": "Ability: Mine in a 3x3 Area",
"nautec.tool.status": "Status: ",
"nautec.tool.sword.ability": "Ability: Deal 70% more damage and spawn lightnings at targets",
"nautec:cyanobacteria": "Cyanobacteria",
"nautec:halobacteria": "Halobacteria",
"nautec:methanogens": "Methanogens",
"nautec:thermophiles": "Thermophiles",
"nautec_guide.desc.0": "Nautec's Guide"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "nautec:block/bacterial_analyzer"
}
8 changes: 6 additions & 2 deletions src/main/java/com/portingdeadmods/nautec/NautecClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import com.portingdeadmods.nautec.client.renderer.augments.SimpleAugmentRenderer;
import com.portingdeadmods.nautec.client.renderer.blockentities.*;
import com.portingdeadmods.nautec.client.renderer.robotArms.ClawRobotArmRenderer;
import com.portingdeadmods.nautec.client.screen.AugmentationStationExtensionScreen;
import com.portingdeadmods.nautec.client.screen.CrateScreen;
import com.portingdeadmods.nautec.client.screen.*;
import com.portingdeadmods.nautec.data.NTDataComponents;
import com.portingdeadmods.nautec.data.NTDataComponentsUtils;
import com.portingdeadmods.nautec.events.helper.AugmentLayerRenderer;
Expand Down Expand Up @@ -219,6 +218,11 @@ private void registerLayerDefinitions(EntityRenderersEvent.RegisterLayerDefiniti
private void registerMenus(RegisterMenuScreensEvent event) {
event.register(NTMenuTypes.CRATE.get(), CrateScreen::new);
event.register(NTMenuTypes.AUGMENT_STATION_EXTENSION.get(), AugmentationStationExtensionScreen::new);

event.register(NTMenuTypes.INCUBATOR.get(), IncubatorScreen::new);
event.register(NTMenuTypes.MUTATOR.get(), MutatorScreen::new);
event.register(NTMenuTypes.BIO_REACTOR.get(), BioReactorScreen::new);
event.register(NTMenuTypes.BACTERIAL_ANALYZER.get(), BacterialAnalyzerScreen::new);
}

private void onFMLClientSetupEvent(final FMLClientSetupEvent event) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.portingdeadmods.nautec.client.screen;

import com.portingdeadmods.nautec.Nautec;
import com.portingdeadmods.nautec.api.client.screen.NTAbstractContainerScreen;
import com.portingdeadmods.nautec.api.menu.NTAbstractContainerMenu;
import com.portingdeadmods.nautec.content.blockentities.BacterialAnalyzerBlockEntity;
import com.portingdeadmods.nautec.content.blockentities.multiblock.part.AugmentationStationExtensionBlockEntity;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import org.jetbrains.annotations.NotNull;

public class BacterialAnalyzerScreen extends NTAbstractContainerScreen<BacterialAnalyzerBlockEntity> {
public static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Nautec.MODID, "textures/gui/bacterial_analyzer.png");

public BacterialAnalyzerScreen(NTAbstractContainerMenu<BacterialAnalyzerBlockEntity> menu, Inventory playerInventory, Component title) {
super(menu, playerInventory, title);
this.titleLabelY = 4;
}

@Override
public @NotNull ResourceLocation getBackgroundTexture() {
return TEXTURE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.portingdeadmods.nautec.client.screen;

import com.portingdeadmods.nautec.Nautec;
import com.portingdeadmods.nautec.api.client.screen.NTAbstractContainerScreen;
import com.portingdeadmods.nautec.api.menu.NTAbstractContainerMenu;
import com.portingdeadmods.nautec.content.blockentities.BioReactorBlockEntity;
import com.portingdeadmods.nautec.content.blockentities.multiblock.part.AugmentationStationExtensionBlockEntity;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import org.jetbrains.annotations.NotNull;

public class BioReactorScreen extends NTAbstractContainerScreen<BioReactorBlockEntity> {
public static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Nautec.MODID, "textures/gui/bio_reactor.png");

public BioReactorScreen(NTAbstractContainerMenu<BioReactorBlockEntity> menu, Inventory playerInventory, Component title) {
super(menu, playerInventory, title);
this.titleLabelY = 4;
}

@Override
public @NotNull ResourceLocation getBackgroundTexture() {
return TEXTURE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.portingdeadmods.nautec.client.screen;

import com.portingdeadmods.nautec.Nautec;
import com.portingdeadmods.nautec.api.client.screen.NTAbstractContainerScreen;
import com.portingdeadmods.nautec.api.menu.NTAbstractContainerMenu;
import com.portingdeadmods.nautec.content.blockentities.IncubatorBlockEntity;
import com.portingdeadmods.nautec.content.blockentities.multiblock.part.AugmentationStationExtensionBlockEntity;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import org.jetbrains.annotations.NotNull;

public class IncubatorScreen extends NTAbstractContainerScreen<IncubatorBlockEntity> {
public static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Nautec.MODID, "textures/gui/incubator.png");

public IncubatorScreen(NTAbstractContainerMenu<IncubatorBlockEntity> menu, Inventory playerInventory, Component title) {
super(menu, playerInventory, title);
this.titleLabelY = 4;
}

@Override
public @NotNull ResourceLocation getBackgroundTexture() {
return TEXTURE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.portingdeadmods.nautec.client.screen;

import com.portingdeadmods.nautec.Nautec;
import com.portingdeadmods.nautec.api.client.screen.NTAbstractContainerScreen;
import com.portingdeadmods.nautec.api.menu.NTAbstractContainerMenu;
import com.portingdeadmods.nautec.content.blockentities.MutatorBlockEntity;
import com.portingdeadmods.nautec.content.blockentities.multiblock.part.AugmentationStationExtensionBlockEntity;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import org.jetbrains.annotations.NotNull;

public class MutatorScreen extends NTAbstractContainerScreen<MutatorBlockEntity> {
public static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Nautec.MODID, "textures/gui/mutator.png");

public MutatorScreen(NTAbstractContainerMenu<MutatorBlockEntity> menu, Inventory playerInventory, Component title) {
super(menu, playerInventory, title);
this.titleLabelY = 4;
}

@Override
public @NotNull ResourceLocation getBackgroundTexture() {
return TEXTURE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.portingdeadmods.nautec.content.blockentities;

import com.portingdeadmods.nautec.api.blockentities.LaserBlockEntity;
import com.portingdeadmods.nautec.capabilities.IOActions;
import com.portingdeadmods.nautec.content.menus.BacterialAnalyzerMenu;
import com.portingdeadmods.nautec.content.menus.MutatorMenu;
import com.portingdeadmods.nautec.registries.NTBlockEntityTypes;
import it.unimi.dsi.fastutil.Pair;
import it.unimi.dsi.fastutil.objects.ObjectSet;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.neoforge.capabilities.BlockCapability;
import org.jetbrains.annotations.Nullable;

import java.util.Map;

public class BacterialAnalyzerBlockEntity extends LaserBlockEntity implements MenuProvider {


public BacterialAnalyzerBlockEntity(BlockPos blockPos, BlockState blockState) {
super(NTBlockEntityTypes.BACTERIAL_ANALYZER.get(), blockPos, blockState);
addItemHandler(1);
}

@Override
public ObjectSet<Direction> getLaserInputs() {
return ObjectSet.of(Direction.UP, Direction.DOWN);
}

@Override
public ObjectSet<Direction> getLaserOutputs() {
return ObjectSet.of();
}

@Override
public <T> Map<Direction, Pair<IOActions, int[]>> getSidedInteractions(BlockCapability<T, @Nullable Direction> capability) {
return Map.of();
}

@Override
public Component getDisplayName() {
return Component.literal("Bacterial Analyzer");
}

@Override
public @Nullable AbstractContainerMenu createMenu(int containerId, Inventory playerInventory, Player player) {
return new BacterialAnalyzerMenu(containerId, playerInventory, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class BioReactorBlockEntity extends LaserBlockEntity implements MenuProvi

public BioReactorBlockEntity(BlockPos blockPos, BlockState blockState) {
super(NTBlockEntityTypes.BIO_REACTOR.get(), blockPos, blockState);
addItemHandler(2);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class IncubatorBlockEntity extends LaserBlockEntity implements MenuProvid

public IncubatorBlockEntity(BlockPos blockPos, BlockState blockState) {
super(NTBlockEntityTypes.INCUBATOR.get(), blockPos, blockState);
addItemHandler(1);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class MutatorBlockEntity extends LaserBlockEntity implements MenuProvider

public MutatorBlockEntity(BlockPos blockPos, BlockState blockState) {
super(NTBlockEntityTypes.MUTATOR.get(), blockPos, blockState);
addItemHandler(1);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.portingdeadmods.nautec.content.blocks;

import com.mojang.serialization.MapCodec;
import com.portingdeadmods.nautec.api.blockentities.ContainerBlockEntity;
import com.portingdeadmods.nautec.api.blocks.blockentities.LaserBlock;
import com.portingdeadmods.nautec.registries.NTBlockEntityTypes;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.entity.BlockEntityType;

public class BacterialAnalyzerBlock extends LaserBlock {
public BacterialAnalyzerBlock(Properties properties) {
super(properties);
}

@Override
public BlockEntityType<? extends ContainerBlockEntity> getBlockEntityType() {
return NTBlockEntityTypes.BACTERIAL_ANALYZER.get();
}

@Override
protected MapCodec<? extends BaseEntityBlock> codec() {
return simpleCodec(BacterialAnalyzerBlock::new);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.portingdeadmods.nautec.content.menus;

import com.portingdeadmods.nautec.api.menu.NTAbstractContainerMenu;
import com.portingdeadmods.nautec.content.blockentities.BacterialAnalyzerBlockEntity;
import com.portingdeadmods.nautec.content.blockentities.MutatorBlockEntity;
import com.portingdeadmods.nautec.registries.NTMenuTypes;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.player.Inventory;
import net.neoforged.neoforge.items.SlotItemHandler;
import org.jetbrains.annotations.NotNull;

public class BacterialAnalyzerMenu extends NTAbstractContainerMenu<BacterialAnalyzerBlockEntity> {
public BacterialAnalyzerMenu(int containerId, Inventory inv, FriendlyByteBuf extraData) {
this(containerId, inv, (BacterialAnalyzerBlockEntity) inv.player.level().getBlockEntity(extraData.readBlockPos()));
}

public BacterialAnalyzerMenu(int containerId, @NotNull Inventory inv, @NotNull BacterialAnalyzerBlockEntity blockEntity) {
super(NTMenuTypes.BACTERIAL_ANALYZER.get(), containerId, inv, blockEntity);

// Catalyst
addSlot(new SlotItemHandler(blockEntity.getItemHandler(), 0, 80, 35));

addPlayerInventory(inv, 84);
addPlayerHotbar(inv, 142);
}

@Override
protected int getMergeableSlotCount() {
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public BioReactorMenu(int containerId, Inventory inv, FriendlyByteBuf extraData)
}

public BioReactorMenu(int containerId, @NotNull Inventory inv, @NotNull BioReactorBlockEntity blockEntity) {
super(NTMenuTypes.INCUBATOR.get(), containerId, inv, blockEntity);
super(NTMenuTypes.BIO_REACTOR.get(), containerId, inv, blockEntity);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ protected void registerStatesAndModels() {
laserJunction(NTBlocks.LASER_JUNCTION.get());

// Stuff
//simpleBlock(NTBlocks.PRISMARINE_SAND.get()); Ya didnt commit the texture
simpleBlock(NTBlocks.MIXER.get(), models().getExistingFile(existingModelFile(NTBlocks.MIXER.get())));
simpleBlock(NTBlocks.CHARGER.get(), models().getExistingFile(existingModelFile(NTBlocks.CHARGER.get())));
simpleBlock(NTBlocks.FISHING_STATION.get(), models().getExistingFile(existingModelFile(NTBlocks.FISHING_STATION.get())));
crateBlock(NTBlocks.CRATE.get());
rustyCrateBlock(NTBlocks.RUSTY_CRATE.get());

// Biology - TODO: Models
// mutator(NTBlocks.MUTATOR.get());
// bacterialAnalyzer(NTBlocks.BACTERIAL_ANALYZER.get());
// incubator(NTBlocks.INCUBATOR.get());
// bioReactor(NTBlocks.BIO_REACTOR.get());

// Multiblock
drainController(NTBlocks.DRAIN.get());
drainPart(NTBlocks.DRAIN_PART.get(), IntegerRange.of(0, 8));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ protected void addTranslations() {
addItem(RUSTY_GEAR, "Rusty Gear");
addItem(GEAR, "Gear");
addItem(ANCIENT_VALVE, "Ancient Valve");
addItem(PETRI_DISH, "Petri Dish");

// Adding missing items
addItem("drowned_lungs", "Drowned Lungs");
Expand Down Expand Up @@ -106,6 +107,7 @@ protected void addTranslations() {
addBlock(NTBlocks.MUTATOR, "Mutator");
addBlock(NTBlocks.INCUBATOR, "Incubator");
addBlock(NTBlocks.BIO_REACTOR, "Bio Reactor");
addBlock(NTBlocks.BACTERIAL_ANALYZER, "Bacterial Analyzer");

// Multiblock information
add("multiblock.info.failed_to_construct", "Missing or invalid block");
Expand Down Expand Up @@ -147,6 +149,12 @@ protected void addTranslations() {
add("nautec.tool.power", "Power: ");
add("nautec.tool.enabled", "Enabled");
add("nautec.tool.disabled", "Shift + Right Click to Enable");

// Bacteria
add("nautec:cyanobacteria", "Cyanobacteria");
add("nautec:halobacteria", "Halobacteria");
add("nautec:thermophiles", "Thermophiles");
add("nautec:methanogens", "Methanogens");
}

private void addFluidType(Supplier<? extends FluidType> fluidType, String val) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public final class NTBlockEntityTypes {
public static final Supplier<BlockEntityType<BioReactorBlockEntity>> BIO_REACTOR = BLOCK_ENTITIES.register("bio_reactor",
() -> BlockEntityType.Builder.of(BioReactorBlockEntity::new,
NTBlocks.BIO_REACTOR.get()).build(null));
public static final Supplier<BlockEntityType<BacterialAnalyzerBlockEntity>> BACTERIAL_ANALYZER = BLOCK_ENTITIES.register("bacterial_analyzer",
() -> BlockEntityType.Builder.of(BacterialAnalyzerBlockEntity::new,
NTBlocks.BACTERIAL_ANALYZER.get()).build(null));

public static final Supplier<BlockEntityType<CreativePowerSourceBlockEntity>> CREATIVE_POWER_SOURCE = BLOCK_ENTITIES.register("creative_power_source",
() -> BlockEntityType.Builder.of(CreativePowerSourceBlockEntity::new,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.portingdeadmods.nautec.registries;

import com.portingdeadmods.nautec.Nautec;
import com.portingdeadmods.nautec.content.blockentities.BacterialAnalyzerBlockEntity;
import com.portingdeadmods.nautec.content.items.blocks.PrismarineCrystalItem;
import com.portingdeadmods.nautec.content.blocks.*;
import com.portingdeadmods.nautec.content.blocks.multiblock.controller.AugmentationStationBlock;
Expand Down Expand Up @@ -76,6 +77,8 @@ public final class NTBlocks {
BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK));
public static final DeferredBlock<BioReactorBlock> BIO_REACTOR = registerBlockAndItem("bio_reactor", BioReactorBlock::new,
BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK));
public static final DeferredBlock<BacterialAnalyzerBlock> BACTERIAL_ANALYZER = registerBlockAndItem("bacterial_analyzer", BacterialAnalyzerBlock::new,
BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK));

// MULTIBLOCKS
public static final DeferredBlock<DrainBlock> DRAIN = registerBlockAndItem("deep_sea_drain", DrainBlock::new,
Expand Down
Loading

0 comments on commit 9f6d26e

Please sign in to comment.