Skip to content

Commit

Permalink
Down to 832 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
BrokenK3yboard committed Jan 16, 2025
1 parent 6b52f92 commit 9881132
Show file tree
Hide file tree
Showing 144 changed files with 408 additions and 1,657 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ dependencies {
// runtimeOnly fg.deobf("curse.maven:blueprint-382216:5292242")
runtimeOnly "curse.maven:farmers-delight-398521:5962800"

// runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${deps.curios}")
// compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${deps.curios}:api")
runtimeOnly "top.theillusivec4.curios:curios-neoforge:${deps.curios}"
compileOnly "top.theillusivec4.curios:curios-neoforge:${deps.curios}:api"
}

spotless {
Expand Down
2 changes: 1 addition & 1 deletion dependencies.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ flan=5290172
lootr=5893109
emi=1.0.24+1.20.1
spark=1.10.109-neoforge
curios=5.6.1+1.20.1
curios=9.2.2+1.21.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.LivingEntity;
Expand All @@ -25,11 +24,8 @@
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.network.NetworkHooks;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import org.violetmoon.quark.addons.oddities.block.be.CrateBlockEntity;
import org.violetmoon.quark.addons.oddities.module.CrateModule;
import org.violetmoon.zeta.block.ZetaBlock;
Expand Down Expand Up @@ -79,7 +75,7 @@ public InteractionResult useWithoutItem(@NotNull BlockState state, Level worldIn
BlockEntity be = worldIn.getBlockEntity(pos);
if(be instanceof CrateBlockEntity crate) {
if(player instanceof ServerPlayer serverPlayer)
NetworkHooks.openScreen(serverPlayer, crate, pos);
serverPlayer.openMenu(crate);

PiglinAi.angerNearbyPiglins(player, true);
}
Expand All @@ -93,7 +89,7 @@ public void setPlacedBy(@NotNull Level worldIn, @NotNull BlockPos pos, @NotNull
if(stack.getComponents().has(DataComponents.CUSTOM_NAME)) {
BlockEntity tileentity = worldIn.getBlockEntity(pos);
if(tileentity instanceof CrateBlockEntity crate)
crate.setComponents(stack.getHoverName());
crate.setComponents(stack.getComponents());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
Expand All @@ -21,7 +20,6 @@
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.collect.Lists;
import net.minecraft.core.BlockPos;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.core.registries.BuiltInRegistries;
Expand Down Expand Up @@ -317,8 +318,8 @@ private float getEnchantPowerAt(Level world, BlockPos pos) {
}

@Override
public void writeSharedNBT(CompoundTag cmp) {
super.writeSharedNBT(cmp);
public void writeSharedNBT(CompoundTag cmp, HolderLookup.Provider provider) {
super.writeSharedNBT(cmp, provider);

CompoundTag matrixCmp = new CompoundTag();
if(matrix != null) {
Expand All @@ -334,8 +335,8 @@ public void writeSharedNBT(CompoundTag cmp) {
}

@Override
public void readSharedNBT(CompoundTag cmp) {
super.readSharedNBT(cmp);
public void readSharedNBT(CompoundTag cmp, HolderLookup.Provider provider) {
super.readSharedNBT(cmp, provider);

if(cmp.contains(TAG_MATRIX)) {
long least = cmp.getLong(TAG_MATRIX_UUID_LESS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import net.minecraft.core.Direction;
import net.minecraft.core.Vec3i;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.ComposterBlock;
import net.minecraft.world.level.block.state.BlockState;

import org.violetmoon.quark.addons.oddities.block.MagnetBlock;
import org.violetmoon.quark.api.IMagnetTracker;

import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MatrixEnchantingPieceList extends ObjectSelectionList<MatrixEnchant
private final int listWidth;

public MatrixEnchantingPieceList(MatrixEnchantingScreen parent, int listWidth, int listHeight, int top, int bottom, int entryHeight) {
super(parent.getMinecraft(), listWidth, listHeight, top, bottom, entryHeight);
super(parent.getMinecraft(), listWidth, listHeight, top, bottom);
this.listWidth = listWidth;
this.parent = parent;
}
Expand All @@ -44,7 +44,7 @@ public void refresh() {
}

@Override
public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
public void renderWidget(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
int i = this.getScrollbarPosition();
int j = i + 6;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.violetmoon.quark.addons.oddities.entity;

import net.minecraft.commands.arguments.item.ItemParser;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.core.registries.Registries;
import net.minecraft.nbt.CompoundTag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.EquipmentSlot.Type;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.*;
Expand Down Expand Up @@ -51,22 +50,20 @@ public ItemStack quickMoveStack(@NotNull Player playerIn, int index) {
final int topSlots = 8;
final int invStart = topSlots + 1;
final int invEnd = invStart + 27;
final int hotbarStart = invEnd;
final int hotbarEnd = hotbarStart + 9;
final int shieldSlot = hotbarEnd;
final int backpackStart = shieldSlot + 1;
final int hotbarEnd = invEnd + 9;
final int backpackStart = hotbarEnd + 1;
final int backpackEnd = backpackStart + 27;

ItemStack baseStack = ItemStack.EMPTY;
Slot slot = this.slots.get(index);

if(slot != null && slot.hasItem()) {
if(slot.hasItem()) {
ItemStack stack = slot.getItem();
baseStack = stack.copy();
EquipmentSlot slotType = Mob.getEquipmentSlotForItem(stack);
int equipIndex = topSlots - (slotType == null ? 0 : slotType.getIndex());
EquipmentSlot slotType = playerIn.getEquipmentSlotForItem(stack);
int equipIndex = topSlots - slotType.getIndex();

if(index < invStart || index == shieldSlot) { // crafting and armor slots
if(index < invStart || index == hotbarEnd) { // crafting and armor slots
ItemStack target = null;
if(!this.moveItemStackTo(stack, invStart, hotbarEnd, false) && !this.moveItemStackTo(stack, backpackStart, backpackEnd, false))
target = ItemStack.EMPTY;
Expand All @@ -77,18 +74,18 @@ else if(index == 0) // crafting result
slot.onQuickCraft(stack, baseStack);
}

else if(slotType != null && slotType.getType() == Type.HUMANOID_ARMOR && !this.slots.get(equipIndex).hasItem()) { // shift clicking armor
else if(slotType.getType() == Type.HUMANOID_ARMOR && !this.slots.get(equipIndex).hasItem()) { // shift clicking armor
if(!this.moveItemStackTo(stack, equipIndex, equipIndex + 1, false))
return ItemStack.EMPTY;
}

else if(slotType != null && slotType == EquipmentSlot.OFFHAND && !this.slots.get(shieldSlot).hasItem()) { // shift clicking shield
if(!this.moveItemStackTo(stack, shieldSlot, shieldSlot + 1, false))
else if(slotType == EquipmentSlot.OFFHAND && !this.slots.get(hotbarEnd).hasItem()) { // shift clicking shield
if(!this.moveItemStackTo(stack, hotbarEnd, hotbarEnd + 1, false))
return ItemStack.EMPTY;
}

else if(index < invEnd) {
if(!this.moveItemStackTo(stack, backpackStart, backpackEnd, false) && !this.moveItemStackTo(stack, hotbarStart, hotbarEnd, false))
if(!this.moveItemStackTo(stack, backpackStart, backpackEnd, false) && !this.moveItemStackTo(stack, invEnd, hotbarEnd, false))
return ItemStack.EMPTY;
}

Expand All @@ -97,7 +94,7 @@ else if(index < hotbarEnd) {
return ItemStack.EMPTY;
}

else if(!this.moveItemStackTo(stack, hotbarStart, hotbarEnd, false) && !this.moveItemStackTo(stack, invStart, invEnd, false))
else if(!this.moveItemStackTo(stack, invEnd, hotbarEnd, false) && !this.moveItemStackTo(stack, invStart, invEnd, false))
return ItemStack.EMPTY;

if(stack.isEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
import net.minecraft.world.inventory.SimpleContainerData;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;

import net.neoforged.neoforge.items.IItemHandler;
import net.neoforged.neoforge.items.SlotItemHandler;
import org.jetbrains.annotations.NotNull;

import org.violetmoon.quark.addons.oddities.block.be.CrateBlockEntity;
import org.violetmoon.quark.addons.oddities.capability.CrateItemHandler;
import org.violetmoon.quark.addons.oddities.module.CrateModule;
Expand Down Expand Up @@ -119,7 +117,7 @@ public boolean moveItemStackTo(ItemStack stack, int start, int length, boolean r
int maxStack = Math.min(stack.getMaxStackSize(), slot.getMaxStackSize());
int rmv = Math.min(maxStack, stack.getCount());

if(slot.mayPlace(cloneStack(stack, rmv)) && existingStack.getItem().equals(stack.getItem()) && ItemStack.isSameItemSameTags(stack, existingStack)) {
if(slot.mayPlace(cloneStack(stack, rmv)) && existingStack.getItem().equals(stack.getItem()) && ItemStack.isSameItemSameComponents(stack, existingStack)) {
int existingSize = existingStack.getCount() + stack.getCount();
ItemStack existingStackCopy = existingStack.copy();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.violetmoon.quark.addons.oddities.inventory.slot;

import net.minecraftforge.items.IItemHandler;
import net.neoforged.neoforge.items.IItemHandler;

@Deprecated(forRemoval = true)
public class SlotCachingItemHandler extends CachedItemHandlerSlot {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package org.violetmoon.quark.addons.oddities.item;

import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.Containers;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
Expand All @@ -21,11 +17,10 @@
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import net.neoforged.neoforge.capabilities.Capabilities;
import net.neoforged.neoforge.items.IItemHandler;
import net.neoforged.neoforge.items.ItemStackHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.violetmoon.quark.addons.oddities.inventory.BackpackMenu;
Expand All @@ -38,6 +33,7 @@
import org.violetmoon.zeta.registry.CreativeTabManager;

import java.util.Map;
import java.util.Optional;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;

Expand Down Expand Up @@ -87,9 +83,9 @@ public boolean doesConditionApply() {
}

public static boolean doesBackpackHaveItems(ItemStack stack) {
LazyOptional<IItemHandler> handlerOpt = stack.getCapability(ForgeCapabilities.ITEM_HANDLER, null);
Optional<IItemHandler> handlerOpt = Optional.ofNullable(stack.getCapability(Capabilities.ItemHandler.ITEM, null));

if(!handlerOpt.isPresent())
if(handlerOpt.isEmpty())
return false;

IItemHandler handler = handlerOpt.orElse(new ItemStackHandler());
Expand All @@ -101,44 +97,33 @@ public static boolean doesBackpackHaveItems(ItemStack stack) {
}

@Override
public boolean canEquipZeta(ItemStack stack, EquipmentSlot equipmentSlot, Entity ent) {
return equipmentSlot == EquipmentSlot.CHEST;
public boolean canEquipZeta(ItemStack stack, EquipmentSlot armorType, LivingEntity entity) {
return armorType == EquipmentSlot.CHEST;
}

@Override
public boolean isBookEnchantableZeta(ItemStack stack, ItemStack book) {
return false;
}

@Override
public boolean canApplyAtEnchantingTableZeta(ItemStack stack, Enchantment enchantment) {
return false;
}

@Override
public int getEnchantmentValueZeta(ItemStack stack) {
return 0;
}

@Override
public boolean canBeDepleted() {
return false;
}

@Override
public <T extends LivingEntity> int damageItemZeta(ItemStack stack, int amount, T entity, Consumer<T> onBroken) {
return 0;
}

@Override
public void inventoryTick(@NotNull ItemStack stack, Level worldIn, @NotNull Entity entityIn, int itemSlot, boolean isSelected) {
if(worldIn.isClientSide)
return;
if(worldIn.isClientSide) return;

boolean hasItems = !BackpackModule.superOpMode && doesBackpackHaveItems(stack);

Map<Enchantment, Integer> enchants = EnchantmentHelper.getEnchantments(stack);
boolean isCursed = enchants.containsKey(Enchantments.BINDING_CURSE);

boolean changedEnchants = false;

if(hasItems) {
Expand All @@ -149,7 +134,7 @@ public void inventoryTick(@NotNull ItemStack stack, Level worldIn, @NotNull Enti
}

if(BackpackModule.itemsInBackpackTick) {
LazyOptional<IItemHandler> handlerOpt = stack.getCapability(ForgeCapabilities.ITEM_HANDLER, null);
Optional<IItemHandler> handlerOpt = Optional.ofNullable(stack.getCapability(Capabilities.ItemHandler.ITEM, null));
IItemHandler handler = handlerOpt.orElse(new ItemStackHandler());
for(int i = 0; i < handler.getSlots(); i++) {
ItemStack inStack = handler.getStackInSlot(i);
Expand All @@ -173,16 +158,11 @@ public void inventoryTick(@NotNull ItemStack stack, Level worldIn, @NotNull Enti

@Override
public boolean onEntityItemUpdateZeta(ItemStack stack, ItemEntity entityItem) {
if(BackpackModule.superOpMode || entityItem.level().isClientSide)
return false;
if (BackpackModule.superOpMode || entityItem.level().isClientSide) return false;

if(!stack.hasTag())
return false;

LazyOptional<IItemHandler> handlerOpt = stack.getCapability(ForgeCapabilities.ITEM_HANDLER, null);
Optional<IItemHandler> handlerOpt = Optional.ofNullable(stack.getCapability(Capabilities.ItemHandler.ITEM, null));

if(!handlerOpt.isPresent())
return false;
if (handlerOpt.isEmpty()) return false;

IItemHandler handler = handlerOpt.orElse(new ItemStackHandler());

Expand Down
Loading

0 comments on commit 9881132

Please sign in to comment.