Initial re-implementation of Wireless Battery and Battery neon. Fabric needs more work
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package me.hypherionmc.hyperlighting.api;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public interface SwitchModule {
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
package me.hypherionmc.hyperlighting.client.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.hypherionmc.hyperlighting.Constants;
|
||||
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
|
||||
import me.hypherionmc.hyperlighting.common.containers.BatteryNeonContainer;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public class BatteryNeonScreen extends AbstractContainerScreen<BatteryNeonContainer> {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation(Constants.MOD_ID, "textures/gui/neon_light.png");
|
||||
private final Inventory player;
|
||||
private final BatteryNeonBlockEntity te;
|
||||
|
||||
public BatteryNeonScreen(BatteryNeonContainer container, Inventory inventory, Component title) {
|
||||
super(container, inventory, title);
|
||||
this.te = container.getBlockEntity();
|
||||
this.player = inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBg(PoseStack poseStack, float v, int i, int i1) {
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
RenderSystem.setShaderTexture(0, TEXTURE);
|
||||
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
blit(poseStack, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight);
|
||||
blit(poseStack, this.leftPos + 47, this.topPos + 20, 0, 198, (int) (((float) this.te.getEnergyStorage().getPowerLevel() / this.te.getEnergyStorage().getPowerCapacity()) * 110), 16);
|
||||
|
||||
if (this.te.isCharging()) {
|
||||
blit(poseStack, this.leftPos + 26, this.topPos + 38, 185, 17, 4, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderLabels(PoseStack matrixStack, int mouseX, int mouseY) {
|
||||
super.renderLabels(matrixStack, mouseX, mouseY);
|
||||
|
||||
this.drawPowerToolTip(matrixStack, mouseX, mouseY, leftPos + this.menu.slots.get(0).x, topPos + this.menu.slots.get(0).y, 16, 16, ChatFormatting.YELLOW + "Power Slot", "Place a wireless battery", "module in this slot", "linked to a solar panel", "to charge the light");
|
||||
this.drawPowerToolTip(matrixStack, mouseX, mouseY, leftPos + this.menu.slots.get(1).x, topPos + this.menu.slots.get(1).y, 16, 16, ChatFormatting.YELLOW + "Dye Slot", "Place dye here to", "change the color of the", "light");
|
||||
this.drawPowerToolTip(matrixStack, mouseX, mouseY, this.leftPos + 47, this.topPos + 20, 110, 16, ChatFormatting.YELLOW + "Power Level", ChatFormatting.BLUE + "" + (int) (((float) this.te.getEnergyStorage().getPowerLevel() / this.te.getEnergyStorage().getPowerCapacity()) * 100) + "%", (te.isCharging() ? ChatFormatting.GREEN + "Charging" : ChatFormatting.RED + "Not Charging"));
|
||||
}
|
||||
|
||||
private void drawPowerToolTip(PoseStack stack, int mouseX, int mouseY, int startX, int startY, int sizeX, int sizeY, String title, String... description) {
|
||||
int k = (this.width - this.imageWidth) / 2;
|
||||
int l = (this.height - this.imageHeight) / 2;
|
||||
if (mouseX > startX && mouseX < startX + sizeX) {
|
||||
if (mouseY > startY && mouseY < startY + sizeY) {
|
||||
List<Component> list = new ArrayList<>();
|
||||
list.add(Component.translatable(title));
|
||||
for (String desc : description) {
|
||||
list.add(Component.translatable(desc));
|
||||
}
|
||||
renderComponentTooltip(stack, list, mouseX - k, mouseY - l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,15 +1,16 @@
|
||||
package me.hypherionmc.hyperlighting.client.init;
|
||||
|
||||
import me.hypherionmc.craterlib.api.rendering.CustomRenderType;
|
||||
import me.hypherionmc.craterlib.client.events.ColorRegistrationEvent;
|
||||
import me.hypherionmc.craterlib.client.registry.ClientRegistry;
|
||||
import me.hypherionmc.craterlib.events.CraterEventBus;
|
||||
import me.hypherionmc.craterlib.platform.Services;
|
||||
import me.hypherionmc.craterlib.platform.Platform;
|
||||
import me.hypherionmc.hyperlighting.client.gui.BatteryNeonScreen;
|
||||
import me.hypherionmc.hyperlighting.common.init.HLBlocks;
|
||||
import me.hypherionmc.hyperlighting.common.init.HLContainers;
|
||||
import me.hypherionmc.hyperlighting.common.init.HLItems;
|
||||
import me.hypherionmc.hyperlighting.common.init.HLPackets;
|
||||
import me.hypherionmc.hyperlighting.integration.HyperLightingIntegrations;
|
||||
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
|
||||
import me.hypherionmc.hyperlighting.mixin.access.MenuScreensAccess;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
@@ -18,8 +19,11 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
|
||||
public class ClientRegistration {
|
||||
|
||||
public void registerAll() {
|
||||
Services.CLIENT_HELPER.registerCustomRenderTypes(HLBlocks.BLOCKS.getEntries(), HLItems.ITEMS.getEntries());
|
||||
Platform.CLIENT_HELPER.registerCustomRenderTypes(HLBlocks.BLOCKS.getEntries(), HLItems.ITEMS.getEntries());
|
||||
HyperLightingIntegrations.registerClient();
|
||||
MenuScreensAccess.crater_register(HLContainers.BATTERY_NEON.get(), BatteryNeonScreen::new);
|
||||
|
||||
HLPackets.registerClient();
|
||||
}
|
||||
|
||||
public void registerEvents() {
|
||||
|
@@ -0,0 +1,100 @@
|
||||
package me.hypherionmc.hyperlighting.common.blockentities;
|
||||
|
||||
import me.hypherionmc.craterlib.api.blockentities.ITickable;
|
||||
import me.hypherionmc.craterlib.common.blockentity.CraterBlockEntity;
|
||||
import me.hypherionmc.craterlib.systems.SimpleInventory;
|
||||
import me.hypherionmc.craterlib.systems.energy.CustomEnergyStorage;
|
||||
import me.hypherionmc.hyperlighting.common.blocks.BatteryNeon;
|
||||
import me.hypherionmc.hyperlighting.common.init.HLBlockEntities;
|
||||
import me.hypherionmc.hyperlighting.common.items.WirelessBattery;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public class BatteryNeonBlockEntity extends CraterBlockEntity implements ITickable {
|
||||
|
||||
private final CustomEnergyStorage energyStorage = new CustomEnergyStorage(500, 20, 0);
|
||||
private final SimpleInventory inventory = new SimpleInventory(2, 1);
|
||||
|
||||
private boolean isCharging = false;
|
||||
|
||||
public BatteryNeonBlockEntity(BlockPos pos, BlockState state) {
|
||||
super(HLBlockEntities.BATTERY_NEON.get(), pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void saveAdditional(CompoundTag tag) {
|
||||
super.saveAdditional(tag);
|
||||
tag.putBoolean("isCharging", isCharging);
|
||||
energyStorage.writeNBT(tag);
|
||||
inventory.writeNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(CompoundTag tag) {
|
||||
super.load(tag);
|
||||
this.isCharging = tag.getBoolean("isCharging");
|
||||
this.energyStorage.readNBT(tag);
|
||||
inventory.clearContent();
|
||||
inventory.readNBT(tag);
|
||||
}
|
||||
|
||||
public boolean isCharging() {
|
||||
return isCharging;
|
||||
}
|
||||
|
||||
public CustomEnergyStorage getEnergyStorage() {
|
||||
return energyStorage;
|
||||
}
|
||||
|
||||
public SimpleInventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdates() {
|
||||
BlockState state = level.getBlockState(this.getBlockPos());
|
||||
this.level.blockEntityChanged(this.getBlockPos());
|
||||
this.level.sendBlockUpdated(this.getBlockPos(), this.level.getBlockState(this.getBlockPos()), state, 3);
|
||||
this.setChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(Level level, BlockPos blockPos, BlockState blockState, BlockEntity blockEntity) {
|
||||
if (level.getGameTime() % 20L == 0L) {
|
||||
ItemStack stack = inventory.getItemHandler().getItem(0);
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof WirelessBattery battery) {
|
||||
if (battery.isLinked(stack, level)) {
|
||||
BlockPos pos = battery.getLinkedPos(stack);
|
||||
|
||||
if (level.getBlockEntity(pos) instanceof SolarPanelBlockEntity solarPanel) {
|
||||
CustomEnergyStorage storage = solarPanel.getEnergyStorage();
|
||||
|
||||
if (storage.extractEnergy(20, true) > 0 && this.energyStorage.receiveEnergy(20, true) > 0) {
|
||||
this.isCharging = true;
|
||||
storage.extractEnergy(this.energyStorage.receiveEnergy(20, false), false);
|
||||
} else {
|
||||
this.isCharging = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isCharging = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (level.getGameTime() % 40L == 0L) {
|
||||
if (level.getBlockState(blockPos).getValue(BatteryNeon.LIT)) {
|
||||
this.energyStorage.extractEnergy(1, false);
|
||||
}
|
||||
}
|
||||
this.sendUpdates();
|
||||
}
|
||||
}
|
@@ -66,4 +66,8 @@ public class SolarPanelBlockEntity extends CraterBlockEntity implements ITickabl
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
public CustomEnergyStorage getEnergyStorage() {
|
||||
return energyStorage;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,181 @@
|
||||
package me.hypherionmc.hyperlighting.common.blocks;
|
||||
|
||||
import me.hypherionmc.craterlib.api.rendering.DyableBlock;
|
||||
import me.hypherionmc.craterlib.common.item.BlockItemDyable;
|
||||
import me.hypherionmc.craterlib.util.BlockStateUtils;
|
||||
import me.hypherionmc.hyperlighting.Constants;
|
||||
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
|
||||
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
|
||||
import me.hypherionmc.hyperlighting.common.init.HLItems;
|
||||
import me.hypherionmc.hyperlighting.network.OpenGuiPacket;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.color.block.BlockColor;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.BaseEntityBlock;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.RenderShape;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
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 net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public class BatteryNeon extends BaseEntityBlock implements DyableBlock {
|
||||
|
||||
public static final BooleanProperty LIT = BlockStateProperties.LIT;
|
||||
public static final DirectionProperty FACING = BlockStateProperties.FACING;
|
||||
|
||||
private static final VoxelShape DOWN_BOUNDING_BOX = Block.box(0, 0, 7.008, 16, 3.008, 8.992);
|
||||
private static final VoxelShape UP_BOUNDING_BOX = Block.box(0, 12.8, 7.008, 16, 16, 8.992);
|
||||
private static final VoxelShape SOUTH_BOUNDING_BOX = Block.box(0, 7.008, 12.992, 16, 8.992, 16);
|
||||
private static final VoxelShape EAST_BOUNDING_BOX = Block.box(0, 7.008, 16, 12.8, 8.992, 16);
|
||||
private static final VoxelShape WEST_BOUNDING_BOX = Block.box(0, 7.008, 0, 3.2, 8.992, 16);
|
||||
private static final VoxelShape NORTH_BOUNDING_BOX = Block.box(0, 7.008, 0.336, 16, 8.992, 3.328);
|
||||
|
||||
public BatteryNeon(String name) {
|
||||
super(Properties.of(Material.GLASS).sound(SoundType.GLASS).lightLevel(BlockStateUtils.createLightLevelFromLitBlockState(14)));
|
||||
this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH));
|
||||
|
||||
HLItems.ITEMS.register(name, () -> new BlockItemDyable(this, new Item.Properties().tab(CommonRegistration.LIGHTS_TAB)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
|
||||
switch (state.getValue(FACING)) {
|
||||
case UP:
|
||||
return DOWN_BOUNDING_BOX;
|
||||
case DOWN:
|
||||
default:
|
||||
return UP_BOUNDING_BOX;
|
||||
case NORTH:
|
||||
return SOUTH_BOUNDING_BOX;
|
||||
case EAST:
|
||||
return WEST_BOUNDING_BOX;
|
||||
case WEST:
|
||||
return EAST_BOUNDING_BOX;
|
||||
case SOUTH:
|
||||
return NORTH_BOUNDING_BOX;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
||||
if (worldIn.isClientSide) {
|
||||
if (Screen.hasControlDown()) {
|
||||
OpenGuiPacket openGUIPacket = new OpenGuiPacket(11, pos);
|
||||
CommonRegistration.networkHandler.sendToServer(openGUIPacket);
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
} else {
|
||||
if (state.getValue(LIT)) {
|
||||
sendBlockUpdate(state, pos, worldIn, false);
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
if (worldIn.getBlockEntity(pos) != null && worldIn.getBlockEntity(pos) instanceof BatteryNeonBlockEntity be && be.getEnergyStorage().getPowerLevel() > 0) {
|
||||
sendBlockUpdate(state, pos, worldIn, true);
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
sendBlockUpdate(state, pos, worldIn, false);
|
||||
player.displayClientMessage(Component.literal("Out of power"), true);
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
builder.add(LIT, FACING);
|
||||
super.createBlockStateDefinition(builder);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||
return this.defaultBlockState().setValue(FACING, context.getClickedFace()).setValue(LIT, false);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public RenderShape getRenderShape(BlockState state) {
|
||||
return RenderShape.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockColor dyeHandler() {
|
||||
return (state, world, pos, tintIndex) -> {
|
||||
if (state.getValue(LIT)) {
|
||||
if (world != null && world.getBlockEntity(pos) instanceof BatteryNeonBlockEntity be) {
|
||||
return (be.getInventory().getItemHandler().getItem(1).getItem() instanceof DyeItem dyeItem ? dyeItem.getDyeColor().getMaterialColor().col : DyeColor.WHITE.getTextColor());
|
||||
}
|
||||
} else {
|
||||
return DyeColor.BLACK.getMaterialColor().col;
|
||||
}
|
||||
return DyeColor.BLACK.getMaterialColor().col;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public DyeColor defaultDyeColor() {
|
||||
return DyeColor.WHITE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, @Nullable BlockGetter worldIn, List<Component> tooltip, TooltipFlag flagIn) {
|
||||
tooltip.add(Component.literal(ChatFormatting.YELLOW + "Dyable"));
|
||||
tooltip.add(Component.literal(ChatFormatting.GREEN + "Color: " + defaultDyeColor().name()));
|
||||
tooltip.add(Component.literal(ChatFormatting.BLUE + "Colored Lighting Supported"));
|
||||
super.appendHoverText(stack, worldIn, tooltip, flagIn);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new BatteryNeonBlockEntity(pos, state);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState p_153213_, BlockEntityType<T> p_153214_) {
|
||||
return (level1, blockPos, blockState, t) -> {
|
||||
if (!level.isClientSide()) {
|
||||
if (t instanceof BatteryNeonBlockEntity tile) {
|
||||
tile.tick(level1, blockPos, blockState, tile);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void sendBlockUpdate(BlockState state, BlockPos pos, Level worldIn, boolean litState) {
|
||||
BlockState oldState = state;
|
||||
state = state.setValue(LIT, litState);
|
||||
worldIn.setBlock(pos, state, 2);
|
||||
worldIn.sendBlockUpdated(pos, oldState, state, 4);
|
||||
}
|
||||
}
|
@@ -0,0 +1,109 @@
|
||||
package me.hypherionmc.hyperlighting.common.containers;
|
||||
|
||||
import me.hypherionmc.craterlib.systems.SimpleInventory;
|
||||
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
|
||||
import me.hypherionmc.hyperlighting.common.init.HLContainers;
|
||||
import me.hypherionmc.hyperlighting.common.items.WirelessBattery;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.SimpleContainerData;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.DyeItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public class BatteryNeonContainer extends AbstractContainerMenu {
|
||||
|
||||
private final BatteryNeonBlockEntity blockEntity;
|
||||
|
||||
public BatteryNeonContainer(int windowID, Inventory inventory, FriendlyByteBuf buf) {
|
||||
this(windowID, inventory.player.level, buf.readBlockPos(), inventory);
|
||||
}
|
||||
|
||||
public BatteryNeonContainer(int windowID, Level level, BlockPos pos, Inventory inventory) {
|
||||
super(HLContainers.BATTERY_NEON.get(), windowID);
|
||||
this.blockEntity = (BatteryNeonBlockEntity) level.getBlockEntity(pos);
|
||||
Container inventory1 = blockEntity.getInventory().getItemHandler();
|
||||
|
||||
this.addSlot(new Slot(inventory1, 0, 27, 20));
|
||||
this.addSlot(new Slot(inventory1, 1, 7, 20));
|
||||
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 9; x++) {
|
||||
this.addSlot(new Slot(inventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int x = 0; x < 9; x++) {
|
||||
this.addSlot(new Slot(inventory, x, 8 + x * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stillValid(Player playerIn) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void broadcastChanges() {
|
||||
super.broadcastChanges();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack quickMoveStack(Player playerIn, int index) {
|
||||
ItemStack itemstack = ItemStack.EMPTY;
|
||||
Slot slot = this.slots.get(index);
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
itemstack = itemstack1.copy();
|
||||
|
||||
if (index == 0) {
|
||||
if (!this.moveItemStackTo(itemstack1, 1, 38, true)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
slot.onQuickCraft(itemstack1, itemstack);
|
||||
} if (index == 1) {
|
||||
if (!this.moveItemStackTo(itemstack1, 2, 38, true)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
slot.onQuickCraft(itemstack1, itemstack);
|
||||
} else {
|
||||
if (itemstack1.getItem() instanceof DyeItem) {
|
||||
if (!this.moveItemStackTo(itemstack1, 0, 1, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
} else if (itemstack1.getItem() instanceof WirelessBattery) {
|
||||
if (!this.moveItemStackTo(itemstack1, 1, 2, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
slot.set(ItemStack.EMPTY);
|
||||
} else {
|
||||
slot.setChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.getCount() == itemstack.getCount()) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
slot.onTake(playerIn, itemstack1);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
public BatteryNeonBlockEntity getBlockEntity() {
|
||||
return blockEntity;
|
||||
}
|
||||
}
|
@@ -1,6 +1,9 @@
|
||||
package me.hypherionmc.hyperlighting.common.init;
|
||||
|
||||
import me.hypherionmc.craterlib.client.gui.tabs.CreativeTabBuilder;
|
||||
import me.hypherionmc.craterlib.network.CraterNetworkHandler;
|
||||
import me.hypherionmc.craterlib.platform.Platform;
|
||||
import me.hypherionmc.hyperlighting.Constants;
|
||||
import me.hypherionmc.hyperlighting.client.config.HyperLightingClientConfig;
|
||||
import me.hypherionmc.hyperlighting.integration.HyperLightingIntegrations;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
@@ -14,6 +17,7 @@ public class CommonRegistration {
|
||||
public static final CreativeModeTab LIGHTS_TAB = CreativeTabBuilder.builder(MOD_ID, "lighting").setIcon(() -> new ItemStack(HLBlocks.ADVANCED_LANTERN)).build();
|
||||
public static final CreativeModeTab MACHINES_TAB = CreativeTabBuilder.builder(MOD_ID, "machines").setIcon(() -> new ItemStack(HLBlocks.ADVANCED_TORCH)).build();
|
||||
|
||||
public static CraterNetworkHandler networkHandler = Platform.COMMON_HELPER.createPacketHandler(MOD_ID);
|
||||
|
||||
public static void registerAll() {
|
||||
HLSounds.loadAll();
|
||||
@@ -22,7 +26,9 @@ public class CommonRegistration {
|
||||
HLItems.loadAll();
|
||||
HLBlockEntities.loadAll();
|
||||
HLEntities.loadAll();
|
||||
HLContainers.loadAll();
|
||||
HyperLightingIntegrations.registerCommon();
|
||||
HLPackets.registerServer();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
|
||||
import me.hypherionmc.craterlib.systems.reg.RegistryObject;
|
||||
import me.hypherionmc.hyperlighting.Constants;
|
||||
import me.hypherionmc.hyperlighting.common.blockentities.AdvancedCampfireBlockEntity;
|
||||
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
|
||||
import me.hypherionmc.hyperlighting.common.blockentities.SolarPanelBlockEntity;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
@@ -20,5 +21,7 @@ public class HLBlockEntities {
|
||||
|
||||
public static RegistryObject<BlockEntityType<SolarPanelBlockEntity>> SOLAR_PANEL = BE.register("solar_panel", () -> BlockEntityType.Builder.of(SolarPanelBlockEntity::new, HLBlocks.SOLAR_PANEL.get()).build(null));
|
||||
|
||||
public static RegistryObject<BlockEntityType<BatteryNeonBlockEntity>> BATTERY_NEON = BE.register("battery_neon", () -> BlockEntityType.Builder.of(BatteryNeonBlockEntity::new, HLBlocks.BATTERY_NEON.get()).build(null));
|
||||
|
||||
public static void loadAll() {}
|
||||
}
|
||||
|
@@ -30,6 +30,9 @@ public class HLBlocks {
|
||||
/* Machines */
|
||||
public static BlockRegistryObject<Block> SOLAR_PANEL = register("solar_panel", () -> new SolarPanel("solar_panel"));
|
||||
|
||||
/* Other */
|
||||
public static BlockRegistryObject<Block> BATTERY_NEON = register("battery_neon", () -> new BatteryNeon("battery_neon"));
|
||||
|
||||
|
||||
public static void loadAll() {}
|
||||
|
||||
|
@@ -0,0 +1,27 @@
|
||||
package me.hypherionmc.hyperlighting.common.init;
|
||||
|
||||
import me.hypherionmc.craterlib.platform.Platform;
|
||||
import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
|
||||
import me.hypherionmc.craterlib.systems.reg.RegistryObject;
|
||||
import me.hypherionmc.hyperlighting.Constants;
|
||||
import me.hypherionmc.hyperlighting.common.containers.BatteryNeonContainer;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public class HLContainers {
|
||||
|
||||
public static RegistrationProvider<MenuType<?>> CONTAINERS = RegistrationProvider.get(Registry.MENU, Constants.MOD_ID);
|
||||
|
||||
public static final RegistryObject<MenuType<BatteryNeonContainer>> BATTERY_NEON = register("battery_neon", Platform.COMMON_HELPER.createMenuType(BatteryNeonContainer::new));
|
||||
|
||||
public static <T extends AbstractContainerMenu> RegistryObject<MenuType<T>> register(String key, MenuType<T> builder) {
|
||||
return CONTAINERS.register(key, () -> builder);
|
||||
}
|
||||
|
||||
public static void loadAll() {}
|
||||
}
|
@@ -4,6 +4,7 @@ import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
|
||||
import me.hypherionmc.craterlib.systems.reg.RegistryObject;
|
||||
import me.hypherionmc.hyperlighting.Constants;
|
||||
import me.hypherionmc.hyperlighting.common.items.LighterTool;
|
||||
import me.hypherionmc.hyperlighting.common.items.WirelessBattery;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
@@ -15,6 +16,9 @@ public class HLItems {
|
||||
/* Tools */
|
||||
public static RegistryObject<Item> TORCH_TOOL = register("lighter_tool", LighterTool::new);
|
||||
|
||||
/* Machines */
|
||||
public static RegistryObject<Item> WIRELESS_BATTERY = register("wireless_battery", WirelessBattery::new);
|
||||
|
||||
public static void loadAll() {}
|
||||
|
||||
public static <T extends Item> RegistryObject<T> register(String name, Supplier<? extends T> item) {
|
||||
|
@@ -0,0 +1,20 @@
|
||||
package me.hypherionmc.hyperlighting.common.init;
|
||||
|
||||
import me.hypherionmc.craterlib.network.PacketDirection;
|
||||
import me.hypherionmc.hyperlighting.network.OpenGuiPacket;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public class HLPackets {
|
||||
|
||||
public static void registerServer() {
|
||||
CommonRegistration.networkHandler.registerPacket(OpenGuiPacket.class, OpenGuiPacket::new, PacketDirection.TO_SERVER);
|
||||
}
|
||||
|
||||
public static void registerClient() {
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,78 @@
|
||||
package me.hypherionmc.hyperlighting.common.items;
|
||||
|
||||
import me.hypherionmc.hyperlighting.api.SwitchModule;
|
||||
import me.hypherionmc.hyperlighting.common.blocks.SolarPanel;
|
||||
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public class WirelessBattery extends Item implements SwitchModule {
|
||||
|
||||
public WirelessBattery() {
|
||||
super(new Properties().tab(CommonRegistration.MACHINES_TAB).stacksTo(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCraftedBy(ItemStack stack, Level level, Player player) {
|
||||
super.onCraftedBy(stack, level, player);
|
||||
if (!stack.hasTag()) {
|
||||
stack.setTag(new CompoundTag());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InteractionResult useOn(UseOnContext context) {
|
||||
Level level = context.getLevel();
|
||||
Player player = context.getPlayer();
|
||||
BlockPos pos = context.getClickedPos();
|
||||
InteractionHand hand = context.getHand();
|
||||
|
||||
if (!level.isClientSide()) {
|
||||
if (player.getItemInHand(hand).getItem() instanceof WirelessBattery) {
|
||||
ItemStack stack = player.getItemInHand(hand);
|
||||
CompoundTag tag = stack.getOrCreateTag();
|
||||
tag.put("linked_pos", NbtUtils.writeBlockPos(pos));
|
||||
stack.setTag(tag);
|
||||
player.displayClientMessage(Component.literal("Linked to " + pos), false);
|
||||
} else {
|
||||
ItemStack stack = player.getItemInHand(hand);
|
||||
if (isLinked(stack, level)) {
|
||||
player.displayClientMessage(Component.literal("Linked to block " + getLinkedPos(stack)), false);
|
||||
} else {
|
||||
player.displayClientMessage(Component.literal("Not linked"), false);
|
||||
}
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
}
|
||||
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
public boolean isLinked(ItemStack stack, Level level) {
|
||||
CompoundTag compound = stack.getOrCreateTag();
|
||||
if (compound.getCompound("linked_pos") != null && stack.getItem() instanceof WirelessBattery) {
|
||||
BlockPos pos = getLinkedPos(stack);
|
||||
return level.getBlockState(pos).getBlock() instanceof SolarPanel;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public BlockPos getLinkedPos(ItemStack stack) {
|
||||
CompoundTag compound = stack.getOrCreateTag();
|
||||
return NbtUtils.readBlockPos(compound.getCompound("linked_pos"));
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
package me.hypherionmc.hyperlighting.integration;
|
||||
|
||||
import me.hypherionmc.craterlib.platform.Services;
|
||||
import me.hypherionmc.craterlib.platform.Platform;
|
||||
import me.hypherionmc.hyperlighting.integration.shimmer.HyperLightingShimmer;
|
||||
|
||||
/**
|
||||
@@ -14,7 +14,7 @@ public class HyperLightingIntegrations {
|
||||
}
|
||||
|
||||
public static void registerClient() {
|
||||
if (Services.PLATFORM.isModLoaded("shimmer")) {
|
||||
if (Platform.LOADER.isModLoaded("shimmer")) {
|
||||
HyperLightingShimmer.registerAll();
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,23 @@
|
||||
package me.hypherionmc.hyperlighting.mixin.access;
|
||||
|
||||
import net.minecraft.client.gui.screens.MenuScreens;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.screens.inventory.MenuAccess;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
@Mixin(MenuScreens.class)
|
||||
public interface MenuScreensAccess {
|
||||
|
||||
@Invoker("register")
|
||||
static <M extends AbstractContainerMenu, U extends Screen & MenuAccess<M>> void crater_register(MenuType<? extends M> p_216911_0_, MenuScreens.ScreenConstructor<M, U> p_216911_1_) {
|
||||
throw new Error("Mixin did not apply!");
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package me.hypherionmc.hyperlighting.mixin.access;
|
||||
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
@Mixin(MenuType.class)
|
||||
public interface MenuTypeAccess {
|
||||
|
||||
@Invoker("<init>")
|
||||
static <T extends AbstractContainerMenu> MenuType<T> crater_create(MenuType.MenuSupplier<T> menuSupplier) {
|
||||
throw new Error("Mixin did not apply!");
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,78 @@
|
||||
package me.hypherionmc.hyperlighting.network;
|
||||
|
||||
import me.hypherionmc.craterlib.network.CraterPacket;
|
||||
import me.hypherionmc.craterlib.platform.Platform;
|
||||
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
|
||||
import me.hypherionmc.hyperlighting.common.containers.BatteryNeonContainer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.MenuProvider;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 24/09/2022
|
||||
*/
|
||||
public class OpenGuiPacket implements CraterPacket<OpenGuiPacket> {
|
||||
|
||||
private BlockPos posToSet;
|
||||
private int guiid;
|
||||
|
||||
public OpenGuiPacket() {}
|
||||
|
||||
public OpenGuiPacket(int id, BlockPos pos) {
|
||||
this.posToSet = pos;
|
||||
this.guiid = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(FriendlyByteBuf friendlyByteBuf) {
|
||||
friendlyByteBuf.writeBlockPos(posToSet);
|
||||
friendlyByteBuf.writeInt(guiid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(FriendlyByteBuf friendlyByteBuf) {
|
||||
this.posToSet = friendlyByteBuf.readBlockPos();
|
||||
this.guiid = friendlyByteBuf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketHandler createHandler() {
|
||||
return new PacketHandler() {
|
||||
@Override
|
||||
public void handle(CraterPacket packet, Player player, Object o) {
|
||||
BlockEntity be = player.level.getBlockEntity(posToSet);
|
||||
|
||||
MenuProvider containerProvider = new MenuProvider() {
|
||||
@Override
|
||||
public Component getDisplayName() {
|
||||
if (be instanceof BatteryNeonBlockEntity) {
|
||||
return Component.translatable("block.hyperlighting.battery_neon");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public AbstractContainerMenu createMenu(int i, Inventory inventory, Player player) {
|
||||
if (be instanceof BatteryNeonBlockEntity) {
|
||||
return new BatteryNeonContainer(i, player.level, posToSet, inventory);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
if (containerProvider.getDisplayName() != null) {
|
||||
Platform.COMMON_HELPER.openMenu((ServerPlayer) player, containerProvider, buf -> buf.writeBlockPos(posToSet));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"variants": {
|
||||
"facing=up,lit=true": { "model": "hyperlighting:block/solar_neon", "uvlock": true },
|
||||
"facing=down,lit=true": { "model": "hyperlighting:block/solar_neon", "uvlock": true, "x": 180 },
|
||||
"facing=east,lit=true": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "y": 270 },
|
||||
"facing=west,lit=true": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "y": 90 },
|
||||
"facing=south,lit=true": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true },
|
||||
"facing=north,lit=true": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "x": 180 },
|
||||
"facing=up,lit=false": { "model": "hyperlighting:block/solar_neon", "uvlock": true },
|
||||
"facing=down,lit=false": { "model": "hyperlighting:block/solar_neon", "uvlock": true, "x": 180 },
|
||||
"facing=east,lit=false": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "y": 270 },
|
||||
"facing=west,lit=false": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "y": 90 },
|
||||
"facing=south,lit=false": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true },
|
||||
"facing=north,lit=false": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "x": 180 }
|
||||
}
|
||||
}
|
@@ -4,8 +4,10 @@
|
||||
"block.hyperlighting.advanced_candle": "Advanced Candle (%s)",
|
||||
"block.hyperlighting.advanced_campfire": "Advanced Campfire (%s)",
|
||||
"block.hyperlighting.solar_panel": "Solar Panel",
|
||||
"block.hyperlighting.battery_neon": "Battery Fluorescent Light",
|
||||
|
||||
"item.hyperlighting.lighter_tool": "Torch Lighter Tool",
|
||||
"item.hyperlighting.wireless_battery": "Wireless Battery",
|
||||
|
||||
"subtitles.torch_ignite": "Flame Ignite Sound",
|
||||
|
||||
|
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"credit": "Made with Blockbench",
|
||||
"textures": {
|
||||
"0": "hyperlighting:block/metal_base_disco_ball",
|
||||
"2": "hyperlighting:block/dmx_top_on",
|
||||
"particle": "hyperlighting:block/metal_base_disco_ball"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [14, 0.05, 7],
|
||||
"to": [16, 3.05, 9],
|
||||
"rotation": {"angle": 0, "axis": "x", "origin": [8, 1.25, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 3, 4], "texture": "#0"},
|
||||
"east": {"uv": [0, 0, 3, 4], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 3, 4], "texture": "#0"},
|
||||
"west": {"uv": [0, 0, 3, 4], "texture": "#0"},
|
||||
"up": {"uv": [0, 0, 3, 3], "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 3, 3], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [0, 0.05, 7],
|
||||
"to": [2, 3.05, 9],
|
||||
"rotation": {"angle": 0, "axis": "x", "origin": [8, 1.25, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 3, 4], "texture": "#0"},
|
||||
"east": {"uv": [0, 0, 3, 4], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 3, 4], "texture": "#0"},
|
||||
"west": {"uv": [0, 0, 3, 4], "texture": "#0"},
|
||||
"up": {"uv": [0, 0, 3, 3], "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 3, 3], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [2, 1.05, 7],
|
||||
"to": [14, 3.05, 9],
|
||||
"rotation": {"angle": 0, "axis": "x", "origin": [8, 1.25, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0},
|
||||
"east": {"uv": [0, 0, 2, 2], "texture": "#2", "tintindex": 0},
|
||||
"south": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0},
|
||||
"west": {"uv": [0, 0, 2, 2], "texture": "#2", "tintindex": 0},
|
||||
"up": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0},
|
||||
"down": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0}
|
||||
}
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"name": "group",
|
||||
"origin": [10, 9, 15],
|
||||
"children": [0, 1, 2]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"credit": "Made with Blockbench",
|
||||
"textures": {
|
||||
"0": "hyperlighting:block/metal_base_disco_ball",
|
||||
"2": "hyperlighting:block/dmx_top_on",
|
||||
"particle": "hyperlighting:block/metal_base_disco_ball"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [14, 7, 0.05],
|
||||
"to": [16, 9, 3.05],
|
||||
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 1.25]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 3, 3], "rotation": 180, "texture": "#0"},
|
||||
"east": {"uv": [0, 0, 3, 4], "rotation": 270, "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 3, 3], "texture": "#0"},
|
||||
"west": {"uv": [0, 0, 3, 4], "rotation": 90, "texture": "#0"},
|
||||
"up": {"uv": [0, 0, 3, 4], "rotation": 180, "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 3, 4], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [0, 7, 0.05],
|
||||
"to": [2, 9, 3.05],
|
||||
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 1.25]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 3, 3], "rotation": 180, "texture": "#0"},
|
||||
"east": {"uv": [0, 0, 3, 4], "rotation": 270, "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 3, 3], "texture": "#0"},
|
||||
"west": {"uv": [0, 0, 3, 4], "rotation": 90, "texture": "#0"},
|
||||
"up": {"uv": [0, 0, 3, 4], "rotation": 180, "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 3, 4], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [2, 7, 1.05],
|
||||
"to": [14, 9, 3.05],
|
||||
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 1.25]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 12, 2], "rotation": 180, "texture": "#2", "tintindex": 0},
|
||||
"east": {"uv": [0, 0, 2, 2], "rotation": 270, "texture": "#2", "tintindex": 0},
|
||||
"south": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0},
|
||||
"west": {"uv": [0, 0, 2, 2], "rotation": 90, "texture": "#2", "tintindex": 0},
|
||||
"up": {"uv": [0, 0, 12, 2], "rotation": 180, "texture": "#2", "tintindex": 0},
|
||||
"down": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0}
|
||||
}
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"name": "group",
|
||||
"origin": [10, 9, 15],
|
||||
"children": [0, 1, 2]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "hyperlighting:block/solar_neon"
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "hyperlighting:item/battery"
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 441 B |
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 376 B |
@@ -2,4 +2,6 @@ accessWidener v1 named
|
||||
|
||||
accessible class net/minecraft/client/particle/ParticleEngine$SpriteParticleRegistration
|
||||
accessible method net/minecraft/world/entity/SpawnPlacements register (Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/entity/SpawnPlacements$Type;Lnet/minecraft/world/level/levelgen/Heightmap$Types;Lnet/minecraft/world/entity/SpawnPlacements$SpawnPredicate;)V
|
||||
Accessible class net/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier
|
||||
accessible class net/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier
|
||||
accessible class net/minecraft/world/inventory/MenuType$MenuSupplier
|
||||
Accessible class net/minecraft/client/gui/screens/MenuScreens$ScreenConstructor
|
||||
|
@@ -4,8 +4,10 @@
|
||||
"package": "me.hypherionmc.hyperlighting.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"access.MenuTypeAccess"
|
||||
],
|
||||
"client": [
|
||||
"access.MenuScreensAccess"
|
||||
],
|
||||
"server": [
|
||||
],
|
||||
|
@@ -13,7 +13,6 @@ import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
|
||||
import net.minecraft.client.particle.ParticleEngine;
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
import net.minecraft.core.particles.ParticleType;
|
||||
|
||||
|
2
Forge/src/main/resources/META-INF/accesstransformer.cfg
Normal file
2
Forge/src/main/resources/META-INF/accesstransformer.cfg
Normal file
@@ -0,0 +1,2 @@
|
||||
public net.minecraft.world.inventory.MenuType$MenuSupplier
|
||||
public net.minecraft.client.gui.screens.MenuScreens$ScreenConstructor
|
@@ -12,7 +12,7 @@ common_server_run_name=Common Server
|
||||
|
||||
# Forge
|
||||
forge_version=43.1.25
|
||||
//forge_ats_enabled=true
|
||||
forge_ats_enabled=true
|
||||
|
||||
# Fabric
|
||||
fabric_version=0.61.0+1.19.2
|
||||
@@ -28,7 +28,7 @@ org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
|
||||
#dependencies
|
||||
craterlib_version=0.0.3d
|
||||
craterlib_version=0.0.4d
|
||||
mod_menu_version=4.0.6
|
||||
shimmer_version=0.1.12
|
||||
sodium_version=3957319
|
||||
|
Reference in New Issue
Block a user