Actually rename everything back to match minecraft style
because most of other stuff is named this way anyway
This commit is contained in:
parent
dd6d30e011
commit
cdb72a610b
@ -17,10 +17,10 @@ import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.registry.Registry
|
||||
import ru.dbotthepony.mc.otm.registry.MBlocks
|
||||
import ru.dbotthepony.mc.otm.registry.MItems
|
||||
import ru.dbotthepony.mc.otm.block.BlockDriveViewer
|
||||
import ru.dbotthepony.mc.otm.block.BlockEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.block.DriveViewerBlock
|
||||
import ru.dbotthepony.mc.otm.block.EnergyCounterBlock
|
||||
import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable
|
||||
import ru.dbotthepony.mc.otm.block.BlockPatternStorage
|
||||
import ru.dbotthepony.mc.otm.block.PatternStorageBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.datagen.blocks.BatteryBankProvider
|
||||
import ru.dbotthepony.mc.otm.datagen.blocks.MatterBankProvider
|
||||
@ -248,7 +248,7 @@ object DataGen {
|
||||
.rotationY(facing.toYRotBlockstate())
|
||||
.addModel()
|
||||
.condition(BlockMatteryRotatable.FACING, facing)
|
||||
.condition(BlockDriveViewer.DRIVE_PRESENT, true)
|
||||
.condition(DriveViewerBlock.DRIVE_PRESENT, true)
|
||||
|
||||
for (workState in WorkerState.SEMI_WORKER_STATE.possibleValues) {
|
||||
part()
|
||||
@ -269,7 +269,7 @@ object DataGen {
|
||||
.rotationY(facing.toYRotBlockstate())
|
||||
.addModel()
|
||||
.condition(BlockMatteryRotatable.FACING, facing)
|
||||
.condition(BlockPatternStorage.PATTERN_STORAGE_DISKS_PROPS[i], true)
|
||||
.condition(PatternStorageBlock.PATTERN_STORAGE_DISKS_PROPS[i], true)
|
||||
}
|
||||
|
||||
part()
|
||||
@ -298,28 +298,28 @@ object DataGen {
|
||||
val south_west = provider.models().getExistingFile(ResourceLocation(MOD_ID, "block/energy_counter_south_west"))
|
||||
|
||||
for (dir in arrayOf(Direction.EAST, Direction.WEST, Direction.SOUTH, Direction.NORTH)) {
|
||||
part().modelFile(down).rotationY(dir.toYRotBlockstate()).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.UP).condition(BlockEnergyCounter.IF_DIRECTION, dir)
|
||||
part().modelFile(up).rotationY(dir.toYRotBlockstate()).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.DOWN).condition(BlockEnergyCounter.IF_DIRECTION, dir)
|
||||
part().modelFile(down).rotationY(dir.toYRotBlockstate()).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.UP).condition(EnergyCounterBlock.IF_DIRECTION, dir)
|
||||
part().modelFile(up).rotationY(dir.toYRotBlockstate()).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.DOWN).condition(EnergyCounterBlock.IF_DIRECTION, dir)
|
||||
}
|
||||
|
||||
// низкий поклон за полностью рабочий поворот вокруг оси Z
|
||||
part().modelFile(north).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.NORTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.UP)
|
||||
part().modelFile(north_down).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.NORTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.DOWN)
|
||||
part().modelFile(north_east).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.NORTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.EAST)
|
||||
part().modelFile(north_west).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.NORTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.WEST)
|
||||
part().modelFile(north).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP)
|
||||
part().modelFile(north_down).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN)
|
||||
part().modelFile(north_east).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.EAST)
|
||||
part().modelFile(north_west).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.WEST)
|
||||
|
||||
part().modelFile(south).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.SOUTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.UP)
|
||||
part().modelFile(south_down).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.SOUTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.DOWN)
|
||||
part().modelFile(south_east).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.SOUTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.EAST)
|
||||
part().modelFile(south_west).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.SOUTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.WEST)
|
||||
part().modelFile(south).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP)
|
||||
part().modelFile(south_down).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN)
|
||||
part().modelFile(south_east).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.EAST)
|
||||
part().modelFile(south_west).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.WEST)
|
||||
|
||||
for (dir in arrayOf(Direction.WEST, Direction.EAST)) {
|
||||
val mdl = if (dir === Direction.WEST) west else east
|
||||
|
||||
part().modelFile(mdl).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, dir).condition(BlockEnergyCounter.IF_DIRECTION, Direction.NORTH)
|
||||
part().modelFile(mdl).rotationX(-90).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, dir).condition(BlockEnergyCounter.IF_DIRECTION, Direction.UP)
|
||||
part().modelFile(mdl).rotationX(180).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, dir).condition(BlockEnergyCounter.IF_DIRECTION, Direction.SOUTH)
|
||||
part().modelFile(mdl).rotationX(90).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, dir).condition(BlockEnergyCounter.IF_DIRECTION, Direction.DOWN)
|
||||
part().modelFile(mdl).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.NORTH)
|
||||
part().modelFile(mdl).rotationX(-90).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP)
|
||||
part().modelFile(mdl).rotationX(180).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.SOUTH)
|
||||
part().modelFile(mdl).rotationX(90).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.world.level.block.Block
|
||||
import net.minecraftforge.client.model.generators.BlockStateProvider
|
||||
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent
|
||||
import ru.dbotthepony.mc.otm.block.BlockBatteryBank
|
||||
import ru.dbotthepony.mc.otm.block.BatteryBankBlock
|
||||
import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable
|
||||
import ru.dbotthepony.mc.otm.datagen.DataGen
|
||||
import ru.dbotthepony.mc.otm.datagen.toYRotBlockstate
|
||||
@ -35,7 +35,7 @@ open class BatteryBankProvider(event: GatherDataEvent) : BlockStateProvider(even
|
||||
models().getExistingFile(ResourceLocation("overdrive_that_matters:$batteryPath$i"))
|
||||
).rotationY(it.toYRotBlockstate()).addModel()
|
||||
.condition(BlockMatteryRotatable.FACING, it)
|
||||
.condition(BlockBatteryBank.BATTERY_SLOTS_PROPS[i], true)
|
||||
.condition(BatteryBankBlock.BATTERY_SLOTS_PROPS[i], true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,14 +3,7 @@ package ru.dbotthepony.mc.otm;
|
||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.event.server.ServerAboutToStartEvent;
|
||||
import net.minecraftforge.event.server.ServerStoppingEvent;
|
||||
import net.minecraftforge.eventbus.api.EventPriority;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
@ -27,7 +20,7 @@ import ru.dbotthepony.mc.otm.client.EventHandler;
|
||||
import ru.dbotthepony.mc.otm.client.model.GravitationStabilizerModel;
|
||||
import ru.dbotthepony.mc.otm.client.model.TritaniumArmorModel;
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction;
|
||||
import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive;
|
||||
import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem;
|
||||
import ru.dbotthepony.mc.otm.matter.MatterDataKt;
|
||||
import ru.dbotthepony.mc.otm.matter.MatterRegistryKt;
|
||||
import ru.dbotthepony.mc.otm.network.MatteryNetworking;
|
||||
@ -37,10 +30,6 @@ import ru.dbotthepony.mc.otm.storage.StorageObjectRegistry;
|
||||
import ru.dbotthepony.mc.otm.storage.StorageObjectTuple;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import java.util.ArrayList;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
// The value here should match an entry in the META-INF/mods.toml file
|
||||
@Mod(OverdriveThatMatters.MOD_ID)
|
||||
@ -90,7 +79,7 @@ public final class OverdriveThatMatters {
|
||||
FMLJavaModLoadingContext.get().getModEventBus().register(MRecipes.class);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(DrivePool.INSTANCE);
|
||||
MinecraftForge.EVENT_BUS.register(ItemPortableCondensationDrive.Companion);
|
||||
MinecraftForge.EVENT_BUS.register(PortableCondensationDriveItem.Companion);
|
||||
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(AndroidCapability::registerEffects);
|
||||
|
||||
|
@ -3,9 +3,7 @@ package ru.dbotthepony.mc.otm.block;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.EntityBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
@ -19,7 +17,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterCable;
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterCableBlockEntity;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
@ -31,7 +29,7 @@ public class BlockMatterCable extends Block implements EntityBlock {
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||
return new BlockEntityMatterCable(blockPos, blockState);
|
||||
return new MatterCableBlockEntity(blockPos, blockState);
|
||||
}
|
||||
|
||||
public static final BooleanProperty CONNECTION_SOUTH = BooleanProperty.create("connect_south");
|
||||
|
@ -9,7 +9,7 @@ import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterTask;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.PatternState;
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
|
||||
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu;
|
||||
import ru.dbotthepony.mc.otm.network.MatteryNetworking;
|
||||
import ru.dbotthepony.mc.otm.network.PatternReplicationRequestPacket;
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.*;
|
||||
@ -19,11 +19,11 @@ import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MatterPanelScreen extends MatteryScreen<MenuMatterPanel> {
|
||||
public class MatterPanelScreen extends MatteryScreen<MatterPanelMenu> {
|
||||
private static final int MODAL_WIDTH = 213;
|
||||
private static final int MODAL_HEIGHT = 110;
|
||||
|
||||
public MatterPanelScreen(MenuMatterPanel p_97741_, Inventory p_97742_, Component p_97743_) {
|
||||
public MatterPanelScreen(MatterPanelMenu p_97741_, Inventory p_97742_, Component p_97743_) {
|
||||
super(p_97741_, p_97742_, p_97743_);
|
||||
|
||||
imageWidth = 176;
|
||||
|
@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.network;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterTask;
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
|
||||
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.Supplier;
|
||||
@ -28,7 +28,7 @@ public record CancelMatterTaskPacket(UUID id) {
|
||||
context.get().enqueueWork(() -> {
|
||||
var player = context.get().getSender();
|
||||
|
||||
if (player.containerMenu instanceof MenuMatterPanel menu) {
|
||||
if (player.containerMenu instanceof MatterPanelMenu menu) {
|
||||
menu.receiveTaskCancel(player, id);
|
||||
}
|
||||
});
|
||||
|
@ -7,7 +7,7 @@ import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterTask;
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
|
||||
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import java.util.ArrayList;
|
||||
@ -31,7 +31,7 @@ public record MatterTaskPacket(boolean action, Collection<MatterTask> state) {
|
||||
}
|
||||
|
||||
private void playClient() {
|
||||
if (Minecraft.getInstance().player.containerMenu instanceof MenuMatterPanel menu) {
|
||||
if (Minecraft.getInstance().player.containerMenu instanceof MatterPanelMenu menu) {
|
||||
if (action)
|
||||
menu.networkTasksUpdated(state);
|
||||
else
|
||||
|
@ -12,7 +12,7 @@ import ru.dbotthepony.mc.otm.matter.RegistryPacketClear;
|
||||
import ru.dbotthepony.mc.otm.matter.RegistryPacketFullUpdate;
|
||||
import ru.dbotthepony.mc.otm.matter.RegistryPacketRemove;
|
||||
import ru.dbotthepony.mc.otm.matter.RegistryPacketUpdate;
|
||||
import ru.dbotthepony.mc.otm.menu.MenuDriveViewer;
|
||||
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu;
|
||||
import ru.dbotthepony.mc.otm.menu.data.*;
|
||||
import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputPacket;
|
||||
import ru.dbotthepony.mc.otm.menu.widget.NumberPlayerInputPacket;
|
||||
@ -232,19 +232,19 @@ public class MatteryNetworking {
|
||||
|
||||
CHANNEL.registerMessage(
|
||||
next_network_id++,
|
||||
MenuDriveViewer.FilterSwitchPacket.class,
|
||||
MenuDriveViewer.FilterSwitchPacket::write,
|
||||
MenuDriveViewer.FilterSwitchPacket::read,
|
||||
MenuDriveViewer.FilterSwitchPacket::play,
|
||||
DriveViewerMenu.FilterSwitchPacket.class,
|
||||
DriveViewerMenu.FilterSwitchPacket::write,
|
||||
DriveViewerMenu.FilterSwitchPacket::read,
|
||||
DriveViewerMenu.FilterSwitchPacket::play,
|
||||
Optional.of(NetworkDirection.PLAY_TO_SERVER)
|
||||
);
|
||||
|
||||
CHANNEL.registerMessage(
|
||||
next_network_id++,
|
||||
MenuDriveViewer.FilterSetPacket.class,
|
||||
MenuDriveViewer.FilterSetPacket::write,
|
||||
MenuDriveViewer.FilterSetPacket::read,
|
||||
MenuDriveViewer.FilterSetPacket::play,
|
||||
DriveViewerMenu.FilterSetPacket.class,
|
||||
DriveViewerMenu.FilterSetPacket::write,
|
||||
DriveViewerMenu.FilterSetPacket::read,
|
||||
DriveViewerMenu.FilterSetPacket::play,
|
||||
Optional.of(NetworkDirection.PLAY_TO_SERVER)
|
||||
);
|
||||
|
||||
|
@ -7,7 +7,7 @@ import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.PatternState;
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
|
||||
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import java.util.ArrayList;
|
||||
@ -31,7 +31,7 @@ public record PatternGridPacket(boolean action, Collection<PatternState> state)
|
||||
}
|
||||
|
||||
private void playClient() {
|
||||
if (Minecraft.getInstance().player.containerMenu instanceof MenuMatterPanel menu) {
|
||||
if (Minecraft.getInstance().player.containerMenu instanceof MatterPanelMenu menu) {
|
||||
if (action)
|
||||
menu.networkPatternsUpdated(state);
|
||||
else
|
||||
|
@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.network;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.PatternState;
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
|
||||
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@ -27,7 +27,7 @@ public record PatternReplicationRequestPacket(PatternState state, int how_much)
|
||||
|
||||
var ply = context.get().getSender();
|
||||
|
||||
if (ply.containerMenu instanceof MenuMatterPanel menu)
|
||||
if (ply.containerMenu instanceof MatterPanelMenu menu)
|
||||
menu.requestReplication(ply, state, how_much);
|
||||
});
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import ru.dbotthepony.mc.otm.block.entity.*;
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole;
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity;
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityExplosionDebugger;
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntitySphereDebugger;
|
||||
import ru.dbotthepony.mc.otm.client.render.BlackHoleRenderer;
|
||||
@ -14,26 +14,26 @@ import ru.dbotthepony.mc.otm.client.render.EnergyCounterRenderer;
|
||||
import ru.dbotthepony.mc.otm.client.render.GravitationStabilizerRenderer;
|
||||
|
||||
public class MBlockEntities {
|
||||
public static final BlockEntityType<BlockEntityAndroidStation> ANDROID_STATION = BlockEntityType.Builder.of(BlockEntityAndroidStation::new, MBlocks.ANDROID_STATION).build(null);
|
||||
public static final BlockEntityType<BlockEntityBatteryBank> BATTERY_BANK = BlockEntityType.Builder.of(BlockEntityBatteryBank::new, MBlocks.BATTERY_BANK).build(null);
|
||||
public static final BlockEntityType<BlockEntityMatterDecomposer> MATTER_DECOMPOSER = BlockEntityType.Builder.of(BlockEntityMatterDecomposer::new, MBlocks.MATTER_DECOMPOSER).build(null);
|
||||
public static final BlockEntityType<BlockEntityMatterCapacitorBank> MATTER_CAPACITOR_BANK = BlockEntityType.Builder.of(BlockEntityMatterCapacitorBank::new, MBlocks.MATTER_CAPACITOR_BANK).build(null);
|
||||
public static final BlockEntityType<BlockEntityMatterCable> MATTER_CABLE = BlockEntityType.Builder.of(BlockEntityMatterCable::new, MBlocks.MATTER_CABLE).build(null);
|
||||
public static final BlockEntityType<BlockEntityPatternStorage> PATTERN_STORAGE = BlockEntityType.Builder.of(BlockEntityPatternStorage::new, MBlocks.PATTERN_STORAGE).build(null);
|
||||
public static final BlockEntityType<BlockEntityMatterScanner> MATTER_SCANNER = BlockEntityType.Builder.of(BlockEntityMatterScanner::new, MBlocks.MATTER_SCANNER).build(null);
|
||||
public static final BlockEntityType<BlockEntityMatterPanel> MATTER_PANEL = BlockEntityType.Builder.of(BlockEntityMatterPanel::new, MBlocks.MATTER_PANEL).build(null);
|
||||
public static final BlockEntityType<BlockEntityMatterReplicator> MATTER_REPLICATOR = BlockEntityType.Builder.of(BlockEntityMatterReplicator::new, MBlocks.MATTER_REPLICATOR).build(null);
|
||||
public static final BlockEntityType<BlockEntityMatterBottler> MATTER_BOTTLER = BlockEntityType.Builder.of(BlockEntityMatterBottler::new, MBlocks.MATTER_BOTTLER).build(null);
|
||||
public static final BlockEntityType<BlockEntityDriveViewer> DRIVE_VIEWER = BlockEntityType.Builder.of(BlockEntityDriveViewer::new, MBlocks.DRIVE_VIEWER).build(null);
|
||||
public static final BlockEntityType<BlockEntityBlackHole> BLACK_HOLE = BlockEntityType.Builder.of(BlockEntityBlackHole::new, MBlocks.BLACK_HOLE).build(null);
|
||||
public static final BlockEntityType<BlockEntityCargoCrate> CARGO_CRATE = BlockEntityType.Builder.of(BlockEntityCargoCrate::new, MBlocks.CARGO_CRATE).build(null);
|
||||
public static final BlockEntityType<BlockEntityDriveRack> DRIVE_RACK = BlockEntityType.Builder.of(BlockEntityDriveRack::new, MBlocks.DRIVE_RACK).build(null);
|
||||
public static final BlockEntityType<BlockEntityItemMonitor> ITEM_MONITOR = BlockEntityType.Builder.of(BlockEntityItemMonitor::new, MBlocks.ITEM_MONITOR).build(null);
|
||||
public static final BlockEntityType<AndroidStationBlockEntity> ANDROID_STATION = BlockEntityType.Builder.of(AndroidStationBlockEntity::new, MBlocks.ANDROID_STATION).build(null);
|
||||
public static final BlockEntityType<BatteryBankBlockEntity> BATTERY_BANK = BlockEntityType.Builder.of(BatteryBankBlockEntity::new, MBlocks.BATTERY_BANK).build(null);
|
||||
public static final BlockEntityType<MatterDecomposerBlockEntity> MATTER_DECOMPOSER = BlockEntityType.Builder.of(MatterDecomposerBlockEntity::new, MBlocks.MATTER_DECOMPOSER).build(null);
|
||||
public static final BlockEntityType<MatterCapacitorBankBlockEntity> MATTER_CAPACITOR_BANK = BlockEntityType.Builder.of(MatterCapacitorBankBlockEntity::new, MBlocks.MATTER_CAPACITOR_BANK).build(null);
|
||||
public static final BlockEntityType<MatterCableBlockEntity> MATTER_CABLE = BlockEntityType.Builder.of(MatterCableBlockEntity::new, MBlocks.MATTER_CABLE).build(null);
|
||||
public static final BlockEntityType<PatternStorageBlockEntity> PATTERN_STORAGE = BlockEntityType.Builder.of(PatternStorageBlockEntity::new, MBlocks.PATTERN_STORAGE).build(null);
|
||||
public static final BlockEntityType<MatterScannerBlockEntity> MATTER_SCANNER = BlockEntityType.Builder.of(MatterScannerBlockEntity::new, MBlocks.MATTER_SCANNER).build(null);
|
||||
public static final BlockEntityType<MatterPanelBlockEntity> MATTER_PANEL = BlockEntityType.Builder.of(MatterPanelBlockEntity::new, MBlocks.MATTER_PANEL).build(null);
|
||||
public static final BlockEntityType<MatterReplicatorBlockEntity> MATTER_REPLICATOR = BlockEntityType.Builder.of(MatterReplicatorBlockEntity::new, MBlocks.MATTER_REPLICATOR).build(null);
|
||||
public static final BlockEntityType<MatterBottlerBlockEntity> MATTER_BOTTLER = BlockEntityType.Builder.of(MatterBottlerBlockEntity::new, MBlocks.MATTER_BOTTLER).build(null);
|
||||
public static final BlockEntityType<DriveViewerBlockEntity> DRIVE_VIEWER = BlockEntityType.Builder.of(DriveViewerBlockEntity::new, MBlocks.DRIVE_VIEWER).build(null);
|
||||
public static final BlockEntityType<BlackHoleBlockEntity> BLACK_HOLE = BlockEntityType.Builder.of(BlackHoleBlockEntity::new, MBlocks.BLACK_HOLE).build(null);
|
||||
public static final BlockEntityType<CargoCrateBlockEntity> CARGO_CRATE = BlockEntityType.Builder.of(CargoCrateBlockEntity::new, MBlocks.CARGO_CRATE).build(null);
|
||||
public static final BlockEntityType<DriveRackBlockEntity> DRIVE_RACK = BlockEntityType.Builder.of(DriveRackBlockEntity::new, MBlocks.DRIVE_RACK).build(null);
|
||||
public static final BlockEntityType<ItemMonitorBlockEntity> ITEM_MONITOR = BlockEntityType.Builder.of(ItemMonitorBlockEntity::new, MBlocks.ITEM_MONITOR).build(null);
|
||||
public static final BlockEntityType<BlockEntityEnergyCounter> ENERGY_COUNTER = BlockEntityType.Builder.of(BlockEntityEnergyCounter::new, MBlocks.ENERGY_COUNTER).build(null);
|
||||
public static final BlockEntityType<BlockEntityChemicalGenerator> CHEMICAL_GENERATOR = BlockEntityType.Builder.of(BlockEntityChemicalGenerator::new, MBlocks.CHEMICAL_GENERATOR).build(null);
|
||||
public static final BlockEntityType<BlockEntityPlatePress> PLATE_PRESS = BlockEntityType.Builder.of(BlockEntityPlatePress::new, MBlocks.PLATE_PRESS).build(null);
|
||||
public static final BlockEntityType<BlockEntityGravitationStabilizer> GRAVITATION_STABILIZER = BlockEntityType.Builder.of(BlockEntityGravitationStabilizer::new, MBlocks.GRAVITATION_STABILIZER).build(null);
|
||||
public static final BlockEntityType<BlockEntityMatterRecycler> MATTER_RECYCLER = BlockEntityType.Builder.of(BlockEntityMatterRecycler::new, MBlocks.MATTER_RECYCLER).build(null);
|
||||
public static final BlockEntityType<ChemicalGeneratorBlockEntity> CHEMICAL_GENERATOR = BlockEntityType.Builder.of(ChemicalGeneratorBlockEntity::new, MBlocks.CHEMICAL_GENERATOR).build(null);
|
||||
public static final BlockEntityType<PlatePressBlockEntity> PLATE_PRESS = BlockEntityType.Builder.of(PlatePressBlockEntity::new, MBlocks.PLATE_PRESS).build(null);
|
||||
public static final BlockEntityType<GravitationStabilizerBlockEntity> GRAVITATION_STABILIZER = BlockEntityType.Builder.of(GravitationStabilizerBlockEntity::new, MBlocks.GRAVITATION_STABILIZER).build(null);
|
||||
public static final BlockEntityType<MatterRecyclerBlockEntity> MATTER_RECYCLER = BlockEntityType.Builder.of(MatterRecyclerBlockEntity::new, MBlocks.MATTER_RECYCLER).build(null);
|
||||
|
||||
public static final BlockEntityType<BlockEntityExplosionDebugger> DEBUG_EXPLOSION_SMALL = BlockEntityType.Builder.of(BlockEntityExplosionDebugger::new, MBlocks.DEBUG_EXPLOSION_SMALL).build(null);
|
||||
public static final BlockEntityType<BlockEntitySphereDebugger> DEBUG_SPHERE_POINTS = BlockEntityType.Builder.of(BlockEntitySphereDebugger::new, MBlocks.DEBUG_SPHERE_POINTS).build(null);
|
||||
|
@ -15,29 +15,29 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import ru.dbotthepony.mc.otm.block.*;
|
||||
|
||||
public class MBlocks {
|
||||
public static final BlockAndroidStation ANDROID_STATION = new BlockAndroidStation();
|
||||
public static final BlockBatteryBank BATTERY_BANK = new BlockBatteryBank();
|
||||
public static final BlockMatterDecomposer MATTER_DECOMPOSER = new BlockMatterDecomposer();
|
||||
public static final BlockMatterCapacitorBank MATTER_CAPACITOR_BANK = new BlockMatterCapacitorBank();
|
||||
public static final AndroidStationBlock ANDROID_STATION = new AndroidStationBlock();
|
||||
public static final BatteryBankBlock BATTERY_BANK = new BatteryBankBlock();
|
||||
public static final MatterDecomposerBlock MATTER_DECOMPOSER = new MatterDecomposerBlock();
|
||||
public static final MatterCapacitorBankBlock MATTER_CAPACITOR_BANK = new MatterCapacitorBankBlock();
|
||||
public static final BlockMatterCable MATTER_CABLE = new BlockMatterCable();
|
||||
public static final BlockPatternStorage PATTERN_STORAGE = new BlockPatternStorage();
|
||||
public static final BlockMatterScanner MATTER_SCANNER = new BlockMatterScanner();
|
||||
public static final BlockMatterPanel MATTER_PANEL = new BlockMatterPanel();
|
||||
public static final BlockMatterReplicator MATTER_REPLICATOR = new BlockMatterReplicator();
|
||||
public static final BlockMatterBottler MATTER_BOTTLER = new BlockMatterBottler();
|
||||
public static final BlockDriveViewer DRIVE_VIEWER = new BlockDriveViewer();
|
||||
public static final BlockCargoCrate CARGO_CRATE = new BlockCargoCrate();
|
||||
public static final BlockDriveRack DRIVE_RACK = new BlockDriveRack();
|
||||
public static final BlockItemMonitor ITEM_MONITOR = new BlockItemMonitor();
|
||||
public static final BlockEnergyCounter ENERGY_COUNTER = new BlockEnergyCounter();
|
||||
public static final BlockChemicalGenerator CHEMICAL_GENERATOR = new BlockChemicalGenerator();
|
||||
public static final BlockPlatePress PLATE_PRESS = new BlockPlatePress();
|
||||
public static final BlockMatterRecycler MATTER_RECYCLER = new BlockMatterRecycler();
|
||||
public static final PatternStorageBlock PATTERN_STORAGE = new PatternStorageBlock();
|
||||
public static final MatterScannerBlock MATTER_SCANNER = new MatterScannerBlock();
|
||||
public static final MatterPanelBlock MATTER_PANEL = new MatterPanelBlock();
|
||||
public static final MatterReplicatorBlock MATTER_REPLICATOR = new MatterReplicatorBlock();
|
||||
public static final MatterBottlerBlock MATTER_BOTTLER = new MatterBottlerBlock();
|
||||
public static final DriveViewerBlock DRIVE_VIEWER = new DriveViewerBlock();
|
||||
public static final CargoCrateBlock CARGO_CRATE = new CargoCrateBlock();
|
||||
public static final DriveRackBlock DRIVE_RACK = new DriveRackBlock();
|
||||
public static final ItemMonitorBlock ITEM_MONITOR = new ItemMonitorBlock();
|
||||
public static final EnergyCounterBlock ENERGY_COUNTER = new EnergyCounterBlock();
|
||||
public static final ChemicalGeneratorBlock CHEMICAL_GENERATOR = new ChemicalGeneratorBlock();
|
||||
public static final PlatePressBlock PLATE_PRESS = new PlatePressBlock();
|
||||
public static final MatterRecyclerBlock MATTER_RECYCLER = new MatterRecyclerBlock();
|
||||
|
||||
public static final BlockExplosionDebugger DEBUG_EXPLOSION_SMALL = new BlockExplosionDebugger();
|
||||
public static final BlockSphereDebugger DEBUG_SPHERE_POINTS = new BlockSphereDebugger();
|
||||
|
||||
public static final BlockBlackHole BLACK_HOLE = new BlockBlackHole();
|
||||
public static final BlackHoleBlock BLACK_HOLE = new BlackHoleBlock();
|
||||
public static final BlockGravitationStabilizer GRAVITATION_STABILIZER = new BlockGravitationStabilizer();
|
||||
public static final BlockGravitationStabilizerLens GRAVITATION_STABILIZER_LENS = new BlockGravitationStabilizerLens();
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class MItems {
|
||||
public static final BlockItem DEBUG_EXPLOSION_SMALL = new BlockItem(MBlocks.DEBUG_EXPLOSION_SMALL, DEFAULT_PROPERTIES);
|
||||
public static final BlockItem DEBUG_SPHERE_POINTS = new BlockItem(MBlocks.DEBUG_SPHERE_POINTS, DEFAULT_PROPERTIES);
|
||||
|
||||
public static final ItemMatterDust MATTER_DUST = new ItemMatterDust();
|
||||
public static final MatterDustItem MATTER_DUST = new MatterDustItem();
|
||||
|
||||
public static final Item TRITANIUM_ORE_CLUMP = new Item(DEFAULT_PROPERTIES);
|
||||
public static final Item TRITANIUM_INGOT = new Item(DEFAULT_PROPERTIES);
|
||||
@ -144,21 +144,21 @@ public class MItems {
|
||||
|
||||
public static final BlockItem BLACK_HOLE = new BlockItem(MBlocks.BLACK_HOLE, DEFAULT_PROPERTIES);
|
||||
|
||||
public static final ItemGravitationalDisruptor GRAVITATIONAL_DISRUPTOR = new ItemGravitationalDisruptor();
|
||||
public static final GravitationalDisruptorItem GRAVITATIONAL_DISRUPTOR = new GravitationalDisruptorItem();
|
||||
|
||||
public static final ItemPill PILL_ANDROID = new ItemPill(PillType.BECOME_ANDROID);
|
||||
public static final ItemPill PILL_HUMANE = new ItemPill(PillType.BECOME_HUMANE);
|
||||
public static final ItemPill PILL_OBLIVION = new ItemPill(PillType.OBLIVION);
|
||||
public static final ItemPillHeal PILL_HEAL = new ItemPillHeal();
|
||||
public static final PillItem PILL_ANDROID = new PillItem(PillType.BECOME_ANDROID);
|
||||
public static final PillItem PILL_HUMANE = new PillItem(PillType.BECOME_HUMANE);
|
||||
public static final PillItem PILL_OBLIVION = new PillItem(PillType.OBLIVION);
|
||||
public static final HealPillItem PILL_HEAL = new HealPillItem();
|
||||
|
||||
public static final ItemBattery BATTERY_CRUDE = new ItemBattery(new ImpreciseFraction(30_000), new ImpreciseFraction(150), new ImpreciseFraction(150));
|
||||
public static final ItemBattery BATTERY_BASIC = new ItemBattery(new ImpreciseFraction(60_000), new ImpreciseFraction(300), new ImpreciseFraction(300));
|
||||
public static final ItemBattery BATTERY_NORMAL = new ItemBattery(new ImpreciseFraction(250_000), new ImpreciseFraction(1000), new ImpreciseFraction(1000));
|
||||
public static final ItemBattery BATTERY_DENSE = new ItemBattery(new ImpreciseFraction(1_000_000), new ImpreciseFraction(2000), new ImpreciseFraction(2000));
|
||||
public static final ItemBattery BATTERY_CAPACITOR = new ItemBattery(new ImpreciseFraction(150_000), new ImpreciseFraction(15000), new ImpreciseFraction(15000));
|
||||
public static final ItemBattery BATTERY_CREATIVE = new ItemBattery();
|
||||
public static final BatteryItem BATTERY_CRUDE = new BatteryItem(new ImpreciseFraction(30_000), new ImpreciseFraction(150), new ImpreciseFraction(150));
|
||||
public static final BatteryItem BATTERY_BASIC = new BatteryItem(new ImpreciseFraction(60_000), new ImpreciseFraction(300), new ImpreciseFraction(300));
|
||||
public static final BatteryItem BATTERY_NORMAL = new BatteryItem(new ImpreciseFraction(250_000), new ImpreciseFraction(1000), new ImpreciseFraction(1000));
|
||||
public static final BatteryItem BATTERY_DENSE = new BatteryItem(new ImpreciseFraction(1_000_000), new ImpreciseFraction(2000), new ImpreciseFraction(2000));
|
||||
public static final BatteryItem BATTERY_CAPACITOR = new BatteryItem(new ImpreciseFraction(150_000), new ImpreciseFraction(15000), new ImpreciseFraction(15000));
|
||||
public static final BatteryItem BATTERY_CREATIVE = new BatteryItem();
|
||||
|
||||
public static final ItemBattery[] BATTERIES = {
|
||||
public static final BatteryItem[] BATTERIES = {
|
||||
BATTERY_CRUDE,
|
||||
BATTERY_BASIC,
|
||||
BATTERY_NORMAL,
|
||||
@ -183,16 +183,16 @@ public class MItems {
|
||||
MATTER_TRANSFORM_MATRIX,
|
||||
};
|
||||
|
||||
public static final ItemMatterCapacitor MATTER_CAPACITOR_BASIC = new ItemMatterCapacitor(new ImpreciseFraction("4"));
|
||||
public static final ItemMatterCapacitor MATTER_CAPACITOR_NORMAL = new ItemMatterCapacitor(new ImpreciseFraction("10"));
|
||||
public static final ItemMatterCapacitor MATTER_CAPACITOR_DENSE = new ItemMatterCapacitor(new ImpreciseFraction("40"));
|
||||
public static final ItemMatterCapacitor MATTER_CAPACITOR_CREATIVE = new ItemMatterCapacitor();
|
||||
public static final MatterCapacitorItem MATTER_CAPACITOR_BASIC = new MatterCapacitorItem(new ImpreciseFraction("4"));
|
||||
public static final MatterCapacitorItem MATTER_CAPACITOR_NORMAL = new MatterCapacitorItem(new ImpreciseFraction("10"));
|
||||
public static final MatterCapacitorItem MATTER_CAPACITOR_DENSE = new MatterCapacitorItem(new ImpreciseFraction("40"));
|
||||
public static final MatterCapacitorItem MATTER_CAPACITOR_CREATIVE = new MatterCapacitorItem();
|
||||
|
||||
public static final ItemPatternStorage PATTERN_DRIVE_NORMAL = new ItemPatternStorage(4);
|
||||
public static final ItemPatternStorage PATTERN_DRIVE_CREATIVE = new ItemPatternStorage();
|
||||
public static final PatternStorageItem PATTERN_DRIVE_NORMAL = new PatternStorageItem(4);
|
||||
public static final PatternStorageItem PATTERN_DRIVE_CREATIVE = new PatternStorageItem();
|
||||
|
||||
public static final ItemPortableCondensationDrive PORTABLE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(4000);
|
||||
public static final ItemPortableCondensationDrive PORTABLE_DENSE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(25000);
|
||||
public static final PortableCondensationDriveItem PORTABLE_CONDENSATION_DRIVE = new PortableCondensationDriveItem(4000);
|
||||
public static final PortableCondensationDriveItem PORTABLE_DENSE_CONDENSATION_DRIVE = new PortableCondensationDriveItem(25000);
|
||||
|
||||
public static final Item NUTRIENT_PASTE = new Item(new Item.Properties().stacksTo(64).food(new FoodProperties.Builder().meat().nutrition(8).saturationMod(0.9F).build()).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB));
|
||||
|
||||
|
@ -10,22 +10,22 @@ import ru.dbotthepony.mc.otm.menu.*;
|
||||
|
||||
public class MMenus {
|
||||
public static final MenuType<AndroidStationMenu> ANDROID_STATION = new MenuType<>(AndroidStationMenu::new);
|
||||
public static final MenuType<MenuBatteryBank> BATTERY_BANK = new MenuType<>(MenuBatteryBank::new);
|
||||
public static final MenuType<MenuMatterDecomposer> MATTER_DECOMPOSER = new MenuType<>(MenuMatterDecomposer::new);
|
||||
public static final MenuType<MenuMatterCapacitor> MATTER_CAPACITOR_BANK = new MenuType<>(MenuMatterCapacitor::new);
|
||||
public static final MenuType<MenuPatternStorage> PATTERN_STORAGE = new MenuType<>(MenuPatternStorage::new);
|
||||
public static final MenuType<MenuMatterScanner> MATTER_SCANNER = new MenuType<>(MenuMatterScanner::new);
|
||||
public static final MenuType<MenuMatterPanel> MATTER_PANEL = new MenuType<>(MenuMatterPanel::new);
|
||||
public static final MenuType<MenuMatterReplicator> MATTER_REPLICATOR = new MenuType<>(MenuMatterReplicator::new);
|
||||
public static final MenuType<MenuMatterBottler> MATTER_BOTTLER = new MenuType<>(MenuMatterBottler::new);
|
||||
public static final MenuType<MenuDriveViewer> DRIVE_VIEWER = new MenuType<>(MenuDriveViewer::new);
|
||||
public static final MenuType<MenuCargoCrate> CARGO_CRATE = new MenuType<>(MenuCargoCrate::new);
|
||||
public static final MenuType<MenuDriveRack> DRIVE_RACK = new MenuType<>(MenuDriveRack::new);
|
||||
public static final MenuType<MenuItemMonitor> ITEM_MONITOR = new MenuType<>(MenuItemMonitor::new);
|
||||
public static final MenuType<MenuEnergyCounter> ENERGY_COUNTER = new MenuType<>(MenuEnergyCounter::new);
|
||||
public static final MenuType<MenuChemicalGenerator> CHEMICAL_GENERATOR = new MenuType<>(MenuChemicalGenerator::new);
|
||||
public static final MenuType<BatteryBankMenu> BATTERY_BANK = new MenuType<>(BatteryBankMenu::new);
|
||||
public static final MenuType<MatterDecomposerMenu> MATTER_DECOMPOSER = new MenuType<>(MatterDecomposerMenu::new);
|
||||
public static final MenuType<MatterCapacitorMenu> MATTER_CAPACITOR_BANK = new MenuType<>(MatterCapacitorMenu::new);
|
||||
public static final MenuType<PatternStorageMenu> PATTERN_STORAGE = new MenuType<>(PatternStorageMenu::new);
|
||||
public static final MenuType<MatterScannerMenu> MATTER_SCANNER = new MenuType<>(MatterScannerMenu::new);
|
||||
public static final MenuType<MatterPanelMenu> MATTER_PANEL = new MenuType<>(MatterPanelMenu::new);
|
||||
public static final MenuType<MatterReplicatorMenu> MATTER_REPLICATOR = new MenuType<>(MatterReplicatorMenu::new);
|
||||
public static final MenuType<MatterBottlerMenu> MATTER_BOTTLER = new MenuType<>(MatterBottlerMenu::new);
|
||||
public static final MenuType<DriveViewerMenu> DRIVE_VIEWER = new MenuType<>(DriveViewerMenu::new);
|
||||
public static final MenuType<CargoCrateMenu> CARGO_CRATE = new MenuType<>(CargoCrateMenu::new);
|
||||
public static final MenuType<DriveRackMenu> DRIVE_RACK = new MenuType<>(DriveRackMenu::new);
|
||||
public static final MenuType<ItemMonitorMenu> ITEM_MONITOR = new MenuType<>(ItemMonitorMenu::new);
|
||||
public static final MenuType<EnergyCounterMenu> ENERGY_COUNTER = new MenuType<>(EnergyCounterMenu::new);
|
||||
public static final MenuType<ChemicalGeneratorMenu> CHEMICAL_GENERATOR = new MenuType<>(ChemicalGeneratorMenu::new);
|
||||
public static final MenuType<MenuPlatePress> PLATE_PRESS = new MenuType<>(MenuPlatePress::new);
|
||||
public static final MenuType<MenuMatterRecycler> MATTER_RECYCLER = new MenuType<>(MenuMatterRecycler::new);
|
||||
public static final MenuType<MatterRecyclerMenu> MATTER_RECYCLER = new MenuType<>(MatterRecyclerMenu::new);
|
||||
|
||||
static {
|
||||
ANDROID_STATION.setRegistryName(MNames.ANDROID_STATION);
|
||||
@ -74,23 +74,23 @@ public class MMenus {
|
||||
@SubscribeEvent
|
||||
@SuppressWarnings("unused")
|
||||
public static void registerScreens(final FMLClientSetupEvent event) {
|
||||
MenuScreens.register(ANDROID_STATION, ScreenAndroidStation::new);
|
||||
MenuScreens.register(BATTERY_BANK, ScreenBatteryBank::new);
|
||||
MenuScreens.register(MATTER_DECOMPOSER, ScreenMatterDecomposer::new);
|
||||
MenuScreens.register(MATTER_CAPACITOR_BANK, ScreenMatterCapacitorBank::new);
|
||||
MenuScreens.register(PATTERN_STORAGE, ScreenPatternStorage::new);
|
||||
MenuScreens.register(MATTER_SCANNER, ScreenMatterScanner::new);
|
||||
MenuScreens.register(ANDROID_STATION, AndroidStationScreen::new);
|
||||
MenuScreens.register(BATTERY_BANK, BatteryBankScreen::new);
|
||||
MenuScreens.register(MATTER_DECOMPOSER, MatterDecomposerScreen::new);
|
||||
MenuScreens.register(MATTER_CAPACITOR_BANK, MatterCapacitorBankScreen::new);
|
||||
MenuScreens.register(PATTERN_STORAGE, PatternStorageScreen::new);
|
||||
MenuScreens.register(MATTER_SCANNER, MatterScannerScreen::new);
|
||||
MenuScreens.register(MATTER_PANEL, MatterPanelScreen::new);
|
||||
MenuScreens.register(MATTER_REPLICATOR, ScreenMatterReplicator::new);
|
||||
MenuScreens.register(MATTER_BOTTLER, ScreenMatterBottler::new);
|
||||
MenuScreens.register(DRIVE_VIEWER, ScreenDriveViewer::new);
|
||||
MenuScreens.register(CARGO_CRATE, ScreenCargoCrate::new);
|
||||
MenuScreens.register(DRIVE_RACK, ScreenDriveRack::new);
|
||||
MenuScreens.register(ITEM_MONITOR, ScreenItemMonitor::new);
|
||||
MenuScreens.register(ENERGY_COUNTER, ScreenEnergyCounter::new);
|
||||
MenuScreens.register(CHEMICAL_GENERATOR, ScreenChemicalGenerator::new);
|
||||
MenuScreens.register(PLATE_PRESS, ScreenPlatePress::new);
|
||||
MenuScreens.register(MATTER_RECYCLER, ScreenMatterRecycler::new);
|
||||
MenuScreens.register(MATTER_REPLICATOR, MatterReplicatorScreen::new);
|
||||
MenuScreens.register(MATTER_BOTTLER, MatterBottlerScreen::new);
|
||||
MenuScreens.register(DRIVE_VIEWER, DriveViewerScreen::new);
|
||||
MenuScreens.register(CARGO_CRATE, CargoCrateScreen::new);
|
||||
MenuScreens.register(DRIVE_RACK, DriveRackScreen::new);
|
||||
MenuScreens.register(ITEM_MONITOR, ItemMonitorScreen::new);
|
||||
MenuScreens.register(ENERGY_COUNTER, EnergyCounterScreen::new);
|
||||
MenuScreens.register(CHEMICAL_GENERATOR, ChemicalGeneratorScreen::new);
|
||||
MenuScreens.register(PLATE_PRESS, PlatePressScreen::new);
|
||||
MenuScreens.register(MATTER_RECYCLER, MatterRecyclerScreen::new);
|
||||
|
||||
// OverdriveThatMatters.LOGGER.info("Registered screens");
|
||||
}
|
||||
|
@ -14,13 +14,13 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.phys.BlockHitResult
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityAndroidStation
|
||||
import ru.dbotthepony.mc.otm.block.entity.AndroidStationBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.orNull
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockAndroidStation : BlockMattery(), EntityBlock {
|
||||
class AndroidStationBlock : BlockMattery(), EntityBlock {
|
||||
override fun use(
|
||||
blockState: BlockState,
|
||||
level: Level,
|
||||
@ -47,7 +47,7 @@ class BlockAndroidStation : BlockMattery(), EntityBlock {
|
||||
}
|
||||
|
||||
override fun newBlockEntity(pos: BlockPos, state: BlockState): BlockEntity {
|
||||
return BlockEntityAndroidStation(pos, state)
|
||||
return AndroidStationBlockEntity(pos, state)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -58,7 +58,7 @@ class BlockAndroidStation : BlockMattery(), EntityBlock {
|
||||
if (level.isClientSide || type !== MBlockEntities.ANDROID_STATION)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, t -> if (t is BlockEntityAndroidStation) t.tick() }
|
||||
return BlockEntityTicker { _, _, _, t -> if (t is AndroidStationBlockEntity) t.tick() }
|
||||
}
|
||||
|
||||
companion object {
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.entity.BlockEntityTicker
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.core.Direction
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityBatteryBank
|
||||
import ru.dbotthepony.mc.otm.block.entity.BatteryBankBlockEntity
|
||||
import net.minecraft.world.level.BlockGetter
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.block.Block
|
||||
@ -23,7 +23,7 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
class BlockBatteryBank : BlockMatteryRotatable(), EntityBlock {
|
||||
class BatteryBankBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun getStateForPlacement(context: BlockPlaceContext): BlockState {
|
||||
var state = super.getStateForPlacement(context)!!
|
||||
|
||||
@ -41,7 +41,7 @@ class BlockBatteryBank : BlockMatteryRotatable(), EntityBlock {
|
||||
if (level.isClientSide || type !== MBlockEntities.BATTERY_BANK)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityBatteryBank) tile.tick() }
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BatteryBankBlockEntity) tile.tick() }
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
||||
@ -50,7 +50,7 @@ class BlockBatteryBank : BlockMatteryRotatable(), EntityBlock {
|
||||
}
|
||||
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? {
|
||||
return BlockEntityBatteryBank(blockPos, blockState)
|
||||
return BatteryBankBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun getShape(
|
@ -12,11 +12,11 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.material.Material
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockBlackHole :
|
||||
class BlackHoleBlock :
|
||||
Block(Properties.of(Material.STONE).strength(-1f, 7200000.0f)), EntityBlock {
|
||||
override fun getShape(
|
||||
p_60555_: BlockState,
|
||||
@ -28,7 +28,7 @@ class BlockBlackHole :
|
||||
}
|
||||
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityBlackHole(blockPos, blockState)
|
||||
return BlackHoleBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -39,10 +39,10 @@ class BlockBlackHole :
|
||||
if (p_153214_ !== MBlockEntities.BLACK_HOLE) return null
|
||||
|
||||
if (p_153212_.isClientSide) {
|
||||
return BlockEntityTicker { _, _, _, t -> if (t is BlockEntityBlackHole) t.clientTick() }
|
||||
return BlockEntityTicker { _, _, _, t -> if (t is BlackHoleBlockEntity) t.clientTick() }
|
||||
}
|
||||
|
||||
return BlockEntityTicker { _, _, _, t -> if (t is BlockEntityBlackHole) t.tick() }
|
||||
return BlockEntityTicker { _, _, _, t -> if (t is BlackHoleBlockEntity) t.tick() }
|
||||
}
|
||||
|
||||
companion object {
|
@ -11,11 +11,11 @@ import net.minecraft.world.level.block.entity.BlockEntity
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityCargoCrate
|
||||
import ru.dbotthepony.mc.otm.block.entity.CargoCrateBlockEntity
|
||||
|
||||
class BlockCargoCrate : BlockMatteryRotatable(), EntityBlock {
|
||||
class CargoCrateBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityCargoCrate(blockPos, blockState)
|
||||
return CargoCrateBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
||||
@ -37,7 +37,7 @@ class BlockCargoCrate : BlockMatteryRotatable(), EntityBlock {
|
||||
if (!old_block_state.`is`(new_block_state.block)) {
|
||||
val blockentity = level.getBlockEntity(block_pos)
|
||||
|
||||
if (blockentity is BlockEntityCargoCrate) {
|
||||
if (blockentity is CargoCrateBlockEntity) {
|
||||
Containers.dropContents(level, block_pos, blockentity.container);
|
||||
level.updateNeighbourForOutputSignal(block_pos, this);
|
||||
}
|
||||
@ -51,7 +51,7 @@ class BlockCargoCrate : BlockMatteryRotatable(), EntityBlock {
|
||||
}
|
||||
|
||||
override fun getAnalogOutputSignal(p_60487_: BlockState, level: Level, p_60489_: BlockPos): Int {
|
||||
val tile = level.getBlockEntity(p_60489_) as? BlockEntityCargoCrate ?: return 0
|
||||
val tile = level.getBlockEntity(p_60489_) as? CargoCrateBlockEntity ?: return 0
|
||||
return AbstractContainerMenu.getRedstoneSignalFromContainer(tile.container)
|
||||
}
|
||||
|
@ -14,17 +14,15 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityChemicalGenerator
|
||||
import ru.dbotthepony.mc.otm.block.entity.ChemicalGeneratorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
import ru.dbotthepony.mc.otm.tickOnce
|
||||
import ru.dbotthepony.mc.otm.tickOnceServer
|
||||
|
||||
class BlockChemicalGenerator : BlockMatteryRotatable(), EntityBlock {
|
||||
class ChemicalGeneratorBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity {
|
||||
return BlockEntityChemicalGenerator(p_153215_, p_153216_)
|
||||
return ChemicalGeneratorBlockEntity(p_153215_, p_153216_)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -35,7 +33,7 @@ class BlockChemicalGenerator : BlockMatteryRotatable(), EntityBlock {
|
||||
if (level.isClientSide || type != MBlockEntities.CHEMICAL_GENERATOR)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker<T> { _, _, _, tile -> if (tile is BlockEntityChemicalGenerator) tile.tick() }
|
||||
return BlockEntityTicker<T> { _, _, _, tile -> if (tile is ChemicalGeneratorBlockEntity) tile.tick() }
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
||||
@ -56,7 +54,7 @@ class BlockChemicalGenerator : BlockMatteryRotatable(), EntityBlock {
|
||||
if (!level.isClientSide && level is ServerLevel) {
|
||||
val tile = level.getBlockEntity(pos)
|
||||
|
||||
if (tile is BlockEntityChemicalGenerator) {
|
||||
if (tile is ChemicalGeneratorBlockEntity) {
|
||||
tickOnceServer(level) {
|
||||
tile.checkSurroundings()
|
||||
}
|
@ -11,13 +11,13 @@ import net.minecraft.world.level.block.entity.BlockEntityType
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack
|
||||
import ru.dbotthepony.mc.otm.block.entity.DriveRackBlockEntity
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockDriveRack : BlockMatteryRotatable(), EntityBlock {
|
||||
class DriveRackBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityDriveRack(blockPos, blockState)
|
||||
return DriveRackBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -28,7 +28,7 @@ class BlockDriveRack : BlockMatteryRotatable(), EntityBlock {
|
||||
if (p_153214_ != MBlockEntities.DRIVE_RACK || p_153212_.isClientSide)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityDriveRack) tile.tick() }
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is DriveRackBlockEntity) tile.tick() }
|
||||
}
|
||||
|
||||
override fun getShape(
|
@ -11,13 +11,13 @@ import net.minecraft.world.level.block.entity.BlockEntityType
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveViewer
|
||||
import ru.dbotthepony.mc.otm.block.entity.DriveViewerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
|
||||
class BlockDriveViewer : BlockMatteryRotatable(), EntityBlock {
|
||||
class DriveViewerBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityDriveViewer(blockPos, blockState)
|
||||
return DriveViewerBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity> getTicker(
|
||||
@ -28,7 +28,7 @@ class BlockDriveViewer : BlockMatteryRotatable(), EntityBlock {
|
||||
if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.DRIVE_VIEWER)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityDriveViewer) tile.tick() }
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is DriveViewerBlockEntity) tile.tick() }
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
@ -19,7 +19,7 @@ import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockEnergyCounter : BlockMattery(), EntityBlock {
|
||||
class EnergyCounterBlock : BlockMattery(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityEnergyCounter(blockPos, blockState)
|
||||
}
|
@ -22,9 +22,8 @@ import net.minecraft.world.level.material.MaterialColor
|
||||
import net.minecraft.world.level.material.PushReaction
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole
|
||||
import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.core.plus
|
||||
import ru.dbotthepony.mc.otm.core.times
|
||||
@ -38,7 +37,7 @@ private val props = BlockBehaviour.Properties.of(Material.STONE, MaterialColor.C
|
||||
|
||||
class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock {
|
||||
override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity {
|
||||
return BlockEntityGravitationStabilizer(p_153215_, p_153216_)
|
||||
return GravitationStabilizerBlockEntity(p_153215_, p_153216_)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -49,7 +48,7 @@ class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock {
|
||||
if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.GRAVITATION_STABILIZER)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { level, _, _, tile -> if (tile is BlockEntityGravitationStabilizer) tile.tick(level) }
|
||||
return BlockEntityTicker { level, _, _, tile -> if (tile is GravitationStabilizerBlockEntity) tile.tick(level) }
|
||||
}
|
||||
|
||||
override val hasFreeRotation: Boolean get() = true
|
||||
@ -67,13 +66,13 @@ class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock {
|
||||
for (face in FACING_FULL.possibleValues) {
|
||||
val dir = face.normal
|
||||
|
||||
for (i in 1 ..BlockEntityGravitationStabilizer.RANGE) {
|
||||
for (i in 1 ..GravitationStabilizerBlockEntity.RANGE) {
|
||||
val pos = blockPos + dir * i
|
||||
val chunk = level.chunkSource.getChunkNow(SectionPos.blockToSectionCoord(pos.x), SectionPos.blockToSectionCoord(pos.z)) ?: continue
|
||||
val getState = chunk.getBlockState(pos)
|
||||
|
||||
if (!getState.isAir) {
|
||||
if (chunk.getBlockEntity(pos) is BlockEntityBlackHole) {
|
||||
if (chunk.getBlockEntity(pos) is BlackHoleBlockEntity) {
|
||||
state = state.setValue(FACING_FULL, face)
|
||||
break
|
||||
}
|
@ -11,13 +11,13 @@ import net.minecraft.world.level.block.entity.BlockEntityType
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityItemMonitor
|
||||
import ru.dbotthepony.mc.otm.block.entity.ItemMonitorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockItemMonitor : BlockMatteryRotatable(), EntityBlock {
|
||||
class ItemMonitorBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityItemMonitor(blockPos, blockState)
|
||||
return ItemMonitorBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -28,7 +28,7 @@ class BlockItemMonitor : BlockMatteryRotatable(), EntityBlock {
|
||||
if (p_153214_ != MBlockEntities.ITEM_MONITOR || p_153212_.isClientSide)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityItemMonitor) tile.tick() }
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is ItemMonitorBlockEntity) tile.tick() }
|
||||
}
|
||||
|
||||
override fun getShape(
|
@ -11,7 +11,7 @@ import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.entity.BlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterBottler
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterBottlerBlockEntity
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType
|
||||
import net.minecraft.world.level.block.entity.BlockEntityTicker
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
@ -24,9 +24,9 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
class BlockMatterBottler : BlockMatteryRotatable(), EntityBlock {
|
||||
class MatterBottlerBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? {
|
||||
return BlockEntityMatterBottler(blockPos, blockState)
|
||||
return MatterBottlerBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -37,7 +37,7 @@ class BlockMatterBottler : BlockMatteryRotatable(), EntityBlock {
|
||||
if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_BOTTLER)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker {_, _, _, tile -> if (tile is BlockEntityMatterBottler) tile.tick()}
|
||||
return BlockEntityTicker {_, _, _, tile -> if (tile is MatterBottlerBlockEntity) tile.tick()}
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
@ -11,25 +11,25 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterCapacitorBank
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterCapacitorBankBlockEntity
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockMatterCapacitorBank : BlockMatteryRotatable(), EntityBlock {
|
||||
class MatterCapacitorBankBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityMatterCapacitorBank(blockPos, blockState)
|
||||
return MatterCapacitorBankBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun getStateForPlacement(context: BlockPlaceContext): BlockState? {
|
||||
var state = super.getStateForPlacement(context) ?: return null
|
||||
|
||||
for (prop in BlockBatteryBank.BATTERY_SLOTS_PROPS)
|
||||
for (prop in BatteryBankBlock.BATTERY_SLOTS_PROPS)
|
||||
state = state.setValue(prop, false)
|
||||
|
||||
return state
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
||||
builder.add(*BlockBatteryBank.BATTERY_SLOTS_PROPS)
|
||||
builder.add(*BatteryBankBlock.BATTERY_SLOTS_PROPS)
|
||||
super.createBlockStateDefinition(builder)
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import net.minecraft.core.BlockPos
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.entity.BlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterDecomposer
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterDecomposerBlockEntity
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType
|
||||
import net.minecraft.world.level.block.entity.BlockEntityTicker
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
@ -22,9 +22,9 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
class BlockMatterDecomposer : BlockMatteryRotatable(), EntityBlock {
|
||||
class MatterDecomposerBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityMatterDecomposer(blockPos, blockState)
|
||||
return MatterDecomposerBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -35,7 +35,7 @@ class BlockMatterDecomposer : BlockMatteryRotatable(), EntityBlock {
|
||||
if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_DECOMPOSER)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker {_, _, _, t -> if (t is BlockEntityMatterDecomposer) t.tick()}
|
||||
return BlockEntityTicker {_, _, _, t -> if (t is MatterDecomposerBlockEntity) t.tick()}
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
@ -6,7 +6,7 @@ import net.minecraft.core.BlockPos
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.entity.BlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterPanel
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterPanelBlockEntity
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import net.minecraft.world.phys.shapes.Shapes
|
||||
import net.minecraft.world.level.BlockGetter
|
||||
@ -16,9 +16,9 @@ import net.minecraft.world.item.context.BlockPlaceContext
|
||||
import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty
|
||||
|
||||
class BlockMatterPanel : BlockMattery(), EntityBlock {
|
||||
class MatterPanelBlock : BlockMattery(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityMatterPanel(blockPos, blockState)
|
||||
return MatterPanelBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
private val shapes: ImmutableMap<BlockState, VoxelShape>
|
@ -9,13 +9,13 @@ import net.minecraft.world.level.block.entity.BlockEntityTicker
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterRecycler
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterRecyclerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
|
||||
class BlockMatterRecycler : BlockMatteryRotatable(), EntityBlock {
|
||||
class MatterRecyclerBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity {
|
||||
return BlockEntityMatterRecycler(p_153215_, p_153216_)
|
||||
return MatterRecyclerBlockEntity(p_153215_, p_153216_)
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
||||
@ -31,6 +31,6 @@ class BlockMatterRecycler : BlockMatteryRotatable(), EntityBlock {
|
||||
if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_RECYCLER)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterRecycler) tile.tick() }
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is MatterRecyclerBlockEntity) tile.tick() }
|
||||
}
|
||||
}
|
@ -13,14 +13,14 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterReplicator
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterReplicatorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockMatterReplicator : BlockMatteryRotatable(), EntityBlock {
|
||||
class MatterReplicatorBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityMatterReplicator(blockPos, blockState)
|
||||
return MatterReplicatorBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -31,7 +31,7 @@ class BlockMatterReplicator : BlockMatteryRotatable(), EntityBlock {
|
||||
if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_REPLICATOR)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterReplicator) tile.basicTicker() }
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is MatterReplicatorBlockEntity) tile.basicTicker() }
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
@ -13,14 +13,14 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterScanner
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterScannerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockMatterScanner : BlockMatteryRotatable(), EntityBlock {
|
||||
class MatterScannerBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
|
||||
return BlockEntityMatterScanner(blockPos, blockState)
|
||||
return MatterScannerBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -31,7 +31,7 @@ class BlockMatterScanner : BlockMatteryRotatable(), EntityBlock {
|
||||
if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_SCANNER)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterScanner) tile.basicTicker() }
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is MatterScannerBlockEntity) tile.basicTicker() }
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
@ -18,7 +18,7 @@ import net.minecraft.world.level.block.state.properties.EnumProperty
|
||||
import net.minecraft.world.level.material.Material
|
||||
import net.minecraft.world.level.material.MaterialColor
|
||||
import net.minecraft.world.phys.BlockHitResult
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMattery
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
|
||||
|
||||
abstract class BlockMattery @JvmOverloads constructor(
|
||||
properties: Properties = DEFAULT_PROPERTIES
|
||||
@ -33,7 +33,7 @@ abstract class BlockMattery @JvmOverloads constructor(
|
||||
if (this is EntityBlock && itemStack.hasCustomHoverName() && !level.isClientSide) {
|
||||
val tile = level.getBlockEntity(blockPos)
|
||||
|
||||
if (tile is BlockEntityMattery)
|
||||
if (tile is MatteryBlockEntity)
|
||||
tile.customDisplayName = itemStack.displayName
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ abstract class BlockMattery @JvmOverloads constructor(
|
||||
if (this is EntityBlock && !level.isClientSide) {
|
||||
val tile = level.getBlockEntity(pos)
|
||||
|
||||
if (tile is BlockEntityMattery)
|
||||
if (tile is MatteryBlockEntity)
|
||||
tile.redstoneSignal = level.getBestNeighborSignal(pos)
|
||||
}
|
||||
}
|
@ -12,12 +12,12 @@ import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityPatternStorage
|
||||
import ru.dbotthepony.mc.otm.block.entity.PatternStorageBlockEntity
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockPatternStorage : BlockMatteryRotatable(), EntityBlock {
|
||||
class PatternStorageBlock : BlockMatteryRotatable(), EntityBlock {
|
||||
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? {
|
||||
return BlockEntityPatternStorage(blockPos, blockState)
|
||||
return PatternStorageBlockEntity(blockPos, blockState)
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
@ -13,14 +13,14 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress
|
||||
import ru.dbotthepony.mc.otm.block.entity.PlatePressBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
class BlockPlatePress(properties: Properties = DEFAULT_PROPERTIES) : BlockMatteryRotatable(properties), EntityBlock {
|
||||
class PlatePressBlock(properties: Properties = DEFAULT_PROPERTIES) : BlockMatteryRotatable(properties), EntityBlock {
|
||||
override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity {
|
||||
return BlockEntityPlatePress(p_153215_, p_153216_)
|
||||
return PlatePressBlockEntity(p_153215_, p_153216_)
|
||||
}
|
||||
|
||||
override fun <T : BlockEntity?> getTicker(
|
||||
@ -31,7 +31,7 @@ class BlockPlatePress(properties: Properties = DEFAULT_PROPERTIES) : BlockMatter
|
||||
if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.PLATE_PRESS)
|
||||
return null
|
||||
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityPlatePress) tile.basicTicker() }
|
||||
return BlockEntityTicker { _, _, _, tile -> if (tile is PlatePressBlockEntity) tile.basicTicker() }
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
@ -16,8 +16,8 @@ import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.menu.AndroidStationMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
|
||||
class BlockEntityAndroidStation(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMatteryPowered(MBlockEntities.ANDROID_STATION, p_155229_, p_155230_), MenuProvider {
|
||||
class AndroidStationBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryPoweredBlockEntity(MBlockEntities.ANDROID_STATION, p_155229_, p_155230_), MenuProvider {
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return AndroidStationMenu(containerID, inventory, this)
|
@ -19,7 +19,7 @@ import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.energy.CapabilityEnergy
|
||||
import net.minecraftforge.energy.IEnergyStorage
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import ru.dbotthepony.mc.otm.block.BlockBatteryBank
|
||||
import ru.dbotthepony.mc.otm.block.BatteryBankBlock
|
||||
import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
@ -27,7 +27,7 @@ import ru.dbotthepony.mc.otm.capability.extractEnergy
|
||||
import ru.dbotthepony.mc.otm.capability.receiveEnergy
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.menu.MenuBatteryBank
|
||||
import ru.dbotthepony.mc.otm.menu.BatteryBankMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
import ru.dbotthepony.mc.otm.unaryMinus
|
||||
@ -35,7 +35,7 @@ import javax.annotation.ParametersAreNonnullByDefault
|
||||
|
||||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
class BlockEntityBatteryBank(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(MBlockEntities.BATTERY_BANK, p_155229_, p_155230_) {
|
||||
class BatteryBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity(MBlockEntities.BATTERY_BANK, p_155229_, p_155230_) {
|
||||
// 6 на 2
|
||||
val container: MatteryContainer = object : MatteryContainer(this::setChanged, CAPACITY) {
|
||||
override fun setChanged(slot: Int, new: ItemStack, old: ItemStack) {
|
||||
@ -45,8 +45,8 @@ class BlockEntityBatteryBank(p_155229_: BlockPos, p_155230_: BlockState) : Block
|
||||
if (level != null) {
|
||||
var state = blockState
|
||||
|
||||
for (i in BlockBatteryBank.BATTERY_SLOTS_PROPS.indices) {
|
||||
state = state.setValue(BlockBatteryBank.BATTERY_SLOTS_PROPS[i], getItem(i).getCapability(CapabilityEnergy.ENERGY).isPresent)
|
||||
for (i in BatteryBankBlock.BATTERY_SLOTS_PROPS.indices) {
|
||||
state = state.setValue(BatteryBankBlock.BATTERY_SLOTS_PROPS[i], getItem(i).getCapability(CapabilityEnergy.ENERGY).isPresent)
|
||||
}
|
||||
|
||||
if (state !== blockState) {
|
||||
@ -252,7 +252,7 @@ class BlockEntityBatteryBank(p_155229_: BlockPos, p_155230_: BlockState) : Block
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuBatteryBank(containerID, inventory, this)
|
||||
return BatteryBankMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun invalidateCaps() {
|
@ -13,30 +13,30 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import ru.dbotthepony.mc.otm.block.BlockCargoCrate
|
||||
import ru.dbotthepony.mc.otm.block.CargoCrateBlock
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.menu.MenuCargoCrate
|
||||
import ru.dbotthepony.mc.otm.menu.CargoCrateMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
|
||||
class BlockEntityCargoCrate(
|
||||
class CargoCrateBlockEntity(
|
||||
p_155229_: BlockPos,
|
||||
p_155230_: BlockState
|
||||
) : BlockEntityMattery(MBlockEntities.CARGO_CRATE, p_155229_, p_155230_) {
|
||||
) : MatteryBlockEntity(MBlockEntities.CARGO_CRATE, p_155229_, p_155230_) {
|
||||
val container = MatteryContainer(this::setChanged, CAPACITY)
|
||||
private var interactingPlayers = 0
|
||||
val handler = container.handler()
|
||||
|
||||
fun onPlayerOpen() {
|
||||
if (interactingPlayers++ == 0) {
|
||||
level?.setBlock(blockPos, blockState.setValue(BlockCargoCrate.IS_OPEN, true), Block.UPDATE_CLIENTS)
|
||||
level?.setBlock(blockPos, blockState.setValue(CargoCrateBlock.IS_OPEN, true), Block.UPDATE_CLIENTS)
|
||||
}
|
||||
}
|
||||
|
||||
fun onPlayerClose() {
|
||||
if (--interactingPlayers == 0) {
|
||||
level?.setBlock(blockPos, blockState.setValue(BlockCargoCrate.IS_OPEN, false), Block.UPDATE_CLIENTS)
|
||||
level?.setBlock(blockPos, blockState.setValue(CargoCrateBlock.IS_OPEN, false), Block.UPDATE_CLIENTS)
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ class BlockEntityCargoCrate(
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuCargoCrate(containerID, inventory, this)
|
||||
return CargoCrateMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
companion object {
|
@ -6,7 +6,6 @@ import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.nbt.IntTag
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.network.chat.TranslatableComponent
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu
|
||||
@ -27,17 +26,17 @@ import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.core.plus
|
||||
import ru.dbotthepony.mc.otm.menu.MenuChemicalGenerator
|
||||
import ru.dbotthepony.mc.otm.menu.ChemicalGeneratorMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
class BlockEntityChemicalGenerator(pos: BlockPos, state: BlockState) : BlockEntityMattery(MBlockEntities.CHEMICAL_GENERATOR, pos, state) {
|
||||
class ChemicalGeneratorBlockEntity(pos: BlockPos, state: BlockState) : MatteryBlockEntity(MBlockEntities.CHEMICAL_GENERATOR, pos, state) {
|
||||
override fun getDefaultDisplayName(): Component {
|
||||
return NAME
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuChemicalGenerator(containerID, inventory, this)
|
||||
return ChemicalGeneratorMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
private var valid = true
|
@ -20,14 +20,14 @@ import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.menu.MenuDriveRack
|
||||
import ru.dbotthepony.mc.otm.menu.DriveRackMenu
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent
|
||||
|
||||
class BlockEntityDriveRack(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMatteryPowered(MBlockEntities.DRIVE_RACK, p_155229_, p_155230_) {
|
||||
class DriveRackBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryPoweredBlockEntity(MBlockEntities.DRIVE_RACK, p_155229_, p_155230_) {
|
||||
override val energy = WorkerEnergyStorage(this, STORAGE)
|
||||
|
||||
@JvmField
|
||||
@ -76,7 +76,7 @@ class BlockEntityDriveRack(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? {
|
||||
return MenuDriveRack(containerID, inventory, this)
|
||||
return DriveRackMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun <T> getCapability(cap: Capability<T>, side: Direction?): LazyOptional<T> {
|
@ -12,19 +12,19 @@ import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.block.BlockDriveViewer
|
||||
import ru.dbotthepony.mc.otm.block.DriveViewerBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.menu.MenuDriveViewer
|
||||
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
import javax.annotation.ParametersAreNonnullByDefault
|
||||
|
||||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryPowered(MBlockEntities.DRIVE_VIEWER, p_155229_, p_155230_) {
|
||||
class DriveViewerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryPoweredBlockEntity(MBlockEntities.DRIVE_VIEWER, p_155229_, p_155230_) {
|
||||
override fun setChanged() {
|
||||
super.setChanged()
|
||||
|
||||
@ -55,9 +55,9 @@ class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : Block
|
||||
var state = blockState
|
||||
|
||||
if (new.getCapability(MatteryCapability.DRIVE).isPresent) {
|
||||
state = state.setValue(BlockDriveViewer.DRIVE_PRESENT, true)
|
||||
state = state.setValue(DriveViewerBlock.DRIVE_PRESENT, true)
|
||||
} else {
|
||||
state = state.setValue(BlockDriveViewer.DRIVE_PRESENT, false)
|
||||
state = state.setValue(DriveViewerBlock.DRIVE_PRESENT, false)
|
||||
}
|
||||
|
||||
if (state !== blockState) {
|
||||
@ -73,7 +73,7 @@ class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : Block
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? {
|
||||
return MenuDriveViewer(containerID, inventory, this)
|
||||
return DriveViewerMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun saveAdditional(nbt: CompoundTag) {
|
@ -23,13 +23,13 @@ import net.minecraftforge.energy.IEnergyStorage
|
||||
import net.minecraftforge.network.NetworkEvent
|
||||
import net.minecraftforge.network.PacketDistributor
|
||||
import ru.dbotthepony.mc.otm.*
|
||||
import ru.dbotthepony.mc.otm.block.BlockEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.block.EnergyCounterBlock
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergy
|
||||
import ru.dbotthepony.mc.otm.capability.receiveEnergy
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.menu.MenuEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.menu.EnergyCounterMenu
|
||||
import ru.dbotthepony.mc.otm.network.MatteryNetworking
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import java.lang.ref.WeakReference
|
||||
@ -72,7 +72,7 @@ data class EnergyCounterPacket(val pos: BlockPos, val thisTick: ImpreciseFractio
|
||||
}
|
||||
}
|
||||
|
||||
class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(MBlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) {
|
||||
class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity(MBlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) {
|
||||
var passed = ImpreciseFraction.ZERO
|
||||
|
||||
private val history = Array(10 * 20) { ImpreciseFraction.ZERO }
|
||||
@ -164,7 +164,7 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuEnergyCounter(containerID, inventory, this)
|
||||
return EnergyCounterMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
private val energyInput = EnergyCounterCap(true)
|
||||
@ -367,7 +367,7 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo
|
||||
val old = blockState
|
||||
super.setBlockState(new)
|
||||
|
||||
if (new !== old && new.getValue(BlockEnergyCounter.INPUT_DIRECTION) != old.getValue(BlockEnergyCounter.INPUT_DIRECTION)) {
|
||||
if (new !== old && new.getValue(EnergyCounterBlock.INPUT_DIRECTION) != old.getValue(EnergyCounterBlock.INPUT_DIRECTION)) {
|
||||
resolverInput.invalidate()
|
||||
resolverOutput.invalidate()
|
||||
resolverInput = LazyOptional.of { energyInput }
|
||||
@ -409,13 +409,13 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo
|
||||
inputCapability = getAndBind(
|
||||
level,
|
||||
inputCapability,
|
||||
blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION)
|
||||
blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION)
|
||||
)
|
||||
|
||||
outputCapability = getAndBind(
|
||||
level,
|
||||
outputCapability,
|
||||
-blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION)
|
||||
-blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION)
|
||||
)
|
||||
}
|
||||
|
||||
@ -424,11 +424,11 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo
|
||||
return super.getCapability(cap, side)
|
||||
|
||||
if (valid) {
|
||||
if (side == blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION)) {
|
||||
if (side == blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION)) {
|
||||
if (cap === MatteryCapability.ENERGY || cap === CapabilityEnergy.ENERGY) {
|
||||
return resolverInput.cast()
|
||||
}
|
||||
} else if (side == blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION).opposite) {
|
||||
} else if (side == blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION).opposite) {
|
||||
if (cap === MatteryCapability.ENERGY || cap === CapabilityEnergy.ENERGY) {
|
||||
return resolverOutput.cast()
|
||||
}
|
@ -12,21 +12,21 @@ import net.minecraft.world.phys.AABB
|
||||
import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizer
|
||||
import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizerLens
|
||||
import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.core.plus
|
||||
import ru.dbotthepony.mc.otm.core.times
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
|
||||
class BlockEntityGravitationStabilizer(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(
|
||||
class GravitationStabilizerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity(
|
||||
MBlockEntities.GRAVITATION_STABILIZER, p_155229_, p_155230_) {
|
||||
override fun getDefaultDisplayName() = NAME
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player) = null
|
||||
|
||||
private var blackHole: BlockEntityBlackHole? = null
|
||||
private var blackHole: BlackHoleBlockEntity? = null
|
||||
|
||||
fun tick(level: Level) {
|
||||
var findBlackHole: BlockEntityBlackHole? = null
|
||||
var findBlackHole: BlackHoleBlockEntity? = null
|
||||
val dir = blockState.getValue(BlockMatteryRotatable.FACING_FULL).normal
|
||||
|
||||
for (i in 2 .. RANGE) {
|
||||
@ -38,7 +38,7 @@ class BlockEntityGravitationStabilizer(p_155229_: BlockPos, p_155230_: BlockStat
|
||||
val tile = chunk.getBlockEntity(pos)
|
||||
|
||||
if (tile != null) {
|
||||
if (tile is BlockEntityBlackHole) {
|
||||
if (tile is BlackHoleBlockEntity) {
|
||||
findBlackHole = tile
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode
|
||||
import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.menu.MenuItemMonitor
|
||||
import ru.dbotthepony.mc.otm.menu.ItemMonitorMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
|
||||
class BlockEntityItemMonitor(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMatteryPowered(MBlockEntities.ITEM_MONITOR, p_155229_, p_155230_) {
|
||||
class ItemMonitorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryPoweredBlockEntity(MBlockEntities.ITEM_MONITOR, p_155229_, p_155230_) {
|
||||
|
||||
@JvmField
|
||||
val cell = BasicStorageGraphNode()
|
||||
@ -35,7 +35,7 @@ class BlockEntityItemMonitor(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuItemMonitor(containerID, inventory, this)
|
||||
return ItemMonitorMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun setLevel(p_155231_: Level) {
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import ru.dbotthepony.mc.otm.block.BlockMatterBottler
|
||||
import ru.dbotthepony.mc.otm.block.MatterBottlerBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
@ -29,13 +29,13 @@ import ru.dbotthepony.mc.otm.graph.Graph6Node
|
||||
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode
|
||||
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterBottler
|
||||
import ru.dbotthepony.mc.otm.menu.MatterBottlerMenu
|
||||
import ru.dbotthepony.mc.otm.orNull
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
|
||||
class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMatteryPowered(MBlockEntities.MATTER_BOTTLER, p_155229_, p_155230_), IMatterGraphNode {
|
||||
class MatterBottlerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryPoweredBlockEntity(MBlockEntities.MATTER_BOTTLER, p_155229_, p_155230_), IMatterGraphNode {
|
||||
|
||||
private val node = Graph6Node<IMatterGraphNode>(this)
|
||||
private val resolverNode = LazyOptional.of { this }
|
||||
@ -67,8 +67,8 @@ class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
for (i in initial .. initial + 2) {
|
||||
val desired = !container.getItem(i).isEmpty && container.getItem(i).getCapability(MatteryCapability.MATTER).isPresent
|
||||
|
||||
if (state.getValue(BlockMatterBottler.SLOT_PROPERTIES[i - initial]) != desired) {
|
||||
state = state.setValue(BlockMatterBottler.SLOT_PROPERTIES[i - initial], desired)
|
||||
if (state.getValue(MatterBottlerBlock.SLOT_PROPERTIES[i - initial]) != desired) {
|
||||
state = state.setValue(MatterBottlerBlock.SLOT_PROPERTIES[i - initial], desired)
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
val matter: MatterHandlerImpl =
|
||||
object : MatterHandlerImpl(this::setChangedLight, MatterDirection.BIDIRECTIONAL, CAPACITY) {
|
||||
override val direction: MatterDirection get() {
|
||||
return if (this@BlockEntityMatterBottler.workFlow) MatterDirection.RECEIVE else MatterDirection.EXTRACT
|
||||
return if (this@MatterBottlerBlockEntity.workFlow) MatterDirection.RECEIVE else MatterDirection.EXTRACT
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuMatterBottler(containerID, inventory, this)
|
||||
return MatterBottlerMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun saveAdditional(nbt: CompoundTag) {
|
@ -17,7 +17,7 @@ import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode
|
||||
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
|
||||
class BlockEntityMatterCable(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
class MatterCableBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntity(MBlockEntities.MATTER_CABLE, p_155229_, p_155230_), IMatterGraphNode, GraphNodeListener {
|
||||
|
||||
private var valid = true
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.block.BlockBatteryBank
|
||||
import ru.dbotthepony.mc.otm.block.BatteryBankBlock
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterDirection
|
||||
@ -25,15 +25,15 @@ import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.graph.Graph6Node
|
||||
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode
|
||||
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterCapacitor
|
||||
import ru.dbotthepony.mc.otm.menu.MatterCapacitorMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
import javax.annotation.ParametersAreNonnullByDefault
|
||||
|
||||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
class BlockEntityMatterCapacitorBank(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMattery(MBlockEntities.MATTER_CAPACITOR_BANK, p_155229_, p_155230_), IMatterGraphNode, IMatterHandler {
|
||||
class MatterCapacitorBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryBlockEntity(MBlockEntities.MATTER_CAPACITOR_BANK, p_155229_, p_155230_), IMatterGraphNode, IMatterHandler {
|
||||
|
||||
private val node = Graph6Node<IMatterGraphNode>(this)
|
||||
private val resolverNode = LazyOptional.of { this }
|
||||
@ -130,9 +130,9 @@ class BlockEntityMatterCapacitorBank(p_155229_: BlockPos, p_155230_: BlockState)
|
||||
if (level != null) {
|
||||
var state = blockState
|
||||
|
||||
for (i in BlockBatteryBank.BATTERY_SLOTS_PROPS.indices) {
|
||||
for (i in BatteryBankBlock.BATTERY_SLOTS_PROPS.indices) {
|
||||
state = state.setValue(
|
||||
BlockBatteryBank.BATTERY_SLOTS_PROPS[i],
|
||||
BatteryBankBlock.BATTERY_SLOTS_PROPS[i],
|
||||
getItem(i).getCapability(MatteryCapability.MATTER).isPresent
|
||||
)
|
||||
}
|
||||
@ -163,7 +163,7 @@ class BlockEntityMatterCapacitorBank(p_155229_: BlockPos, p_155230_: BlockState)
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuMatterCapacitor(containerID, inventory, this)
|
||||
return MatterCapacitorMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
private var valid = true
|
@ -16,7 +16,7 @@ import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import net.minecraftforge.items.IItemHandler
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
@ -33,7 +33,7 @@ import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.matter.baselineComplexityDecomposeTicks
|
||||
import ru.dbotthepony.mc.otm.matter.canDecompose
|
||||
import ru.dbotthepony.mc.otm.matter.getMatterValue
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterDecomposer
|
||||
import ru.dbotthepony.mc.otm.menu.MatterDecomposerMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.registry.MItems
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
@ -91,8 +91,8 @@ fun moveMatterAsDustIntoContainer(_matterValue: ImpreciseFraction, container: Ma
|
||||
return ImpreciseFraction.ZERO
|
||||
}
|
||||
|
||||
class BlockEntityMatterDecomposer(pos: BlockPos, state: BlockState)
|
||||
: BlockEntityMatteryWorker(MBlockEntities.MATTER_DECOMPOSER, pos, state), IMatterGraphNode {
|
||||
class MatterDecomposerBlockEntity(pos: BlockPos, state: BlockState)
|
||||
: MatteryWorkerBlockEntity(MBlockEntities.MATTER_DECOMPOSER, pos, state), IMatterGraphNode {
|
||||
|
||||
override val energy = WorkerEnergyStorage(this, ENERGY_STORAGE, MAX_IO)
|
||||
private var valid = true
|
||||
@ -127,7 +127,7 @@ class BlockEntityMatterDecomposer(pos: BlockPos, state: BlockState)
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuMatterDecomposer(containerID, inventory, this)
|
||||
return MatterDecomposerMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun saveAdditional(nbt: CompoundTag) {
|
@ -4,7 +4,7 @@ import net.minecraft.core.BlockPos
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IMatterTaskProvider
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterPanel
|
||||
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu
|
||||
@ -31,21 +31,21 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import java.util.ArrayList
|
||||
import java.util.List
|
||||
|
||||
class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMattery(MBlockEntities.MATTER_PANEL, p_155229_, p_155230_), IMatterGraphNode, IMatterTaskProvider {
|
||||
class MatterPanelBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryBlockEntity(MBlockEntities.MATTER_PANEL, p_155229_, p_155230_), IMatterGraphNode, IMatterTaskProvider {
|
||||
|
||||
private val listeners = ArrayList<MenuMatterPanel>()
|
||||
private val listeners = ArrayList<MatterPanelMenu>()
|
||||
private val node = Graph6Node<IMatterGraphNode>(this)
|
||||
|
||||
override fun getAsMatterNode(): Graph6Node<IMatterGraphNode> {
|
||||
return node
|
||||
}
|
||||
|
||||
fun attachMenu(menu: MenuMatterPanel) {
|
||||
fun attachMenu(menu: MatterPanelMenu) {
|
||||
listeners.add(menu)
|
||||
}
|
||||
|
||||
fun deatachMenu(menu: MenuMatterPanel) {
|
||||
fun deatachMenu(menu: MatterPanelMenu) {
|
||||
listeners.remove(menu)
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuMatterPanel(containerID, inventory, this)
|
||||
return MatterPanelMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
private var valid = true
|
||||
@ -117,7 +117,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
if (!simulate) {
|
||||
val new = task.shrinkRequired(1)
|
||||
_tasks[key] = new
|
||||
listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(new) }
|
||||
listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(new) }
|
||||
graph.onMatterTaskUpdated(new, task)
|
||||
setChanged()
|
||||
}
|
||||
@ -141,12 +141,12 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
if (localTask.required <= 0 && localTask.in_progress <= 0) {
|
||||
_tasks.remove(task.id)
|
||||
graph?.onMatterTaskCreated(task)
|
||||
listeners.forEach { menu: MenuMatterPanel -> menu.taskRemoved(localTask) }
|
||||
listeners.forEach { menu: MatterPanelMenu -> menu.taskRemoved(localTask) }
|
||||
} else {
|
||||
// Задача обновлена
|
||||
_tasks[task.id()] = localTask
|
||||
graph?.onMatterTaskUpdated(localTask, oldTask)
|
||||
listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(localTask) }
|
||||
listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(localTask) }
|
||||
}
|
||||
|
||||
setChanged()
|
||||
@ -189,7 +189,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
|
||||
(node.graph as MatterNetworkGraph?)?.onMatterTaskRemoved(task)
|
||||
|
||||
listeners.forEach { menu: MenuMatterPanel -> menu.taskRemoved(task) }
|
||||
listeners.forEach { menu: MatterPanelMenu -> menu.taskRemoved(task) }
|
||||
setChanged()
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
|
||||
(node.graph as MatterNetworkGraph?)?.onMatterTaskCreated(task)
|
||||
|
||||
listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(task) }
|
||||
listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(task) }
|
||||
setChanged()
|
||||
|
||||
return task
|
||||
@ -212,7 +212,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
|
||||
for (task in _tasks.values) {
|
||||
graph?.onMatterTaskRemoved(task)
|
||||
listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(task) }
|
||||
listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(task) }
|
||||
}
|
||||
|
||||
_tasks.clear()
|
@ -14,7 +14,7 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerTickContext
|
||||
@ -30,13 +30,13 @@ import ru.dbotthepony.mc.otm.graph.Graph6Node
|
||||
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode
|
||||
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.item.ItemMatterDust
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterRecycler
|
||||
import ru.dbotthepony.mc.otm.item.MatterDustItem
|
||||
import ru.dbotthepony.mc.otm.menu.MatterRecyclerMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
|
||||
class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState)
|
||||
: BlockEntityMatteryWorker(MBlockEntities.MATTER_RECYCLER, blockPos, blockState), IMatterGraphNode {
|
||||
class MatterRecyclerBlockEntity(blockPos: BlockPos, blockState: BlockState)
|
||||
: MatteryWorkerBlockEntity(MBlockEntities.MATTER_RECYCLER, blockPos, blockState), IMatterGraphNode {
|
||||
val matter = MatterHandlerImpl(
|
||||
this::setChangedLight,
|
||||
MatterDirection.EXTRACT,
|
||||
@ -58,7 +58,7 @@ class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState)
|
||||
|
||||
private val itemHandler = container.handler(object : MatteryContainerFilter {
|
||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
||||
return stack.item is ItemMatterDust
|
||||
return stack.item is MatterDustItem
|
||||
}
|
||||
|
||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
||||
@ -122,7 +122,7 @@ class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState)
|
||||
override fun getDefaultDisplayName() = NAME
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuMatterRecycler(containerID, inventory, this)
|
||||
return MatterRecyclerMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun onJobFinish(job: WorkerJob): WorkerJobStatus {
|
||||
@ -136,14 +136,14 @@ class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState)
|
||||
|
||||
val stack = container[0]
|
||||
|
||||
if (stack.isEmpty || stack.item !is ItemMatterDust) {
|
||||
if (stack.isEmpty || stack.item !is MatterDustItem) {
|
||||
return null
|
||||
}
|
||||
|
||||
val copy = stack.copy()
|
||||
copy.count = 1
|
||||
|
||||
val dustMatter = (stack.item as ItemMatterDust).getMatterValue(copy) ?: return null
|
||||
val dustMatter = (stack.item as MatterDustItem).getMatterValue(copy) ?: return null
|
||||
stack.shrink(1)
|
||||
return WorkerJob(copy, dustMatter.value.toDouble() * MATTER_TICKS, POWER_CONSUMPTION)
|
||||
}
|
@ -14,7 +14,7 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerTickContext
|
||||
@ -30,12 +30,12 @@ import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.matter.baselineComplexityReplicateTicks
|
||||
import ru.dbotthepony.mc.otm.matter.getMatterValue
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterReplicator
|
||||
import ru.dbotthepony.mc.otm.menu.MatterReplicatorMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
|
||||
class BlockEntityMatterReplicator(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMatteryWorker(MBlockEntities.MATTER_REPLICATOR, p_155229_, p_155230_), IMatterGraphNode {
|
||||
class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryWorkerBlockEntity(MBlockEntities.MATTER_REPLICATOR, p_155229_, p_155230_), IMatterGraphNode {
|
||||
|
||||
override val energy = WorkerEnergyStorage(this, STORAGE, MAX_IO)
|
||||
private val node = Graph6Node<IMatterGraphNode>(this)
|
||||
@ -62,7 +62,7 @@ class BlockEntityMatterReplicator(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuMatterReplicator(containerID, inventory, this)
|
||||
return MatterReplicatorMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun onJobFinish(job: WorkerJob): WorkerJobStatus {
|
@ -15,7 +15,7 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
@ -27,12 +27,12 @@ import ru.dbotthepony.mc.otm.graph.Graph6Node
|
||||
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode
|
||||
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.matter.*
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterScanner
|
||||
import ru.dbotthepony.mc.otm.menu.MatterScannerMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import java.util.*
|
||||
|
||||
class BlockEntityMatterScanner(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMatteryWorker(MBlockEntities.MATTER_SCANNER, p_155229_, p_155230_), IMatterGraphNode {
|
||||
class MatterScannerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryWorkerBlockEntity(MBlockEntities.MATTER_SCANNER, p_155229_, p_155230_), IMatterGraphNode {
|
||||
|
||||
val container = MatteryContainer(this::setChanged, 1)
|
||||
override val energy = WorkerEnergyStorage(this, STORAGE, MAX_IO)
|
||||
@ -97,7 +97,7 @@ class BlockEntityMatterScanner(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuMatterScanner(containerID, inventory, this)
|
||||
return MatterScannerMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override fun saveAdditional(nbt: CompoundTag) {
|
@ -6,7 +6,6 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.entity.BlockEntity
|
||||
import net.minecraft.world.MenuProvider
|
||||
import java.lang.Runnable
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
import net.minecraft.client.multiplayer.ClientLevel
|
||||
import net.minecraft.core.Direction
|
||||
@ -22,13 +21,11 @@ import net.minecraft.nbt.StringTag
|
||||
import net.minecraft.nbt.ByteTag
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.chunk.ChunkStatus
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
import java.util.function.Consumer
|
||||
|
||||
abstract class BlockEntityMattery(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(p_155228_, p_155229_, p_155230_), MenuProvider {
|
||||
abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(p_155228_, p_155229_, p_155230_), MenuProvider {
|
||||
var customDisplayName: Component? = null
|
||||
var redstoneSignal = 0
|
||||
set(level) {
|
@ -10,12 +10,11 @@ import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.energy.CapabilityEnergy
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.core.Fraction
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
|
||||
abstract class BlockEntityMatteryPowered(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(p_155228_, p_155229_, p_155230_) {
|
||||
abstract class MatteryPoweredBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity(p_155228_, p_155229_, p_155230_) {
|
||||
abstract val energy: EnergyStorageImpl
|
||||
private var valid = true
|
||||
val batteryContainer = MatteryContainer(this::setChangedLight, 1)
|
@ -6,14 +6,14 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.block.BlockPatternStorage
|
||||
import ru.dbotthepony.mc.otm.block.PatternStorageBlock
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu
|
||||
import ru.dbotthepony.mc.otm.menu.MenuPatternStorage
|
||||
import ru.dbotthepony.mc.otm.menu.PatternStorageMenu
|
||||
import net.minecraft.MethodsReturnNonnullByDefault
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.network.chat.Component
|
||||
@ -33,8 +33,8 @@ import java.util.ArrayList
|
||||
|
||||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
class BlockEntityPatternStorage(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMattery(MBlockEntities.PATTERN_STORAGE, p_155229_, p_155230_), IMatterGraphNode, IPatternStorage {
|
||||
class PatternStorageBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryBlockEntity(MBlockEntities.PATTERN_STORAGE, p_155229_, p_155230_), IMatterGraphNode, IPatternStorage {
|
||||
|
||||
private val node = Graph6Node<IMatterGraphNode>(this)
|
||||
private val resolverPatterns = LazyOptional.of { this }
|
||||
@ -76,7 +76,7 @@ class BlockEntityPatternStorage(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
|
||||
for (i in 0..7) {
|
||||
state = state.setValue(
|
||||
BlockPatternStorage.PATTERN_STORAGE_DISKS_PROPS[i],
|
||||
PatternStorageBlock.PATTERN_STORAGE_DISKS_PROPS[i],
|
||||
patterns.getItem(i).getCapability(MatteryCapability.PATTERN).isPresent
|
||||
)
|
||||
}
|
||||
@ -147,7 +147,7 @@ class BlockEntityPatternStorage(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
|
||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||
return MenuPatternStorage(containerID, inventory, this)
|
||||
return PatternStorageMenu(containerID, inventory, this)
|
||||
}
|
||||
|
||||
override val storedPatterns: Collection<PatternState> get() {
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.items.CapabilityItemHandler
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
@ -24,7 +24,7 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.registry.MRecipes
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
|
||||
class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryWorker(MBlockEntities.PLATE_PRESS, p_155229_, p_155230_) {
|
||||
class PlatePressBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryWorkerBlockEntity(MBlockEntities.PLATE_PRESS, p_155229_, p_155230_) {
|
||||
val container = MatteryContainer(this::setChangedLight, 2)
|
||||
override val energy = WorkerEnergyStorage(this::setChangedLight)
|
||||
|
@ -22,8 +22,8 @@ import net.minecraft.world.level.levelgen.structure.BoundingBox
|
||||
import net.minecraft.world.phys.AABB
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import ru.dbotthepony.mc.otm.registry.Registry
|
||||
import ru.dbotthepony.mc.otm.block.BlockBlackHole
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer
|
||||
import ru.dbotthepony.mc.otm.block.BlackHoleBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.ExplosionQueue.Companion.queueForLevel
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.core.plus
|
||||
@ -34,7 +34,7 @@ import ru.dbotthepony.mc.otm.set
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.math.sqrt
|
||||
|
||||
class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(MBlockEntities.BLACK_HOLE, p_155229_, p_155230_) {
|
||||
class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(MBlockEntities.BLACK_HOLE, p_155229_, p_155230_) {
|
||||
var mass = BASELINE_MASS
|
||||
set(mass) {
|
||||
if (mass <= ImpreciseFraction.ZERO) {
|
||||
@ -79,7 +79,7 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn
|
||||
}
|
||||
|
||||
override fun getRenderBoundingBox(): AABB {
|
||||
return AABB(blockPos.offset(-BlockEntityGravitationStabilizer.RANGE, -BlockEntityGravitationStabilizer.RANGE, -BlockEntityGravitationStabilizer.RANGE), blockPos.offset(BlockEntityGravitationStabilizer.RANGE, BlockEntityGravitationStabilizer.RANGE, BlockEntityGravitationStabilizer.RANGE))
|
||||
return AABB(blockPos.offset(-GravitationStabilizerBlockEntity.RANGE, -GravitationStabilizerBlockEntity.RANGE, -GravitationStabilizerBlockEntity.RANGE), blockPos.offset(GravitationStabilizerBlockEntity.RANGE, GravitationStabilizerBlockEntity.RANGE, GravitationStabilizerBlockEntity.RANGE))
|
||||
}
|
||||
|
||||
var gravitationStrength = 1.0
|
||||
@ -95,10 +95,10 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn
|
||||
sleepTicks = 4
|
||||
}
|
||||
|
||||
private val stabilizers = ArrayList<BlockEntityGravitationStabilizer>()
|
||||
private val stabilizers = ArrayList<GravitationStabilizerBlockEntity>()
|
||||
private var stabilizerClientCount = 0
|
||||
|
||||
fun stabilizerAttached(stabilizer: BlockEntityGravitationStabilizer) {
|
||||
fun stabilizerAttached(stabilizer: GravitationStabilizerBlockEntity) {
|
||||
if (stabilizers.contains(stabilizer))
|
||||
return
|
||||
|
||||
@ -106,7 +106,7 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn
|
||||
mass = mass
|
||||
}
|
||||
|
||||
fun stabilizerDetached(stabilizer: BlockEntityGravitationStabilizer) {
|
||||
fun stabilizerDetached(stabilizer: GravitationStabilizerBlockEntity) {
|
||||
if (stabilizers.remove(stabilizer)) {
|
||||
mass = mass
|
||||
}
|
||||
@ -315,7 +315,7 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn
|
||||
|
||||
val getBlock = level.getBlockState(pos)
|
||||
|
||||
if (!getBlock.isAir && getBlock.block !is BlockBlackHole) {
|
||||
if (!getBlock.isAir && getBlock.block !is BlackHoleBlock) {
|
||||
val speed = getBlock.getDestroySpeed(level, pos)
|
||||
|
||||
val eResist = try {
|
@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.block.entity.worker
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatteryPowered
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.nbt.DoubleTag
|
||||
import net.minecraft.world.level.block.Block
|
||||
@ -13,8 +13,8 @@ import ru.dbotthepony.mc.otm.core.weakLessThan
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
|
||||
abstract class BlockEntityMatteryWorker(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
BlockEntityMatteryPowered(p_155228_, p_155229_, p_155230_) {
|
||||
abstract class MatteryWorkerBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
MatteryPoweredBlockEntity(p_155228_, p_155229_, p_155230_) {
|
||||
var workTicks = 0.0
|
||||
protected set
|
||||
|
@ -12,8 +12,8 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider
|
||||
import net.minecraft.network.chat.TranslatableComponent
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import org.lwjgl.opengl.GL30
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole
|
||||
import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.menu.FormattingHelper
|
||||
@ -68,8 +68,8 @@ private fun beam(matrix4f: Matrix4f, builder: BufferBuilder, fwdRotation: Double
|
||||
private fun quadY(z: Double): Array<Vector> {
|
||||
return arrayOf(
|
||||
Vector(0.0, -BEAM_WIDTH, z),
|
||||
Vector(BlockEntityGravitationStabilizer.RANGE.toDouble(), -BEAM_WIDTH, z),
|
||||
Vector(BlockEntityGravitationStabilizer.RANGE.toDouble(), BEAM_WIDTH, z),
|
||||
Vector(GravitationStabilizerBlockEntity.RANGE.toDouble(), -BEAM_WIDTH, z),
|
||||
Vector(GravitationStabilizerBlockEntity.RANGE.toDouble(), BEAM_WIDTH, z),
|
||||
Vector(0.0, BEAM_WIDTH, z)
|
||||
)
|
||||
}
|
||||
@ -77,15 +77,15 @@ private fun quadY(z: Double): Array<Vector> {
|
||||
private fun quadZ(y: Double): Array<Vector> {
|
||||
return arrayOf(
|
||||
Vector(0.0, y, -BEAM_WIDTH),
|
||||
Vector(BlockEntityGravitationStabilizer.RANGE.toDouble(), y, -BEAM_WIDTH),
|
||||
Vector(BlockEntityGravitationStabilizer.RANGE.toDouble(), y, BEAM_WIDTH),
|
||||
Vector(GravitationStabilizerBlockEntity.RANGE.toDouble(), y, -BEAM_WIDTH),
|
||||
Vector(GravitationStabilizerBlockEntity.RANGE.toDouble(), y, BEAM_WIDTH),
|
||||
Vector(0.0, y, BEAM_WIDTH)
|
||||
)
|
||||
}
|
||||
|
||||
class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer<BlockEntityBlackHole> {
|
||||
class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer<BlackHoleBlockEntity> {
|
||||
override fun render(
|
||||
tile: BlockEntityBlackHole,
|
||||
tile: BlackHoleBlockEntity,
|
||||
v: Float,
|
||||
poseStack: PoseStack,
|
||||
multiBufferSource: MultiBufferSource,
|
||||
@ -182,11 +182,11 @@ class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context
|
||||
}
|
||||
}
|
||||
|
||||
override fun shouldRenderOffScreen(p_112306_: BlockEntityBlackHole): Boolean {
|
||||
override fun shouldRenderOffScreen(p_112306_: BlackHoleBlockEntity): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun shouldRender(p_173568_: BlockEntityBlackHole, p_173569_: Vec3): Boolean {
|
||||
override fun shouldRender(p_173568_: BlackHoleBlockEntity, p_173569_: Vec3): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderer
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.network.chat.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.block.BlockEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.block.EnergyCounterBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.core.RGBAColor
|
||||
import ru.dbotthepony.mc.otm.core.asAngle
|
||||
@ -24,8 +24,8 @@ class EnergyCounterRenderer(private val context: BlockEntityRendererProvider.Con
|
||||
p_112311_: Int,
|
||||
p_112312_: Int
|
||||
) {
|
||||
val screenDir: Direction = tile.blockState.getValue(BlockEnergyCounter.IF_DIRECTION)
|
||||
val inputDir: Direction = tile.blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION)
|
||||
val screenDir: Direction = tile.blockState.getValue(EnergyCounterBlock.IF_DIRECTION)
|
||||
val inputDir: Direction = tile.blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION)
|
||||
|
||||
poseStack.pushPose()
|
||||
poseStack.translate(0.5, 0.5, 0.5)
|
||||
|
@ -11,10 +11,10 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.network.chat.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.block.BlockBlackHole
|
||||
import ru.dbotthepony.mc.otm.block.BlackHoleBlock
|
||||
import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole
|
||||
import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.menu.FormattingHelper
|
||||
@ -23,9 +23,9 @@ import kotlin.math.PI
|
||||
private val BEAM_RENDER_TYPE_INNER = RenderType.beaconBeam(BeaconRenderer.BEAM_LOCATION, false)
|
||||
private val BEAM_RENDER_TYPE_OUTER = RenderType.beaconBeam(BeaconRenderer.BEAM_LOCATION, true)
|
||||
|
||||
class GravitationStabilizerRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer<BlockEntityGravitationStabilizer> {
|
||||
class GravitationStabilizerRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer<GravitationStabilizerBlockEntity> {
|
||||
override fun render(
|
||||
tile: BlockEntityGravitationStabilizer,
|
||||
tile: GravitationStabilizerBlockEntity,
|
||||
p_112308_: Float,
|
||||
poseStack: PoseStack,
|
||||
p_112310_: MultiBufferSource,
|
||||
@ -39,14 +39,14 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv
|
||||
var lenI = 64
|
||||
val normal = tile.blockState.getValue(BlockMatteryRotatable.FACING_FULL).normal
|
||||
val level = tile.level
|
||||
var bhTile: BlockEntityBlackHole? = null
|
||||
var bhTile: BlackHoleBlockEntity? = null
|
||||
|
||||
if (level != null) {
|
||||
for (i in 1 .. BlockEntityGravitationStabilizer.RANGE) {
|
||||
for (i in 1 .. GravitationStabilizerBlockEntity.RANGE) {
|
||||
val pos = tile.blockPos + normal * i
|
||||
val getTile = level.getBlockEntity(pos) as? BlockEntityBlackHole
|
||||
val getTile = level.getBlockEntity(pos) as? BlackHoleBlockEntity
|
||||
|
||||
if (getTile != null || level.getBlockState(pos).block is BlockBlackHole) {
|
||||
if (getTile != null || level.getBlockState(pos).block is BlackHoleBlock) {
|
||||
len = i.toDouble()
|
||||
lenI = i
|
||||
bhTile = getTile
|
||||
@ -151,7 +151,7 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv
|
||||
}
|
||||
}
|
||||
|
||||
override fun shouldRenderOffScreen(p_112306_: BlockEntityGravitationStabilizer) = true
|
||||
override fun shouldRenderOffScreen(p_112306_: GravitationStabilizerBlockEntity) = true
|
||||
override fun getViewDistance() = 96
|
||||
|
||||
companion object {
|
||||
|
@ -19,12 +19,12 @@ import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.menu.AndroidStationMenu
|
||||
import java.util.*
|
||||
|
||||
class ScreenAndroidStation constructor(p_97741_: AndroidStationMenu, p_97742_: Inventory, p_97743_: Component) :
|
||||
class AndroidStationScreen constructor(p_97741_: AndroidStationMenu, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<AndroidStationMenu>(p_97741_, p_97742_, p_97743_) {
|
||||
|
||||
internal inner class AndroidResearchButton(parent: EditablePanel?, private val node: AndroidResearch) :
|
||||
EditablePanel(
|
||||
this@ScreenAndroidStation,
|
||||
this@AndroidStationScreen,
|
||||
parent,
|
||||
0f,
|
||||
0f,
|
||||
@ -103,7 +103,7 @@ class ScreenAndroidStation constructor(p_97741_: AndroidStationMenu, p_97742_: I
|
||||
seen.add(research)
|
||||
|
||||
if (rows[level] == null) {
|
||||
rows[level] = object : EditablePanel(this@ScreenAndroidStation, canvas, 0f, (level * 22).toFloat(), 10000f, 22f) {
|
||||
rows[level] = object : EditablePanel(this@AndroidStationScreen, canvas, 0f, (level * 22).toFloat(), 10000f, 22f) {
|
||||
override fun mouseClickedInner(mouse_x: Double, mouse_y: Double, flag: Int) = false
|
||||
override fun mouseReleasedInner(mouse_x: Double, mouse_y: Double, flag: Int) = false
|
||||
override fun mouseDraggedInner(mouse_x: Double, mouse_y: Double, flag: Int, drag_x: Double, drag_y: Double) = false
|
||||
@ -138,7 +138,7 @@ class ScreenAndroidStation constructor(p_97741_: AndroidStationMenu, p_97742_: I
|
||||
|
||||
research = FramePanel(this, null, 0f, 0f, window.guiScaledWidth * 0.8f, window.guiScaledHeight * 0.8f, TranslatableComponent("otm.gui.android_research"))
|
||||
|
||||
canvas = object : DraggableCanvasPanel(this@ScreenAndroidStation, research, width = (GRID_WIDTH * 22).toFloat(), height = 0f) {
|
||||
canvas = object : DraggableCanvasPanel(this@AndroidStationScreen, research, width = (GRID_WIDTH * 22).toFloat(), height = 0f) {
|
||||
override fun innerRender(stack: PoseStack, mouse_x: Float, mouse_y: Float, flag: Float) {
|
||||
RenderHelper.setDrawColor(RGBAColor.BLACK)
|
||||
RenderHelper.drawRect(stack, 0f, 0f, width, height)
|
@ -1,14 +1,14 @@
|
||||
package ru.dbotthepony.mc.otm.client.screen
|
||||
|
||||
import net.minecraft.network.chat.Component
|
||||
import ru.dbotthepony.mc.otm.menu.MenuBatteryBank
|
||||
import ru.dbotthepony.mc.otm.menu.BatteryBankMenu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
|
||||
class ScreenBatteryBank(menu: MenuBatteryBank, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MenuBatteryBank>(menu, p_97742_, p_97743_) {
|
||||
class BatteryBankScreen(menu: BatteryBankMenu, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<BatteryBankMenu>(menu, p_97742_, p_97743_) {
|
||||
|
||||
override fun makeMainFrame(): FramePanel{
|
||||
val frame = super.makeMainFrame()!!
|
@ -5,9 +5,9 @@ import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.GridPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.menu.MenuCargoCrate
|
||||
import ru.dbotthepony.mc.otm.menu.CargoCrateMenu
|
||||
|
||||
class ScreenCargoCrate(menu: MenuCargoCrate, inventory: Inventory, title: Component) : MatteryScreen<MenuCargoCrate>(menu, inventory, title) {
|
||||
class CargoCrateScreen(menu: CargoCrateMenu, inventory: Inventory, title: Component) : MatteryScreen<CargoCrateMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = FramePanel(this, null, 0f, 0f, INVENTORY_FRAME_WIDTH, 22f + 4f + 6f * 18f, getTitle())
|
||||
val grid = GridPanel(this, frame, 8f, 18f, 9f * 18f, 6f * 18f, 9, 6)
|
@ -6,9 +6,9 @@ import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.*
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
import ru.dbotthepony.mc.otm.menu.MenuChemicalGenerator
|
||||
import ru.dbotthepony.mc.otm.menu.ChemicalGeneratorMenu
|
||||
|
||||
class ScreenChemicalGenerator(menu: MenuChemicalGenerator, inventory: Inventory, title: Component) : MatteryScreen<MenuChemicalGenerator>(menu, inventory, title) {
|
||||
class ChemicalGeneratorScreen(menu: ChemicalGeneratorMenu, inventory: Inventory, title: Component) : MatteryScreen<ChemicalGeneratorMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
@ -1,14 +1,14 @@
|
||||
package ru.dbotthepony.mc.otm.client.screen
|
||||
|
||||
import net.minecraft.network.chat.Component
|
||||
import ru.dbotthepony.mc.otm.menu.MenuDriveRack
|
||||
import ru.dbotthepony.mc.otm.menu.DriveRackMenu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
|
||||
class ScreenDriveRack(menu: MenuDriveRack, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<MenuDriveRack>(menu, inventory, title) {
|
||||
class DriveRackScreen(menu: DriveRackMenu, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<DriveRackMenu>(menu, inventory, title) {
|
||||
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
@ -6,14 +6,14 @@ import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.*
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive.FilterSettings
|
||||
import ru.dbotthepony.mc.otm.menu.MenuDriveViewer
|
||||
import ru.dbotthepony.mc.otm.menu.MenuDriveViewer.FilterSetPacket
|
||||
import ru.dbotthepony.mc.otm.menu.MenuDriveViewer.FilterSwitchPacket
|
||||
import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem.FilterSettings
|
||||
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu
|
||||
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu.FilterSetPacket
|
||||
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu.FilterSwitchPacket
|
||||
import ru.dbotthepony.mc.otm.network.MatteryNetworking
|
||||
|
||||
class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<MenuDriveViewer>(menu, inventory, title) {
|
||||
class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<DriveViewerMenu>(menu, inventory, title) {
|
||||
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle())
|
||||
@ -59,7 +59,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp
|
||||
views.add(scroll_bar)
|
||||
|
||||
for (i in 0 until GRID_WIDTH * GRID_HEIGHT) {
|
||||
object : AbstractSlotPanel(this@ScreenDriveViewer, grid, 0f, 0f) {
|
||||
object : AbstractSlotPanel(this@DriveViewerScreen, grid, 0f, 0f) {
|
||||
override fun getItemStack(): ItemStack {
|
||||
val index = i + scroll_bar.getScroll(menu.view.getItems().size / GRID_WIDTH)
|
||||
val list = menu.view.getItems()
|
||||
@ -91,7 +91,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp
|
||||
settings.add(grid_filter)
|
||||
|
||||
for (i in 0 until FilterSettings.MAX_FILTERS) {
|
||||
object : AbstractSlotPanel(this@ScreenDriveViewer, grid_filter, 0f, 0f) {
|
||||
object : AbstractSlotPanel(this@DriveViewerScreen, grid_filter, 0f, 0f) {
|
||||
override fun getItemStack(): ItemStack {
|
||||
val filter = menu.getFilter() ?: return ItemStack.EMPTY
|
||||
return filter.items[i]
|
||||
@ -118,7 +118,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp
|
||||
val yes = TranslatableComponent("otm.filter.yes")
|
||||
|
||||
val matchNbt =
|
||||
object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_nbt", no)) {
|
||||
object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_nbt", no)) {
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
|
||||
@ -140,7 +140,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp
|
||||
null,
|
||||
FilterSwitchPacket(
|
||||
menu.containerId,
|
||||
MenuDriveViewer.FilterSwitch.MATCH_NBT,
|
||||
DriveViewerMenu.FilterSwitch.MATCH_NBT,
|
||||
!filter.matchNbt
|
||||
)
|
||||
)
|
||||
@ -151,7 +151,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp
|
||||
}
|
||||
|
||||
val matchTag =
|
||||
object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_tag", no)) {
|
||||
object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_tag", no)) {
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
|
||||
@ -173,7 +173,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp
|
||||
null,
|
||||
FilterSwitchPacket(
|
||||
menu.containerId,
|
||||
MenuDriveViewer.FilterSwitch.MATCH_TAG,
|
||||
DriveViewerMenu.FilterSwitch.MATCH_TAG,
|
||||
!filter.matchTag
|
||||
)
|
||||
)
|
||||
@ -184,7 +184,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp
|
||||
}
|
||||
|
||||
val blacklist =
|
||||
object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.blacklist", no)) {
|
||||
object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.blacklist", no)) {
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
|
||||
@ -205,7 +205,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp
|
||||
null,
|
||||
FilterSwitchPacket(
|
||||
menu.containerId,
|
||||
MenuDriveViewer.FilterSwitch.BLACKLIST,
|
||||
DriveViewerMenu.FilterSwitch.BLACKLIST,
|
||||
!filter.isBlacklist
|
||||
)
|
||||
)
|
@ -4,14 +4,14 @@ import net.minecraft.network.chat.Component
|
||||
import net.minecraft.network.chat.TranslatableComponent
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.*
|
||||
import ru.dbotthepony.mc.otm.menu.MenuEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.menu.EnergyCounterMenu
|
||||
import ru.dbotthepony.mc.otm.menu.FormattingHelper
|
||||
|
||||
class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title: Component) : MatteryScreen<MenuEnergyCounter>(menu, inventory, title) {
|
||||
class EnergyCounterScreen(menu: EnergyCounterMenu, inventory: Inventory, title: Component) : MatteryScreen<EnergyCounterMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
||||
var label: Label = object : Label(this@ScreenEnergyCounter, frame) {
|
||||
var label: Label = object : Label(this@EnergyCounterScreen, frame) {
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
text = TranslatableComponent(
|
||||
@ -24,7 +24,7 @@ class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title:
|
||||
label.dock = Dock.TOP
|
||||
label.setDockMargin(4f, 0f, 0f, 0f)
|
||||
|
||||
label = object : Label(this@ScreenEnergyCounter, frame) {
|
||||
label = object : Label(this@EnergyCounterScreen, frame) {
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
text = TranslatableComponent(
|
||||
@ -37,7 +37,7 @@ class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title:
|
||||
label.dock = Dock.TOP
|
||||
label.setDockMargin(4f, 0f, 0f, 0f)
|
||||
|
||||
label = object : Label(this@ScreenEnergyCounter, frame) {
|
||||
label = object : Label(this@EnergyCounterScreen, frame) {
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
text = TranslatableComponent(
|
||||
@ -50,7 +50,7 @@ class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title:
|
||||
label.dock = Dock.TOP
|
||||
label.setDockMargin(4f, 0f, 0f, 0f)
|
||||
|
||||
label = object : Label(this@ScreenEnergyCounter, frame) {
|
||||
label = object : Label(this@EnergyCounterScreen, frame) {
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
text = TranslatableComponent(
|
||||
@ -63,7 +63,7 @@ class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title:
|
||||
label.dock = Dock.TOP
|
||||
label.setDockMargin(4f, 0f, 0f, 0f)
|
||||
|
||||
label = object : Label(this@ScreenEnergyCounter, frame) {
|
||||
label = object : Label(this@EnergyCounterScreen, frame) {
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
|
@ -5,10 +5,10 @@ import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.*
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.menu.MenuItemMonitor
|
||||
import ru.dbotthepony.mc.otm.menu.ItemMonitorMenu
|
||||
|
||||
class ScreenItemMonitor(menu: MenuItemMonitor, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<MenuItemMonitor>(menu, inventory, title) {
|
||||
class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<ItemMonitorMenu>(menu, inventory, title) {
|
||||
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle())
|
||||
@ -22,7 +22,7 @@ class ScreenItemMonitor(menu: MenuItemMonitor, inventory: Inventory, title: Comp
|
||||
val gridPanel = GridPanel(this, frame, 28f, 16f, GRID_WIDTH * 18f, GRID_HEIGHT * 18f, GRID_WIDTH, GRID_HEIGHT)
|
||||
|
||||
for (i in 0 until GRID_WIDTH * GRID_HEIGHT) {
|
||||
object : AbstractSlotPanel(this@ScreenItemMonitor, gridPanel) {
|
||||
object : AbstractSlotPanel(this@ItemMonitorScreen, gridPanel) {
|
||||
override fun getItemStack(): ItemStack {
|
||||
val index = i + scrollBar.getScroll(menu.view.getItemCount() / GRID_WIDTH)
|
||||
val list = menu.view.getItems()
|
@ -9,10 +9,10 @@ import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterBottler
|
||||
import ru.dbotthepony.mc.otm.menu.MatterBottlerMenu
|
||||
|
||||
class ScreenMatterBottler(menu: MenuMatterBottler, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<MenuMatterBottler>(menu, inventory, title) {
|
||||
class MatterBottlerScreen(menu: MatterBottlerMenu, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<MatterBottlerMenu>(menu, inventory, title) {
|
||||
|
||||
private var progress: ProgressGaugePanel? = null
|
||||
|
@ -1,14 +1,14 @@
|
||||
package ru.dbotthepony.mc.otm.client.screen
|
||||
|
||||
import net.minecraft.network.chat.Component
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterCapacitor
|
||||
import ru.dbotthepony.mc.otm.menu.MatterCapacitorMenu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
||||
|
||||
class ScreenMatterCapacitorBank(p_97741_: MenuMatterCapacitor, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MenuMatterCapacitor>(p_97741_, p_97742_, p_97743_) {
|
||||
class MatterCapacitorBankScreen(p_97741_: MatterCapacitorMenu, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MatterCapacitorMenu>(p_97741_, p_97742_, p_97743_) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
@ -1,7 +1,7 @@
|
||||
package ru.dbotthepony.mc.otm.client.screen
|
||||
|
||||
import net.minecraft.network.chat.Component
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterDecomposer
|
||||
import ru.dbotthepony.mc.otm.menu.MatterDecomposerMenu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
@ -9,8 +9,8 @@ import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
|
||||
class ScreenMatterDecomposer(p_97741_: MenuMatterDecomposer, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MenuMatterDecomposer>(p_97741_, p_97742_, p_97743_) {
|
||||
class MatterDecomposerScreen(p_97741_: MatterDecomposerMenu, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MatterDecomposerMenu>(p_97741_, p_97742_, p_97743_) {
|
||||
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
@ -7,9 +7,9 @@ import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterRecycler
|
||||
import ru.dbotthepony.mc.otm.menu.MatterRecyclerMenu
|
||||
|
||||
class ScreenMatterRecycler(menu: MenuMatterRecycler, inventory: Inventory, title: Component) : MatteryScreen<MenuMatterRecycler>(menu, inventory, title) {
|
||||
class MatterRecyclerScreen(menu: MatterRecyclerMenu, inventory: Inventory, title: Component) : MatteryScreen<MatterRecyclerMenu>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
@ -1,7 +1,7 @@
|
||||
package ru.dbotthepony.mc.otm.client.screen
|
||||
|
||||
import net.minecraft.network.chat.Component
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterReplicator
|
||||
import ru.dbotthepony.mc.otm.menu.MatterReplicatorMenu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
@ -9,8 +9,8 @@ import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
|
||||
class ScreenMatterReplicator(p_97741_: MenuMatterReplicator, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MenuMatterReplicator>(p_97741_, p_97742_, p_97743_) {
|
||||
class MatterReplicatorScreen(p_97741_: MatterReplicatorMenu, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MatterReplicatorMenu>(p_97741_, p_97742_, p_97743_) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
@ -1,7 +1,7 @@
|
||||
package ru.dbotthepony.mc.otm.client.screen
|
||||
|
||||
import net.minecraft.network.chat.Component
|
||||
import ru.dbotthepony.mc.otm.menu.MenuMatterScanner
|
||||
import ru.dbotthepony.mc.otm.menu.MatterScannerMenu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
@ -9,8 +9,8 @@ import ru.dbotthepony.mc.otm.client.screen.widget.PatternGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
|
||||
class ScreenMatterScanner(p_97741_: MenuMatterScanner, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MenuMatterScanner>(p_97741_, p_97742_, p_97743_) {
|
||||
class MatterScannerScreen(p_97741_: MatterScannerMenu, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MatterScannerMenu>(p_97741_, p_97742_, p_97743_) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
@ -1,14 +1,14 @@
|
||||
package ru.dbotthepony.mc.otm.client.screen
|
||||
|
||||
import net.minecraft.network.chat.Component
|
||||
import ru.dbotthepony.mc.otm.menu.MenuPatternStorage
|
||||
import ru.dbotthepony.mc.otm.menu.PatternStorageMenu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PatternGaugePanel
|
||||
|
||||
class ScreenPatternStorage(p_97741_: MenuPatternStorage, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<MenuPatternStorage>(p_97741_, p_97742_, p_97743_) {
|
||||
class PatternStorageScreen(p_97741_: PatternStorageMenu, p_97742_: Inventory, p_97743_: Component) :
|
||||
MatteryScreen<PatternStorageMenu>(p_97741_, p_97742_, p_97743_) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
||||
|
@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
import ru.dbotthepony.mc.otm.menu.MenuPlatePress
|
||||
|
||||
class ScreenPlatePress(menu: MenuPlatePress, inventory: Inventory, title: Component) :
|
||||
class PlatePressScreen(menu: MenuPlatePress, inventory: Inventory, title: Component) :
|
||||
MatteryScreen<MenuPlatePress>(menu, inventory, title) {
|
||||
override fun makeMainFrame(): FramePanel {
|
||||
val frame = super.makeMainFrame()!!
|
@ -1,6 +1,5 @@
|
||||
package ru.dbotthepony.mc.otm.item
|
||||
|
||||
import ru.dbotthepony.mc.otm.core.Fraction.Companion.deserializeNBT
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider
|
||||
import net.minecraft.world.item.ItemStack
|
||||
@ -19,10 +18,9 @@ import net.minecraft.world.item.Rarity
|
||||
import net.minecraft.world.item.TooltipFlag
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import ru.dbotthepony.mc.otm.core.Fraction
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
|
||||
class ItemBattery : Item {
|
||||
class BatteryItem : Item {
|
||||
private inner class BatteryMatteryCapability(private val stack: ItemStack) : IMatteryEnergyStorage, ICapabilityProvider {
|
||||
private fun energy(): ImpreciseFraction {
|
||||
val tag = stack.orCreateTag
|
@ -3,7 +3,6 @@ package ru.dbotthepony.mc.otm.item
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.TooltipFlag
|
||||
import ru.dbotthepony.mc.otm.item.ItemGravitationalDisruptor
|
||||
import net.minecraft.network.chat.TranslatableComponent
|
||||
import net.minecraft.ChatFormatting
|
||||
import net.minecraft.network.chat.Component
|
||||
@ -11,7 +10,7 @@ import net.minecraft.world.item.Item
|
||||
import net.minecraft.world.item.Rarity
|
||||
import net.minecraft.world.level.Level
|
||||
|
||||
class ItemGravitationalDisruptor :
|
||||
class GravitationalDisruptorItem :
|
||||
Item(Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(1).rarity(Rarity.EPIC)) {
|
||||
override fun appendHoverText(
|
||||
p_41421_: ItemStack,
|
@ -24,7 +24,7 @@ import javax.annotation.ParametersAreNonnullByDefault
|
||||
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
class ItemMatterCapacitor : Item {
|
||||
class MatterCapacitorItem : Item {
|
||||
private inner class ItemMatterCapacitorCapability(private val stack: ItemStack) : ICapabilityProvider, IMatterHandler {
|
||||
private val resolver = LazyOptional.of<IMatterHandler> { this }
|
||||
|
@ -13,7 +13,7 @@ import ru.dbotthepony.mc.otm.matter.IMatterItem
|
||||
import ru.dbotthepony.mc.otm.matter.MatterTuple
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
|
||||
class ItemMatterDust : Item(Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)), IMatterItem {
|
||||
class MatterDustItem : Item(Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)), IMatterItem {
|
||||
private fun matter(stack: ItemStack): ImpreciseFraction {
|
||||
return stack.tag?.get("matter")?.let { return@let ImpreciseFraction.deserializeNBT(it) } ?: return ImpreciseFraction.ZERO
|
||||
}
|
@ -19,7 +19,7 @@ import ru.dbotthepony.mc.otm.capability.matter.*
|
||||
import ru.dbotthepony.mc.otm.ifHas
|
||||
import java.util.*
|
||||
|
||||
class ItemPatternStorage : Item {
|
||||
class PatternStorageItem : Item {
|
||||
val capacity: Int
|
||||
var isCreative: Boolean
|
||||
|
||||
@ -67,7 +67,7 @@ class ItemPatternStorage : Item {
|
||||
private val resolver = LazyOptional.of<IPatternStorage> { this }
|
||||
|
||||
override val capacity: Int get() {
|
||||
return this@ItemPatternStorage.capacity
|
||||
return this@PatternStorageItem.capacity
|
||||
}
|
||||
|
||||
override val stored: Int get() {
|
@ -21,7 +21,7 @@ enum class PillType {
|
||||
BECOME_ANDROID, BECOME_HUMANE, OBLIVION
|
||||
}
|
||||
|
||||
class ItemPillHeal : Item(Properties().stacksTo(64).rarity(Rarity.UNCOMMON).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) {
|
||||
class HealPillItem : Item(Properties().stacksTo(64).rarity(Rarity.UNCOMMON).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) {
|
||||
override fun getUseDuration(p_41454_: ItemStack): Int {
|
||||
return 24
|
||||
}
|
||||
@ -65,7 +65,7 @@ class ItemPillHeal : Item(Properties().stacksTo(64).rarity(Rarity.UNCOMMON).tab(
|
||||
override fun getUseAnimation(p_41452_: ItemStack): UseAnim = UseAnim.EAT
|
||||
}
|
||||
|
||||
class ItemPill(val pillType: PillType) :
|
||||
class PillItem(val pillType: PillType) :
|
||||
Item(Properties().stacksTo(64).rarity(Rarity.UNCOMMON).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) {
|
||||
|
||||
override fun getUseDuration(p_41454_: ItemStack): Int {
|
@ -24,12 +24,11 @@ import net.minecraftforge.event.ForgeEventFactory
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent
|
||||
import ru.dbotthepony.mc.otm.capability.drive.DrivePool
|
||||
import ru.dbotthepony.mc.otm.core.Fraction
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.set
|
||||
import java.util.*
|
||||
|
||||
class ItemPortableCondensationDrive(capacity: Int) :
|
||||
class PortableCondensationDriveItem(capacity: Int) :
|
||||
Item(Properties().stacksTo(1).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) {
|
||||
val capacity: ImpreciseFraction
|
||||
|
||||
@ -216,7 +215,7 @@ class ItemPortableCondensationDrive(capacity: Int) :
|
||||
for (stack in event.player.inventory.items) {
|
||||
val drive = stack.item
|
||||
|
||||
if (drive is ItemPortableCondensationDrive) {
|
||||
if (drive is PortableCondensationDriveItem) {
|
||||
var doBreak = false
|
||||
|
||||
stack.getCapability(MatteryCapability.DRIVE).ifPresent {
|
@ -2,13 +2,11 @@ package ru.dbotthepony.mc.otm.item
|
||||
|
||||
import net.minecraft.client.model.HumanoidModel
|
||||
import net.minecraft.sounds.SoundEvent
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.entity.EquipmentSlot
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
import net.minecraft.world.item.*
|
||||
import net.minecraft.world.item.crafting.Ingredient
|
||||
import net.minecraftforge.client.IItemRenderProperties
|
||||
import net.minecraftforge.common.ForgeTier
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.client.model.GravitationStabilizerModel
|
||||
import java.util.function.Consumer
|
@ -4,7 +4,7 @@ import net.minecraft.world.SimpleContainer
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityAndroidStation
|
||||
import ru.dbotthepony.mc.otm.block.entity.AndroidStationBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.android.IAndroidCapability
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
@ -32,8 +32,8 @@ private class AndroidBatterySlot(container: AndroidStationContainer, index: Int)
|
||||
class AndroidStationMenu @JvmOverloads constructor(
|
||||
containerID: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityAndroidStation? = null
|
||||
) : MenuMatteryPowered(MMenus.ANDROID_STATION, containerID, inventory, tile) {
|
||||
tile: AndroidStationBlockEntity? = null
|
||||
) : MatteryPoweredMenu(MMenus.ANDROID_STATION, containerID, inventory, tile) {
|
||||
val androidBattery: MatterySlot = AndroidBatterySlot(AndroidStationContainer(inventory.player), 0)
|
||||
|
||||
init {
|
@ -3,25 +3,25 @@ package ru.dbotthepony.mc.otm.menu
|
||||
import net.minecraft.world.Container
|
||||
import kotlin.jvm.JvmOverloads
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityBatteryBank
|
||||
import ru.dbotthepony.mc.otm.block.entity.BatteryBankBlockEntity
|
||||
import net.minecraft.world.SimpleContainer
|
||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.orNull
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
|
||||
class MenuBatteryBank @JvmOverloads constructor(
|
||||
class BatteryBankMenu @JvmOverloads constructor(
|
||||
p_38852_: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityBatteryBank? = null,
|
||||
tile: BatteryBankBlockEntity? = null,
|
||||
) : MatteryMenu(MMenus.BATTERY_BANK, p_38852_, inventory, tile) {
|
||||
val powerLevel: LevelGaugeWidget
|
||||
val containerSlots: Array<BatterySlot>
|
||||
|
||||
init {
|
||||
val container: Container = tile?.container ?: SimpleContainer(BlockEntityBatteryBank.CAPACITY)
|
||||
val container: Container = tile?.container ?: SimpleContainer(BatteryBankBlockEntity.CAPACITY)
|
||||
powerLevel = LevelGaugeWidget(this, tile?.getCapability(MatteryCapability.ENERGY)?.orNull())
|
||||
containerSlots = Array(BlockEntityBatteryBank.CAPACITY) {
|
||||
containerSlots = Array(BatteryBankBlockEntity.CAPACITY) {
|
||||
val slot = BatterySlot(container, it)
|
||||
addSlot(slot)
|
||||
return@Array slot
|
||||
@ -35,6 +35,6 @@ class MenuBatteryBank @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun getWorkingSlotEnd(): Int {
|
||||
return BlockEntityBatteryBank.CAPACITY
|
||||
return BatteryBankBlockEntity.CAPACITY
|
||||
}
|
||||
}
|
@ -3,20 +3,20 @@ package ru.dbotthepony.mc.otm.menu
|
||||
import net.minecraft.world.SimpleContainer
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityCargoCrate
|
||||
import ru.dbotthepony.mc.otm.block.entity.CargoCrateBlockEntity
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
|
||||
class MenuCargoCrate @JvmOverloads constructor(
|
||||
class CargoCrateMenu @JvmOverloads constructor(
|
||||
p_38852_: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityCargoCrate? = null
|
||||
tile: CargoCrateBlockEntity? = null
|
||||
) : MatteryMenu(MMenus.CARGO_CRATE, p_38852_, inventory, tile) {
|
||||
val crateSlots: Array<MatterySlot>
|
||||
|
||||
init {
|
||||
val container = tile?.container ?: SimpleContainer(BlockEntityCargoCrate.CAPACITY)
|
||||
val container = tile?.container ?: SimpleContainer(CargoCrateBlockEntity.CAPACITY)
|
||||
|
||||
crateSlots = Array(BlockEntityCargoCrate.CAPACITY) {
|
||||
crateSlots = Array(CargoCrateBlockEntity.CAPACITY) {
|
||||
val slot = MatterySlot(container, it)
|
||||
addSlot(slot)
|
||||
return@Array slot
|
||||
@ -28,7 +28,7 @@ class MenuCargoCrate @JvmOverloads constructor(
|
||||
|
||||
override fun removed(p_38940_: Player) {
|
||||
super.removed(p_38940_)
|
||||
(tile as? BlockEntityCargoCrate)?.onPlayerClose()
|
||||
(tile as? CargoCrateBlockEntity)?.onPlayerClose()
|
||||
}
|
||||
|
||||
override fun getWorkingSlotStart(): Int {
|
||||
@ -36,6 +36,6 @@ class MenuCargoCrate @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun getWorkingSlotEnd(): Int {
|
||||
return BlockEntityCargoCrate.CAPACITY
|
||||
return CargoCrateBlockEntity.CAPACITY
|
||||
}
|
||||
}
|
@ -5,30 +5,30 @@ import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraftforge.common.ForgeHooks
|
||||
import net.minecraftforge.energy.CapabilityEnergy
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityChemicalGenerator
|
||||
import ru.dbotthepony.mc.otm.block.entity.ChemicalGeneratorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.menu.data.IntDataContainer
|
||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
|
||||
class MenuChemicalGenerator @JvmOverloads constructor(id: Int, inv: Inventory, tile: BlockEntityChemicalGenerator? = null)
|
||||
class ChemicalGeneratorMenu @JvmOverloads constructor(id: Int, inv: Inventory, tile: ChemicalGeneratorBlockEntity? = null)
|
||||
: MatteryMenu(MMenus.CHEMICAL_GENERATOR, id, inv, tile) {
|
||||
|
||||
val container = tile?.container ?: SimpleContainer(3)
|
||||
|
||||
val fuelSlot = object : MatterySlot(container, BlockEntityChemicalGenerator.SLOT_INPUT) {
|
||||
val fuelSlot = object : MatterySlot(container, ChemicalGeneratorBlockEntity.SLOT_INPUT) {
|
||||
override fun mayPlace(p_40231_: ItemStack): Boolean {
|
||||
return ForgeHooks.getBurnTime(p_40231_, null) > 0
|
||||
}
|
||||
}
|
||||
|
||||
val residueSlot = object : MatterySlot(container, BlockEntityChemicalGenerator.SLOT_RESIDUE) {
|
||||
val residueSlot = object : MatterySlot(container, ChemicalGeneratorBlockEntity.SLOT_RESIDUE) {
|
||||
override fun mayPlace(p_40231_: ItemStack): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
val batterySlot = object : MatterySlot(container, BlockEntityChemicalGenerator.SLOT_BATTERY) {
|
||||
val batterySlot = object : MatterySlot(container, ChemicalGeneratorBlockEntity.SLOT_BATTERY) {
|
||||
override fun mayPlace(p_40231_: ItemStack): Boolean {
|
||||
return p_40231_.getCapability(CapabilityEnergy.ENERGY).isPresent
|
||||
}
|
||||
@ -49,7 +49,7 @@ class MenuChemicalGenerator @JvmOverloads constructor(id: Int, inv: Inventory, t
|
||||
override fun broadcastChanges() {
|
||||
super.broadcastChanges()
|
||||
progress.updateServer()
|
||||
burnTime.value = (tile as BlockEntityChemicalGenerator).workingTicks
|
||||
burnTime.value = (tile as ChemicalGeneratorBlockEntity).workingTicks
|
||||
}
|
||||
|
||||
override fun getWorkingSlotStart(): Int {
|
@ -2,14 +2,14 @@ package ru.dbotthepony.mc.otm.menu
|
||||
|
||||
import net.minecraft.world.SimpleContainer
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack
|
||||
import ru.dbotthepony.mc.otm.block.entity.DriveRackBlockEntity
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
|
||||
class MenuDriveRack @JvmOverloads constructor(
|
||||
class DriveRackMenu @JvmOverloads constructor(
|
||||
p_38852_: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityDriveRack? = null
|
||||
) : MenuMatteryPowered(MMenus.DRIVE_RACK, p_38852_, inventory, tile) {
|
||||
tile: DriveRackBlockEntity? = null
|
||||
) : MatteryPoweredMenu(MMenus.DRIVE_RACK, p_38852_, inventory, tile) {
|
||||
val drives = arrayOfNulls<MatterySlot>(4)
|
||||
|
||||
init {
|
@ -7,11 +7,11 @@ import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraftforge.energy.CapabilityEnergy
|
||||
import net.minecraftforge.network.NetworkEvent
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveViewer
|
||||
import ru.dbotthepony.mc.otm.block.entity.DriveViewerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive
|
||||
import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive
|
||||
import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive.FilterSettings
|
||||
import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem
|
||||
import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem.FilterSettings
|
||||
import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier
|
||||
import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
@ -19,11 +19,11 @@ import ru.dbotthepony.mc.otm.storage.ItemStackWrapper
|
||||
import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent
|
||||
import java.util.function.Supplier
|
||||
|
||||
class MenuDriveViewer @JvmOverloads constructor(
|
||||
class DriveViewerMenu @JvmOverloads constructor(
|
||||
containerID: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityDriveViewer? = null
|
||||
) : MenuMatteryPowered(
|
||||
tile: DriveViewerBlockEntity? = null
|
||||
) : MatteryPoweredMenu(
|
||||
MMenus.DRIVE_VIEWER, containerID, inventory, tile
|
||||
), INetworkedItemViewSupplier {
|
||||
@JvmField val view: NetworkedItemView
|
||||
@ -63,7 +63,7 @@ class MenuDriveViewer @JvmOverloads constructor(
|
||||
super.broadcastChanges()
|
||||
|
||||
if (tile != null) {
|
||||
val itemStack = (tile as BlockEntityDriveViewer).container.getItem(0)
|
||||
val itemStack = (tile as DriveViewerBlockEntity).container.getItem(0)
|
||||
|
||||
val prev = lastDrive
|
||||
lastDrive = null
|
||||
@ -144,7 +144,7 @@ class MenuDriveViewer @JvmOverloads constructor(
|
||||
return null
|
||||
|
||||
val item = driveSlot.item.item
|
||||
return if (item is ItemPortableCondensationDrive) item.getFilterSettings(driveSlot.item) else null
|
||||
return if (item is PortableCondensationDriveItem) item.getFilterSettings(driveSlot.item) else null
|
||||
}
|
||||
|
||||
class FilterSetPacket(val id: Int, val slot: Int, val value: ItemStack) {
|
||||
@ -167,14 +167,14 @@ class MenuDriveViewer @JvmOverloads constructor(
|
||||
val ply = context.get().sender!!
|
||||
val menu = ply.containerMenu
|
||||
|
||||
if (menu is MenuDriveViewer && menu.containerId == id) {
|
||||
if (menu is DriveViewerMenu && menu.containerId == id) {
|
||||
if (menu.driveSlot.item.isEmpty)
|
||||
return@enqueueWork
|
||||
|
||||
val itemStack = menu.driveSlot.item
|
||||
val item = itemStack.item
|
||||
|
||||
if (item is ItemPortableCondensationDrive) {
|
||||
if (item is PortableCondensationDriveItem) {
|
||||
val filter = item.getFilterSettings(itemStack)
|
||||
filter.items[slot] = value
|
||||
filter.serializeNBT(itemStack)
|
||||
@ -204,7 +204,7 @@ class MenuDriveViewer @JvmOverloads constructor(
|
||||
val ply = context.get().sender!!
|
||||
val menu = ply.containerMenu
|
||||
|
||||
if (menu is MenuDriveViewer && menu.containerId == id) {
|
||||
if (menu is DriveViewerMenu && menu.containerId == id) {
|
||||
val settings = menu.getFilter() ?: return@enqueueWork
|
||||
|
||||
when (type) {
|
@ -4,7 +4,7 @@ import net.minecraft.core.Direction
|
||||
import kotlin.jvm.JvmOverloads
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.level.block.Block
|
||||
import ru.dbotthepony.mc.otm.block.BlockEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.block.EnergyCounterBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.menu.data.EnumDataContainer
|
||||
@ -14,7 +14,7 @@ import ru.dbotthepony.mc.otm.menu.widget.OneWayPlayerInputWidget
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
import java.math.BigDecimal
|
||||
|
||||
class MenuEnergyCounter @JvmOverloads constructor(
|
||||
class EnergyCounterMenu @JvmOverloads constructor(
|
||||
p_38852_: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityEnergyCounter? = null
|
||||
@ -38,7 +38,7 @@ class MenuEnergyCounter @JvmOverloads constructor(
|
||||
maxIO.asClient()
|
||||
} else {
|
||||
switchDirection = OneWayPlayerInputWidget(this) {
|
||||
tile.level?.setBlock(tile.blockPos, tile.blockState.setValue(BlockEnergyCounter.INPUT_DIRECTION, tile.blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION).opposite), Block.UPDATE_ALL)
|
||||
tile.level?.setBlock(tile.blockPos, tile.blockState.setValue(EnergyCounterBlock.INPUT_DIRECTION, tile.blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION).opposite), Block.UPDATE_ALL)
|
||||
}
|
||||
|
||||
maxIO.withSupplier {
|
||||
@ -70,7 +70,7 @@ class MenuEnergyCounter @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
ticksPassed = (ticksPassed + 1) % 20
|
||||
inputDirection.value = tile.blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION)
|
||||
inputDirection.value = tile.blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION)
|
||||
}
|
||||
|
||||
super.broadcastChanges()
|
@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.menu
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityItemMonitor
|
||||
import ru.dbotthepony.mc.otm.block.entity.ItemMonitorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier
|
||||
import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView
|
||||
@ -12,11 +12,11 @@ import ru.dbotthepony.mc.otm.storage.ItemStackWrapper
|
||||
import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent
|
||||
import ru.dbotthepony.mc.otm.storage.VirtualComponent
|
||||
|
||||
class MenuItemMonitor @JvmOverloads constructor(
|
||||
class ItemMonitorMenu @JvmOverloads constructor(
|
||||
p_38852_: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityItemMonitor? = null
|
||||
) : MenuMatteryPowered(MMenus.ITEM_MONITOR, p_38852_, inventory, tile), INetworkedItemViewSupplier {
|
||||
tile: ItemMonitorBlockEntity? = null
|
||||
) : MatteryPoweredMenu(MMenus.ITEM_MONITOR, p_38852_, inventory, tile), INetworkedItemViewSupplier {
|
||||
@JvmField
|
||||
val view = NetworkedItemView(inventory.player, this, tile == null)
|
||||
private val subscribed: VirtualComponent<ItemStackWrapper>?
|
@ -3,20 +3,19 @@ package ru.dbotthepony.mc.otm.menu
|
||||
import net.minecraft.world.SimpleContainer
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterBottler
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterBottlerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterDirection
|
||||
import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputWidget
|
||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.orNull
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
|
||||
class MenuMatterBottler @JvmOverloads constructor(
|
||||
class MatterBottlerMenu @JvmOverloads constructor(
|
||||
p_38852_: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityMatterBottler? = null
|
||||
) : MenuMatteryPowered(
|
||||
tile: MatterBottlerBlockEntity? = null
|
||||
) : MatteryPoweredMenu(
|
||||
MMenus.MATTER_BOTTLER, p_38852_, inventory, tile
|
||||
) {
|
||||
val workFlow: BooleanPlayerInputWidget
|
||||
@ -58,7 +57,7 @@ class MenuMatterBottler @JvmOverloads constructor(
|
||||
|
||||
override fun broadcastChanges() {
|
||||
super.broadcastChanges()
|
||||
workFlow.value = (tile as BlockEntityMatterBottler).workFlow
|
||||
workFlow.value = (tile as MatterBottlerBlockEntity).workFlow
|
||||
}
|
||||
|
||||
override fun getWorkingSlotStart(): Int {
|
@ -2,16 +2,16 @@ package ru.dbotthepony.mc.otm.menu
|
||||
|
||||
import net.minecraft.world.SimpleContainer
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterCapacitorBank
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterCapacitorBankBlockEntity
|
||||
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
|
||||
class MenuMatterCapacitor @JvmOverloads constructor(
|
||||
class MatterCapacitorMenu @JvmOverloads constructor(
|
||||
p_38852_: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityMatterCapacitorBank? = null
|
||||
tile: MatterCapacitorBankBlockEntity? = null
|
||||
) : MatteryMenu(
|
||||
MMenus.MATTER_CAPACITOR_BANK, p_38852_, inventory, tile
|
||||
) {
|
@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.menu
|
||||
|
||||
import kotlin.jvm.JvmOverloads
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterDecomposer
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterDecomposerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||
import net.minecraft.world.SimpleContainer
|
||||
@ -12,11 +12,11 @@ import ru.dbotthepony.mc.otm.matter.canDecompose
|
||||
import ru.dbotthepony.mc.otm.orNull
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
|
||||
class MenuMatterDecomposer @JvmOverloads constructor(
|
||||
class MatterDecomposerMenu @JvmOverloads constructor(
|
||||
containerID: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityMatterDecomposer? = null
|
||||
) : MenuMatteryPowered(MMenus.MATTER_DECOMPOSER, containerID, inventory, tile) {
|
||||
tile: MatterDecomposerBlockEntity? = null
|
||||
) : MatteryPoweredMenu(MMenus.MATTER_DECOMPOSER, containerID, inventory, tile) {
|
||||
val input: MatterySlot
|
||||
val outputMain: MachineOutputSlot
|
||||
val outputStacking: MachineOutputSlot
|
@ -5,7 +5,7 @@ import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraftforge.network.PacketDistributor
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterPanel
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterPanelBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterTask
|
||||
import ru.dbotthepony.mc.otm.capability.matter.PatternState
|
||||
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphListener
|
||||
@ -18,10 +18,10 @@ import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
import java.util.*
|
||||
import java.util.function.Consumer
|
||||
|
||||
class MenuMatterPanel @JvmOverloads constructor(
|
||||
class MatterPanelMenu @JvmOverloads constructor(
|
||||
p_38852_: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityMatterPanel? = null
|
||||
tile: MatterPanelBlockEntity? = null
|
||||
) : MatteryMenu(MMenus.MATTER_PANEL, p_38852_, inventory, tile), IMatterGraphListener {
|
||||
fun taskUpdated(task: MatterTask) {
|
||||
sendNetwork(MatterTaskPacket(true, listOf(task)))
|
||||
@ -97,7 +97,7 @@ class MenuMatterPanel @JvmOverloads constructor(
|
||||
|
||||
// server code
|
||||
fun requestReplication(ply: ServerPlayer, state: PatternState, how_much: Int) {
|
||||
val tile = tile as BlockEntityMatterPanel? ?: return
|
||||
val tile = tile as MatterPanelBlockEntity? ?: return
|
||||
|
||||
val graph = tile.getAsMatterNode().graph as MatterNetworkGraph? ?: return
|
||||
|
||||
@ -110,7 +110,7 @@ class MenuMatterPanel @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun receiveTaskCancel(ply: ServerPlayer, id: UUID) {
|
||||
(tile as BlockEntityMatterPanel?)?.removeTask(id)
|
||||
(tile as MatterPanelBlockEntity?)?.removeTask(id)
|
||||
}
|
||||
|
||||
fun requestTaskCancel(id: UUID) {
|
||||
@ -143,7 +143,7 @@ class MenuMatterPanel @JvmOverloads constructor(
|
||||
|
||||
override fun removed(p_38940_: Player) {
|
||||
super.removed(p_38940_)
|
||||
(tile as BlockEntityMatterPanel?)?.deatachMenu(this)
|
||||
(tile as MatterPanelBlockEntity?)?.deatachMenu(this)
|
||||
listeningGrid?.removeListener(this)
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ class MenuMatterPanel @JvmOverloads constructor(
|
||||
return
|
||||
}
|
||||
|
||||
val tile = tile as BlockEntityMatterPanel?
|
||||
val tile = tile as MatterPanelBlockEntity?
|
||||
|
||||
if (tile != null) {
|
||||
val grid = tile.getAsMatterNode().graph as MatterNetworkGraph?
|
@ -3,17 +3,17 @@ package ru.dbotthepony.mc.otm.menu
|
||||
import net.minecraft.world.SimpleContainer
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterRecycler
|
||||
import ru.dbotthepony.mc.otm.item.ItemMatterDust
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatterRecyclerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.item.MatterDustItem
|
||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||
|
||||
class MenuMatterRecycler @JvmOverloads constructor(
|
||||
class MatterRecyclerMenu @JvmOverloads constructor(
|
||||
containerID: Int,
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityMatterRecycler? = null
|
||||
) : MenuMatteryPowered(MMenus.MATTER_RECYCLER, containerID, inventory, tile) {
|
||||
tile: MatterRecyclerBlockEntity? = null
|
||||
) : MatteryPoweredMenu(MMenus.MATTER_RECYCLER, containerID, inventory, tile) {
|
||||
val input: MatterySlot
|
||||
val progress: ProgressGaugeWidget
|
||||
val matter = LevelGaugeWidget(this, tile?.matter)
|
||||
@ -23,7 +23,7 @@ class MenuMatterRecycler @JvmOverloads constructor(
|
||||
|
||||
input = object : MatterySlot(container, 0) {
|
||||
override fun mayPlace(p_40231_: ItemStack): Boolean {
|
||||
return p_40231_.item is ItemMatterDust && (p_40231_.item as ItemMatterDust).getMatterValue(p_40231_) != null
|
||||
return p_40231_.item is MatterDustItem && (p_40231_.item as MatterDustItem).getMatterValue(p_40231_) != null
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user