diff --git a/src/main/java/net/banutama/utamacraft/CCRegistration.java b/src/main/java/net/banutama/utamacraft/CCRegistration.java index cc56408..34dc4d4 100644 --- a/src/main/java/net/banutama/utamacraft/CCRegistration.java +++ b/src/main/java/net/banutama/utamacraft/CCRegistration.java @@ -1,6 +1,5 @@ package net.banutama.utamacraft; -import com.mojang.logging.LogUtils; import dan200.computercraft.api.ForgeComputerCraftAPI; import dan200.computercraft.api.turtle.TurtleUpgradeSerialiser; import net.banutama.utamacraft.block.entity.InsolatorBlockEntity; @@ -11,18 +10,18 @@ import net.minecraft.resources.ResourceLocation; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.RegistryObject; -import org.slf4j.Logger; /** * CC:Tweaked registration */ public class CCRegistration { - public static final DeferredRegister> TURTLE_SERIALIZERS = - DeferredRegister.create(TurtleUpgradeSerialiser.REGISTRY_ID, Utamacraft.MOD_ID); + public static final DeferredRegister> TURTLE_SERIALIZERS = DeferredRegister + .create(TurtleUpgradeSerialiser.REGISTRY_ID, Utamacraft.MOD_ID); - public static final RegistryObject> PLAYER_TURTLE = - TURTLE_SERIALIZERS.register(ID.PLAYER_TURTLE.getPath(), () -> TurtleUpgradeSerialiser.simpleWithCustomItem(TurtlePlayerUpgrade::new)); + public static final RegistryObject> PLAYER_TURTLE = TURTLE_SERIALIZERS + .register(ID.PLAYER_TURTLE.getPath(), + () -> TurtleUpgradeSerialiser.simpleWithCustomItem(TurtlePlayerUpgrade::new)); public static PeripheralProvider peripheralProvider = new PeripheralProvider(); diff --git a/src/main/java/net/banutama/utamacraft/Utamacraft.java b/src/main/java/net/banutama/utamacraft/Utamacraft.java index c1b9637..ea2a820 100644 --- a/src/main/java/net/banutama/utamacraft/Utamacraft.java +++ b/src/main/java/net/banutama/utamacraft/Utamacraft.java @@ -1,14 +1,11 @@ package net.banutama.utamacraft; -import com.google.common.eventbus.Subscribe; import com.mojang.logging.LogUtils; import net.banutama.utamacraft.block.custom.ModBlocks; import net.banutama.utamacraft.block.entity.ModBlockEntities; -import net.banutama.utamacraft.client.model.AmuletModel; import net.banutama.utamacraft.integrations.curios.CuriosRenderers; import net.banutama.utamacraft.integrations.curios.CuriousLayerDefinitions; -import net.banutama.utamacraft.item.FireWardItem; import net.banutama.utamacraft.item.ModItems; import net.banutama.utamacraft.networking.ModMessages; @@ -36,7 +33,6 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.slf4j.Logger; import top.theillusivec4.curios.api.SlotTypeMessage; import top.theillusivec4.curios.api.SlotTypePreset; -import top.theillusivec4.curios.api.client.CuriosRendererRegistry; // The value here should match an entry in the META-INF/mods.toml file @Mod(Utamacraft.MOD_ID) diff --git a/src/main/java/net/banutama/utamacraft/block/custom/InsolatorBlock.java b/src/main/java/net/banutama/utamacraft/block/custom/InsolatorBlock.java index c592ec5..688c18e 100644 --- a/src/main/java/net/banutama/utamacraft/block/custom/InsolatorBlock.java +++ b/src/main/java/net/banutama/utamacraft/block/custom/InsolatorBlock.java @@ -44,12 +44,13 @@ public class InsolatorBlock extends BaseEntityBlock { } private static Block.Properties getProperties() { - return Block.Properties.of(Material.METAL).strength(6.0f).requiresCorrectToolForDrops().noOcclusion().lightLevel(state -> state.getValue(ACTIVE) ? 15 : 0); + return Block.Properties.of(Material.METAL).strength(6.0f).requiresCorrectToolForDrops().noOcclusion() + .lightLevel(state -> state.getValue(ACTIVE) ? 15 : 0); } - @SuppressWarnings("deprecation") @Override - public @NotNull VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter getter, @NotNull BlockPos pos, @NotNull CollisionContext context) { + public @NotNull VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter getter, @NotNull BlockPos pos, + @NotNull CollisionContext context) { return SHAPE; } @@ -59,7 +60,6 @@ public class InsolatorBlock extends BaseEntityBlock { return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite()); } - @SuppressWarnings("deprecation") @Override public @NotNull BlockState rotate(BlockState state, Rotation rotation) { return state.setValue(FACING, rotation.rotate(state.getValue(FACING))); @@ -76,7 +76,6 @@ public class InsolatorBlock extends BaseEntityBlock { builder.add(FACING, ACTIVE); } - @SuppressWarnings("deprecation") @Override public @NotNull RenderShape getRenderShape(@NotNull BlockState pState) { return RenderShape.MODEL; @@ -84,7 +83,8 @@ public class InsolatorBlock extends BaseEntityBlock { @SuppressWarnings("deprecation") @Override - public void onRemove(BlockState pState, @NotNull Level pLevel, @NotNull BlockPos pPos, BlockState pNewState, boolean pIsMoving) { + public void onRemove(BlockState pState, @NotNull Level pLevel, @NotNull BlockPos pPos, BlockState pNewState, + boolean pIsMoving) { if (!pState.is(pNewState.getBlock())) { BlockEntity blockEntity = pLevel.getBlockEntity(pPos); if (blockEntity instanceof InsolatorBlockEntity insolator) { @@ -103,9 +103,9 @@ public class InsolatorBlock extends BaseEntityBlock { super.onRemove(pState, pLevel, pPos, pNewState, pIsMoving); } - @SuppressWarnings("deprecation") @Override - public @NotNull InteractionResult use(@NotNull BlockState pState, @NotNull Level pLevel, @NotNull BlockPos pPos, @NotNull Player pPlayer, @NotNull InteractionHand pHand, @NotNull BlockHitResult pHit) { + public @NotNull InteractionResult use(@NotNull BlockState pState, @NotNull Level pLevel, @NotNull BlockPos pPos, + @NotNull Player pPlayer, @NotNull InteractionHand pHand, @NotNull BlockHitResult pHit) { BlockEntity blockEntity = pLevel.getBlockEntity(pPos); if (!(blockEntity instanceof InsolatorBlockEntity insolatorEntity)) { return InteractionResult.PASS; @@ -130,7 +130,8 @@ public class InsolatorBlock extends BaseEntityBlock { @Nullable @Override - public BlockEntityTicker getTicker(@NotNull Level pLevel, @NotNull BlockState pState, @NotNull BlockEntityType pBlockEntityType) { + public BlockEntityTicker getTicker(@NotNull Level pLevel, @NotNull BlockState pState, + @NotNull BlockEntityType pBlockEntityType) { if (pLevel.isClientSide()) { return null; } @@ -139,10 +140,12 @@ public class InsolatorBlock extends BaseEntityBlock { } @Override - public void animateTick(@NotNull BlockState pState, @NotNull Level pLevel, @NotNull BlockPos pPos, @NotNull RandomSource pRandom) { + public void animateTick(@NotNull BlockState pState, @NotNull Level pLevel, @NotNull BlockPos pPos, + @NotNull RandomSource pRandom) { if (pState.getValue(ACTIVE)) { if (pRandom.nextDouble() < 1.0d) { - pLevel.playLocalSound(pPos.getX() + 0.5, pPos.getY() + 0.5, pPos.getZ() + 0.5, ModSounds.INSOLATOR.get(), SoundSource.BLOCKS, 0.1f, 1.0f, false); + pLevel.playLocalSound(pPos.getX() + 0.5, pPos.getY() + 0.5, pPos.getZ() + 0.5, + ModSounds.INSOLATOR.get(), SoundSource.BLOCKS, 0.1f, 1.0f, false); } } } diff --git a/src/main/java/net/banutama/utamacraft/block/entity/InsolatorBlockEntity.java b/src/main/java/net/banutama/utamacraft/block/entity/InsolatorBlockEntity.java index c354b36..50e8526 100644 --- a/src/main/java/net/banutama/utamacraft/block/entity/InsolatorBlockEntity.java +++ b/src/main/java/net/banutama/utamacraft/block/entity/InsolatorBlockEntity.java @@ -1,6 +1,5 @@ package net.banutama.utamacraft.block.entity; -import com.mojang.logging.LogUtils; import net.banutama.utamacraft.block.custom.InsolatorBlock; import net.banutama.utamacraft.recipe.InsolatorRecipe; import net.banutama.utamacraft.recipe.ModRecipes; @@ -98,7 +97,8 @@ public class InsolatorBlockEntity extends BlockEntity implements MenuProvider { @Nullable @Override - public AbstractContainerMenu createMenu(int pContainerId, @NotNull Inventory pPlayerInventory, @NotNull Player pPlayer) { + public AbstractContainerMenu createMenu(int pContainerId, @NotNull Inventory pPlayerInventory, + @NotNull Player pPlayer) { return new InsolatorMenu(pContainerId, pPlayerInventory, this); } @@ -215,9 +215,10 @@ public class InsolatorBlockEntity extends BlockEntity implements MenuProvider { if (entity.fluid.isFluidValid(stack)) { // Remove the amount of fluid from the IFluidHandlerItem stack = handler.drain(amount, IFluidHandler.FluidAction.EXECUTE); - // Fill our fluid tank with the fluid stack we drained from the IFluidHandlerItem + // Fill our fluid tank with the fluid stack we drained from the + // IFluidHandlerItem entity.fluid.fill(stack, IFluidHandler.FluidAction.EXECUTE); - // Extract the current item from the fluid slot? TODO: Should this be when empty? + // Extract the current item from the fluid slot? entity.inventory.extractItem(0, 1, false); entity.inventory.insertItem(0, handler.getContainer(), false); } @@ -265,7 +266,8 @@ public class InsolatorBlockEntity extends BlockEntity implements MenuProvider { ItemStack output = inventory.getStackInSlot(2); - // If the output isn't empty, and the item in the output is different to the output of the recipe, we cannot process. + // If the output isn't empty, and the item in the output is different to the + // output of the recipe, we cannot process. if (!output.isEmpty() && output.getItem() != recipe.getResultItem().getItem()) { return false; } diff --git a/src/main/java/net/banutama/utamacraft/block/entity/ModBlockEntities.java b/src/main/java/net/banutama/utamacraft/block/entity/ModBlockEntities.java index 4b3806f..c1c200c 100644 --- a/src/main/java/net/banutama/utamacraft/block/entity/ModBlockEntities.java +++ b/src/main/java/net/banutama/utamacraft/block/entity/ModBlockEntities.java @@ -9,12 +9,12 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public class ModBlockEntities { - public static final DeferredRegister> BLOCK_ENTITIES = - DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, Utamacraft.MOD_ID); + public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister + .create(ForgeRegistries.BLOCK_ENTITY_TYPES, Utamacraft.MOD_ID); - public static final RegistryObject> INSOLATOR = - BLOCK_ENTITIES.register("insolator", () -> - BlockEntityType.Builder.of(InsolatorBlockEntity::new, ModBlocks.INSOLATOR.get()).build(null)); + public static final RegistryObject> INSOLATOR = BLOCK_ENTITIES.register( + "insolator", + () -> BlockEntityType.Builder.of(InsolatorBlockEntity::new, ModBlocks.INSOLATOR.get()).build(null)); public static void register(IEventBus bus) { BLOCK_ENTITIES.register(bus); diff --git a/src/main/java/net/banutama/utamacraft/client/ClientRegistry.java b/src/main/java/net/banutama/utamacraft/client/ClientRegistry.java index 044122c..b537dfa 100644 --- a/src/main/java/net/banutama/utamacraft/client/ClientRegistry.java +++ b/src/main/java/net/banutama/utamacraft/client/ClientRegistry.java @@ -13,6 +13,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; public class ClientRegistry { @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { - ComputerCraftAPIClient.registerTurtleUpgradeModeller(CCRegistration.PLAYER_TURTLE.get(), TurtleUpgradeModeller.flatItem()); + ComputerCraftAPIClient.registerTurtleUpgradeModeller(CCRegistration.PLAYER_TURTLE.get(), + TurtleUpgradeModeller.flatItem()); } } diff --git a/src/main/java/net/banutama/utamacraft/client/model/AmuletModel.java b/src/main/java/net/banutama/utamacraft/client/model/AmuletModel.java index 97e09a5..f06b861 100644 --- a/src/main/java/net/banutama/utamacraft/client/model/AmuletModel.java +++ b/src/main/java/net/banutama/utamacraft/client/model/AmuletModel.java @@ -33,7 +33,8 @@ public class AmuletModel extends HumanoidModel { } @Override - public void renderToBuffer(PoseStack pPoseStack, @NotNull VertexConsumer pBuffer, int pPackedLight, int pPackedOverlay, float pRed, float pGreen, float pBlue, float pAlpha) { + public void renderToBuffer(PoseStack pPoseStack, @NotNull VertexConsumer pBuffer, int pPackedLight, + int pPackedOverlay, float pRed, float pGreen, float pBlue, float pAlpha) { pPoseStack.pushPose(); pPoseStack.scale(0.25f, 0.25f, 0.25f); super.renderToBuffer(pPoseStack, pBuffer, pPackedLight, pPackedOverlay, pRed, pGreen, pBlue, pAlpha); @@ -51,4 +52,4 @@ public class AmuletModel extends HumanoidModel { return mesh; } -} \ No newline at end of file +} diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/BoundMethod.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/BoundMethod.java index f788502..f5e0cfa 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/BoundMethod.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/BoundMethod.java @@ -25,7 +25,8 @@ public class BoundMethod { } @NotNull - public MethodResult apply(@NotNull IComputerAccess computer, @NotNull ILuaContext context, @NotNull IArguments arguments) throws LuaException { + public MethodResult apply(@NotNull IComputerAccess computer, @NotNull ILuaContext context, + @NotNull IArguments arguments) throws LuaException { return method.apply(target, context, computer, arguments); } diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/PeripheralProvider.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/PeripheralProvider.java index 1b0aeeb..de0453d 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/PeripheralProvider.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/PeripheralProvider.java @@ -18,13 +18,15 @@ import java.util.function.Predicate; public class PeripheralProvider implements IPeripheralProvider { private final List blockEntityPeripherals = new ArrayList<>(); - public void registerBlockPeripheral(Function build, Predicate predicate) { + public void registerBlockPeripheral(Function build, + Predicate predicate) { blockEntityPeripherals.add(new BlockEntityPeripheral(build, predicate)); } @NotNull @Override - public LazyOptional getPeripheral(@NotNull Level world, @NotNull BlockPos pos, @NotNull Direction side) { + public LazyOptional getPeripheral(@NotNull Level world, @NotNull BlockPos pos, + @NotNull Direction side) { for (BlockEntityPeripheral peripheral : blockEntityPeripherals) { if (peripheral.hasPeripheral(world, pos, side)) { return LazyOptional.of(() -> peripheral.buildPeripheral(world, pos, side)); diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/BasePeripheral.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/BasePeripheral.java index 2d5b755..89ca6dd 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/BasePeripheral.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/BasePeripheral.java @@ -19,7 +19,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; -public abstract class BasePeripheral implements IPeripheral, IDynamicPeripheral { +public abstract class BasePeripheral implements IDynamicPeripheral { protected final String type; protected final BasePeripheralOwner owner; protected final List methods; @@ -28,7 +28,8 @@ public abstract class BasePeripheral implements IPeripheral, IDynamicPeripheral protected BasePeripheral(String type, BasePeripheralOwner owner) { this.type = type; this.owner = owner; - this.methods = PeripheralMethod.GENERATOR.getMethods(this.getClass()).stream().map(named -> new BoundMethod(this, named)).collect(Collectors.toList()); + this.methods = PeripheralMethod.GENERATOR.getMethods(this.getClass()).stream() + .map(named -> new BoundMethod(this, named)).collect(Collectors.toList()); } @NotNull @@ -39,7 +40,8 @@ public abstract class BasePeripheral implements IPeripheral, IDynamicPeripheral @NotNull @Override - public MethodResult callMethod(@NotNull IComputerAccess computer, @NotNull ILuaContext context, int method, @NotNull IArguments arguments) throws LuaException { + public MethodResult callMethod(@NotNull IComputerAccess computer, @NotNull ILuaContext context, int method, + @NotNull IArguments arguments) throws LuaException { return methods.get(method).apply(computer, context, arguments); } diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/BlockEntityPeripheral.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/BlockEntityPeripheral.java index 1217f01..9934dc8 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/BlockEntityPeripheral.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/BlockEntityPeripheral.java @@ -28,7 +28,8 @@ public class BlockEntityPeripheral { return predicate.test(entity); } - public @NotNull IPeripheral buildPeripheral(@NotNull Level level, @NotNull BlockPos pos, @NotNull Direction direction) { + public @NotNull IPeripheral buildPeripheral(@NotNull Level level, @NotNull BlockPos pos, + @NotNull Direction direction) { BlockEntity entity = level.getBlockEntity(pos); if (entity == null) { throw new IllegalArgumentException("No BlockEntity at this location"); @@ -36,4 +37,4 @@ public class BlockEntityPeripheral { return build.apply(entity); } -} \ No newline at end of file +} diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/InsolatorPeripheral.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/InsolatorPeripheral.java index cf27178..f36ac1a 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/InsolatorPeripheral.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/InsolatorPeripheral.java @@ -1,6 +1,5 @@ package net.banutama.utamacraft.integrations.computercraft.peripheral; -import com.mojang.logging.LogUtils; import dan200.computercraft.api.lua.LuaFunction; import dan200.computercraft.api.lua.MethodResult; import net.banutama.utamacraft.block.entity.InsolatorBlockEntity; @@ -8,15 +7,12 @@ import net.banutama.utamacraft.integrations.computercraft.utils.WrapResult; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; import java.util.HashMap; import java.util.Map; - public class InsolatorPeripheral extends BasePeripheral { public static final String PERIPHERAL_TYPE = "insolator"; - private static final Logger LOGGER = LogUtils.getLogger(); protected InsolatorPeripheral(BasePeripheralOwner owner) { super(PERIPHERAL_TYPE, owner); @@ -34,7 +30,8 @@ public class InsolatorPeripheral extends BasePeripheral { BlockEntity blockEntity = blockOwner.getBlockEntity(); if (!(blockEntity instanceof InsolatorBlockEntity insolator)) { - return MethodResult.of(null, "Owner of this InsolatorPeripheral has a BlockEntityProviderOwner with a BlockEntity that is not an InsolatorBlockEntity"); + return MethodResult.of(null, + "Owner of this InsolatorPeripheral has a BlockEntityProviderOwner with a BlockEntity that is not an InsolatorBlockEntity"); } Map result = new HashMap<>(); diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/TurtlePeripheralOwner.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/TurtlePeripheralOwner.java index c46b29a..d97b640 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/TurtlePeripheralOwner.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/peripheral/TurtlePeripheralOwner.java @@ -15,4 +15,8 @@ public class TurtlePeripheralOwner extends BasePeripheralOwner { public ITurtleAccess getTurtle() { return turtle; } + + public TurtleSide getTurtleSide() { + return side; + } } diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerCache.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerCache.java index a5a0835..a75a23f 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerCache.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerCache.java @@ -18,7 +18,7 @@ public class TurtlePlayerCache { private static SimpleFakePlayer getPlayerFor(ITurtleAccess turtle, GameProfile profile) { SimpleFakePlayer player = PLAYERS.get(turtle); if (player == null) { - player = new SimpleFakePlayer((ServerLevel)turtle.getLevel(), profile); + player = new SimpleFakePlayer((ServerLevel) turtle.getLevel(), profile); PLAYERS.put(turtle, player); } @@ -36,15 +36,18 @@ public class TurtlePlayerCache { Direction direction = turtle.getDirection(); float pitch = direction == Direction.UP ? -90.0f : direction == Direction.DOWN ? 90.0f : 0.0f; - float yaw = direction == Direction.SOUTH ? 0.0f : direction == Direction.WEST ? 90.0f : direction == Direction.NORTH ? 180.0f : -90.0f; + float yaw = direction == Direction.SOUTH ? 0.0f + : direction == Direction.WEST ? 90.0f : direction == Direction.NORTH ? 180.0f : -90.0f; Vec3i normal = direction.getNormal(); Direction.Axis axis = direction.getAxis(); Direction.AxisDirection axis_dir = direction.getAxisDirection(); - double x = (axis == Direction.Axis.X && axis_dir == Direction.AxisDirection.NEGATIVE) ? -0.5 : (0.5 + normal.getX() / 1.9); + double x = (axis == Direction.Axis.X && axis_dir == Direction.AxisDirection.NEGATIVE) ? -0.5 + : (0.5 + normal.getX() / 1.9); double y = 0.5 + normal.getY() / 1.9; - double z = (axis == Direction.Axis.Z && axis_dir == Direction.AxisDirection.NEGATIVE) ? -0.5 : (0.5 + normal.getZ() / 1.9); + double z = (axis == Direction.Axis.Z && axis_dir == Direction.AxisDirection.NEGATIVE) ? -0.5 + : (0.5 + normal.getZ() / 1.9); player.moveTo(position.getX() + x, position.getY() + y, position.getZ() + z, yaw, pitch); return callback.apply(player); diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerUpgrade.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerUpgrade.java index d61368a..1a9a42e 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerUpgrade.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerUpgrade.java @@ -1,24 +1,19 @@ package net.banutama.utamacraft.integrations.computercraft.turtles; -import com.mojang.logging.LogUtils; import dan200.computercraft.api.turtle.ITurtleAccess; import dan200.computercraft.api.turtle.TurtleSide; import net.banutama.utamacraft.integrations.computercraft.peripheral.PlayerPeripheral; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; public class TurtlePlayerUpgrade extends PeripheralTurtleUpgrade { - private static final Logger LOGGER = LogUtils.getLogger(); - public TurtlePlayerUpgrade(ResourceLocation id, ItemStack item) { super(id, item); } @Override protected PlayerPeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { - LOGGER.info("Building PlayerPeripheral for TurtlePlayerUpgrade"); return new PlayerPeripheral(turtle, side); } } diff --git a/src/main/java/net/banutama/utamacraft/integrations/computercraft/utils/WrapResult.java b/src/main/java/net/banutama/utamacraft/integrations/computercraft/utils/WrapResult.java index 4639def..90eeaa5 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/computercraft/utils/WrapResult.java +++ b/src/main/java/net/banutama/utamacraft/integrations/computercraft/utils/WrapResult.java @@ -1,7 +1,5 @@ package net.banutama.utamacraft.integrations.computercraft.utils; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; diff --git a/src/main/java/net/banutama/utamacraft/integrations/curios/CuriosRenderer.java b/src/main/java/net/banutama/utamacraft/integrations/curios/CuriosRenderer.java index 490b815..1b6ca78 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/curios/CuriosRenderer.java +++ b/src/main/java/net/banutama/utamacraft/integrations/curios/CuriosRenderer.java @@ -21,7 +21,8 @@ public class CuriosRenderer implements ICurioRenderer { private final HumanoidModel model; public CuriosRenderer(String texturePath, HumanoidModel model) { - this(new ResourceLocation(Utamacraft.MOD_ID, String.format("textures/entity/curio/%s_curio.png", texturePath)), model); + this(new ResourceLocation(Utamacraft.MOD_ID, String.format("textures/entity/curio/%s_curio.png", texturePath)), + model); } public CuriosRenderer(ResourceLocation texture, HumanoidModel model) { @@ -31,23 +32,24 @@ public class CuriosRenderer implements ICurioRenderer { @Override public > void render(ItemStack stack, - SlotContext slotContext, - PoseStack matrixStack, - RenderLayerParent renderLayerParent, - MultiBufferSource renderTypeBuffer, - int light, - float limbSwing, - float limbSwingAmount, - float partialTicks, - float ageInTicks, - float netHeadYaw, - float headPitch) { + SlotContext slotContext, + PoseStack matrixStack, + RenderLayerParent renderLayerParent, + MultiBufferSource renderTypeBuffer, + int light, + float limbSwing, + float limbSwingAmount, + float partialTicks, + float ageInTicks, + float netHeadYaw, + float headPitch) { model.setupAnim(slotContext.entity(), limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); model.prepareMobModel(slotContext.entity(), limbSwing, limbSwingAmount, partialTicks); ICurioRenderer.followBodyRotations(slotContext.entity(), model); RenderType renderType = model.renderType(texture); - VertexConsumer vertexConsumer = ItemRenderer.getFoilBuffer(renderTypeBuffer, renderType, false, stack.hasFoil()); + VertexConsumer vertexConsumer = ItemRenderer.getFoilBuffer(renderTypeBuffer, renderType, false, + stack.hasFoil()); model.renderToBuffer(matrixStack, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0f, 1.0f, 1.0f, 1.0f); } } diff --git a/src/main/java/net/banutama/utamacraft/integrations/curios/CuriousLayerDefinitions.java b/src/main/java/net/banutama/utamacraft/integrations/curios/CuriousLayerDefinitions.java index 1b26c3f..bb5fa5b 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/curios/CuriousLayerDefinitions.java +++ b/src/main/java/net/banutama/utamacraft/integrations/curios/CuriousLayerDefinitions.java @@ -8,8 +8,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraftforge.client.event.EntityRenderersEvent; public class CuriousLayerDefinitions { - public static final ModelLayerLocation FIRE_WARD = - new ModelLayerLocation(new ResourceLocation(Utamacraft.MOD_ID, "fire_ward"), "fire_ward"); + public static final ModelLayerLocation FIRE_WARD = new ModelLayerLocation( + new ResourceLocation(Utamacraft.MOD_ID, "fire_ward"), "fire_ward"); public static void register(EntityRenderersEvent.RegisterLayerDefinitions event) { event.registerLayerDefinition(FIRE_WARD, () -> { diff --git a/src/main/java/net/banutama/utamacraft/integrations/jei/InsolatorRecipeCategory.java b/src/main/java/net/banutama/utamacraft/integrations/jei/InsolatorRecipeCategory.java index 9e14883..07ab98c 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/jei/InsolatorRecipeCategory.java +++ b/src/main/java/net/banutama/utamacraft/integrations/jei/InsolatorRecipeCategory.java @@ -15,24 +15,24 @@ import net.banutama.utamacraft.recipe.InsolatorRecipe; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import org.checkerframework.checker.units.qual.A; import org.jetbrains.annotations.NotNull; import java.util.List; public class InsolatorRecipeCategory implements IRecipeCategory { public final static ResourceLocation UID = new ResourceLocation(Utamacraft.MOD_ID, "insolator"); - public final static ResourceLocation TEXTURE = - new ResourceLocation(Utamacraft.MOD_ID, "textures/gui/insolator_gui.png"); - public static final RecipeType INSOLATOR_TYPE = - new RecipeType<>(InsolatorRecipeCategory.UID, InsolatorRecipe.class); + public final static ResourceLocation TEXTURE = new ResourceLocation(Utamacraft.MOD_ID, + "textures/gui/insolator_gui.png"); + public static final RecipeType INSOLATOR_TYPE = new RecipeType<>(InsolatorRecipeCategory.UID, + InsolatorRecipe.class); private final IDrawable background; private final IDrawable icon; public InsolatorRecipeCategory(IGuiHelper guiHelper) { this.background = guiHelper.createDrawable(TEXTURE, 0, 0, 176, 85); - this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(ModBlocks.INSOLATOR.get())); + this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, + new ItemStack(ModBlocks.INSOLATOR.get())); } @Override @@ -56,7 +56,8 @@ public class InsolatorRecipeCategory implements IRecipeCategory } @Override - public void setRecipe(@NotNull IRecipeLayoutBuilder builder, @NotNull InsolatorRecipe recipe, @NotNull IFocusGroup focuses) { + public void setRecipe(@NotNull IRecipeLayoutBuilder builder, @NotNull InsolatorRecipe recipe, + @NotNull IFocusGroup focuses) { builder.addSlot(RecipeIngredientRole.INPUT, 86, 15) .addIngredients(recipe.getIngredients().get(0)); builder.addSlot(RecipeIngredientRole.INPUT, 33, 16) diff --git a/src/main/java/net/banutama/utamacraft/integrations/jei/ModJeiPlugin.java b/src/main/java/net/banutama/utamacraft/integrations/jei/ModJeiPlugin.java index ad9d2e1..acc73b1 100644 --- a/src/main/java/net/banutama/utamacraft/integrations/jei/ModJeiPlugin.java +++ b/src/main/java/net/banutama/utamacraft/integrations/jei/ModJeiPlugin.java @@ -29,6 +29,7 @@ public class ModJeiPlugin implements IModPlugin { @Override public void registerRecipes(IRecipeRegistration registration) { + @SuppressWarnings("resource") RecipeManager manager = Objects.requireNonNull(Minecraft.getInstance().level).getRecipeManager(); List recipes = manager.getAllRecipesFor(ModRecipes.INSOLATOR_RECIPE_TYPE.get()); registration.addRecipes(InsolatorRecipeCategory.INSOLATOR_TYPE, recipes); diff --git a/src/main/java/net/banutama/utamacraft/item/ModCreativeModeTab.java b/src/main/java/net/banutama/utamacraft/item/ModCreativeModeTab.java index b27f1db..6ed7d6e 100644 --- a/src/main/java/net/banutama/utamacraft/item/ModCreativeModeTab.java +++ b/src/main/java/net/banutama/utamacraft/item/ModCreativeModeTab.java @@ -11,7 +11,7 @@ public class ModCreativeModeTab { public static final CreativeModeTab TAB = new CreativeModeTab("utamacraft_tab") { @Override public @NotNull ItemStack makeIcon() { - return new ItemStack(ModItems.LOGO.get()); + return new ItemStack(ModItems.BULB.get()); } }; } diff --git a/src/main/java/net/banutama/utamacraft/item/ModItems.java b/src/main/java/net/banutama/utamacraft/item/ModItems.java index 94b1bf7..3ed5990 100644 --- a/src/main/java/net/banutama/utamacraft/item/ModItems.java +++ b/src/main/java/net/banutama/utamacraft/item/ModItems.java @@ -8,25 +8,17 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public class ModItems { - public static final DeferredRegister ITEMS = - DeferredRegister.create(ForgeRegistries.ITEMS, Utamacraft.MOD_ID); + public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, + Utamacraft.MOD_ID); - public static final RegistryObject LOGO = - ITEMS.register("utamacraft_logo", ModItems::simpleItem); - public static final RegistryObject PLAYER_PERIPHERAL = - ITEMS.register("player_peripheral", PlayerPeripheralItem::new); - public static final RegistryObject TUNGSTEN_INGOT = - ITEMS.register("tungsten_ingot", ModItems::simpleItem); - public static final RegistryObject TUNGSTEN_RAW = - ITEMS.register("tungsten_raw", ModItems::simpleItem); - public static final RegistryObject FIBER_GLASS = - ITEMS.register("fiber_glass", ModItems::simpleItem); - public static final RegistryObject PCB = - ITEMS.register("pcb", ModItems::simpleItem); - public static final RegistryObject BULB = - ITEMS.register("bulb", ModItems::simpleItem); - public static final RegistryObject FIRE_WARD = - ITEMS.register("fire_ward", FireWardItem::new); + public static final RegistryObject PLAYER_PERIPHERAL = ITEMS.register("player_peripheral", + PlayerPeripheralItem::new); + public static final RegistryObject TUNGSTEN_INGOT = ITEMS.register("tungsten_ingot", ModItems::simpleItem); + public static final RegistryObject TUNGSTEN_RAW = ITEMS.register("tungsten_raw", ModItems::simpleItem); + public static final RegistryObject FIBER_GLASS = ITEMS.register("fiber_glass", ModItems::simpleItem); + public static final RegistryObject PCB = ITEMS.register("pcb", ModItems::simpleItem); + public static final RegistryObject BULB = ITEMS.register("bulb", ModItems::simpleItem); + public static final RegistryObject FIRE_WARD = ITEMS.register("fire_ward", FireWardItem::new); public static void register(IEventBus eventBus) { ITEMS.register(eventBus); diff --git a/src/main/java/net/banutama/utamacraft/mixin/EntityMixin.java b/src/main/java/net/banutama/utamacraft/mixin/EntityMixin.java index b6af5bb..98976c5 100644 --- a/src/main/java/net/banutama/utamacraft/mixin/EntityMixin.java +++ b/src/main/java/net/banutama/utamacraft/mixin/EntityMixin.java @@ -1,6 +1,5 @@ package net.banutama.utamacraft.mixin; -import com.mojang.logging.LogUtils; import net.banutama.utamacraft.item.ModItems; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; diff --git a/src/main/resources/assets/utamacraft/lang/en_us.json b/src/main/resources/assets/utamacraft/lang/en_us.json index 405e5e7..a1efa20 100644 --- a/src/main/resources/assets/utamacraft/lang/en_us.json +++ b/src/main/resources/assets/utamacraft/lang/en_us.json @@ -13,9 +13,8 @@ "item.utamacraft.pcb": "Printed Circuit Board", "item.utamacraft.player_peripheral": "Player peripheral", "item.utamacraft.tungsten_raw": "Raw Tungsten", - "item.utamacraft.tungsten_block": "Tungsten Block", + "item.utamacraft.tungsten_block": "Tungsten Block", "item.utamacraft.tungsten_ingot": "Tungsten Ingot", - "item.utamacraft.utamacraft_logo": "Utamacraft", "itemGroup.utamacraft_tab": "Utamacraft", "tooltip.utamacraft.energy": "Energy", "tooltip.utamacraft.energy.amount": "%s FE", @@ -25,7 +24,7 @@ "tooltip.utamacraft.fire_ward": "Protects the player from fire damage", "tooltip.utamacraft.fluid.empty": "Empty", "tooltip.utamacraft.fluid.amount": "%s mB", - "tooltip.utamacraft.fluid.amount.with_capacity": "%s / %s mB", + "tooltip.utamacraft.fluid.amount.with_capacity": "%s / %s mB", "turtle.utamacraft.player_turtle": "Player", "gui.utamacraft.insolator.dump": "Dump", "gui.utamacraft.insolator.dump.tooltip": "Dump the fluid contents of the Insolator", diff --git a/src/main/resources/assets/utamacraft/models/item/utamacraft_logo.json b/src/main/resources/assets/utamacraft/models/item/utamacraft_logo.json deleted file mode 100644 index c67a2e3..0000000 --- a/src/main/resources/assets/utamacraft/models/item/utamacraft_logo.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "utamacraft:item/utamacraft_logo" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/utamacraft/textures/item/utamacraft_logo.png b/src/main/resources/assets/utamacraft/textures/item/utamacraft_logo.png deleted file mode 100644 index 1ba9f20..0000000 Binary files a/src/main/resources/assets/utamacraft/textures/item/utamacraft_logo.png and /dev/null differ