Post-Merge fixes

This commit is contained in:
Sebastian Hartte
2020-08-02 22:30:59 +02:00
parent c0fa8ab2dc
commit d238f6e8e4
10 changed files with 82 additions and 68 deletions
@@ -1,15 +1,16 @@
package appeng.block.crafting; package appeng.block.crafting;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.util.Identifier;
import appeng.bootstrap.BlockRenderingCustomizer; import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering; import appeng.bootstrap.IBlockRendering;
import appeng.bootstrap.IItemRendering; import appeng.bootstrap.IItemRendering;
import appeng.client.render.crafting.MonitorBakedModel; import appeng.client.render.crafting.MonitorBakedModel;
import appeng.client.render.model.AutoRotatingBakedModel; import appeng.client.render.model.AutoRotatingBakedModel;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.util.Identifier;
public class CraftingMonitorBlockRendering extends BlockRenderingCustomizer { public class CraftingMonitorBlockRendering extends BlockRenderingCustomizer {
@@ -52,7 +52,7 @@ public class AppEngSlot extends Slot {
super(EMPTY_INVENTORY, invSlot, x, y); super(EMPTY_INVENTORY, invSlot, x, y);
this.itemHandler = inv; this.itemHandler = inv;
this.invSlot = invSlot; this.invSlot = invSlot;
this.backingSlot = inv.getSlot(idx); this.backingSlot = inv.getSlot(invSlot);
this.defX = x; this.defX = x;
this.defY = y; this.defY = y;
@@ -92,7 +92,7 @@ public class AppEngSlot extends Slot {
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
if (this.index >= this.itemHandler.getSlotCount()) { if (this.invSlot >= this.itemHandler.getSlotCount()) {
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
@@ -30,8 +30,8 @@ public class CraftingMatrixSlot extends AppEngSlot {
private final AEBaseContainer c; private final AEBaseContainer c;
private final Inventory wrappedInventory; private final Inventory wrappedInventory;
public CraftingMatrixSlot(final AEBaseContainer c, final FixedItemInv inv, final int invSlot, public CraftingMatrixSlot(final AEBaseContainer c, final FixedItemInv inv, final int invSlot, final int x,
final int x, final int y) { final int y) {
super(inv, invSlot, x, y); super(inv, invSlot, x, y);
this.c = c; this.c = c;
this.wrappedInventory = new WrapperInvItemHandler(inv); this.wrappedInventory = new WrapperInvItemHandler(inv);
@@ -30,11 +30,11 @@ public class MolecularAssemblerPatternSlot extends AppEngSlot {
private final int slotIdx; private final int slotIdx;
public MolecularAssemblerPatternSlot(final MolecularAssemblerContainer mac, final FixedItemInv inv, final int invSlot, public MolecularAssemblerPatternSlot(final MolecularAssemblerContainer mac, final FixedItemInv inv,
final int x, final int y) { final int invSlot, final int x, final int y) {
super(inv, invSlot, x, y); super(inv, invSlot, x, y);
this.mac = mac; this.mac = mac;
this.slotIdx = slotIdx; this.slotIdx = invSlot;
} }
@Override @Override
@@ -27,8 +27,9 @@ public class OptionalRestrictedInputSlot extends RestrictedInputSlot {
private final int groupNum; private final int groupNum;
private final IOptionalSlotHost host; private final IOptionalSlotHost host;
public OptionalRestrictedInputSlot(final PlacableItemType valid, final FixedItemInv inv, final IOptionalSlotHost host, public OptionalRestrictedInputSlot(final PlacableItemType valid, final FixedItemInv inv,
final int invSlot, final int x, final int y, final int grpNum, final PlayerInventory invPlayer) { final IOptionalSlotHost host, final int invSlot, final int x, final int y, final int grpNum,
final PlayerInventory invPlayer) {
super(valid, inv, invSlot, x, y, invPlayer); super(valid, inv, invSlot, x, y, invPlayer);
this.groupNum = grpNum; this.groupNum = grpNum;
this.host = host; this.host = host;
+4 -2
View File
@@ -70,8 +70,10 @@ public interface AppEng {
CableRenderMode getCableRenderMode(); CableRenderMode getCableRenderMode();
/** /**
* Sets the player that is currently interacting with a cable or part attached to a cable. This will return that * Sets the player that is currently interacting with a cable or part attached
* player's cable render mode from calls to {@link #getCableRenderMode()}, until another player or null is set. * to a cable. This will return that player's cable render mode from calls to
* {@link #getCableRenderMode()}, until another player or null is set.
*
* @param player Null to revert to the default cable render mode. * @param player Null to revert to the default cable render mode.
*/ */
void setPartInteractionPlayer(PlayerEntity player); void setPartInteractionPlayer(PlayerEntity player);
+2 -2
View File
@@ -3,6 +3,8 @@ package appeng.core;
import java.util.OptionalLong; import java.util.OptionalLong;
import java.util.function.Consumer; import java.util.function.Consumer;
import javax.annotation.Nullable;
import net.earthcomputer.libstructure.LibStructure; import net.earthcomputer.libstructure.LibStructure;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry; import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
@@ -152,8 +154,6 @@ import appeng.worldgen.ChargedQuartzOreConfig;
import appeng.worldgen.ChargedQuartzOreFeature; import appeng.worldgen.ChargedQuartzOreFeature;
import appeng.worldgen.meteorite.MeteoriteStructure; import appeng.worldgen.meteorite.MeteoriteStructure;
import javax.annotation.Nullable;
public abstract class AppEngBase implements AppEng { public abstract class AppEngBase implements AppEng {
protected AdvancementTriggers advancementTriggers; protected AdvancementTriggers advancementTriggers;
@@ -27,6 +27,7 @@ import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.SpawnGroup;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.util.Rarity;
import appeng.api.definitions.IItemDefinition; import appeng.api.definitions.IItemDefinition;
import appeng.api.definitions.IItems; import appeng.api.definitions.IItems;
@@ -246,7 +247,8 @@ public final class ApiItems implements IItems {
.features(AEFeature.NETWORK_TOOL).build(); .features(AEFeature.NETWORK_TOOL).build();
this.cellCreative = registry.item("creative_storage_cell", CreativeStorageCellItem::new) this.cellCreative = registry.item("creative_storage_cell", CreativeStorageCellItem::new)
.props(props -> props.maxCount(1)).features(AEFeature.STORAGE_CELLS, AEFeature.CREATIVE).build(); .props(props -> props.maxCount(1).rarity(Rarity.EPIC))
.features(AEFeature.STORAGE_CELLS, AEFeature.CREATIVE).build();
this.viewCell = registry.item("view_cell", ViewCellItem::new).props(props -> props.maxCount(1)) this.viewCell = registry.item("view_cell", ViewCellItem::new).props(props -> props.maxCount(1))
.features(AEFeature.VIEW_CELL).build(); .features(AEFeature.VIEW_CELL).build();
+48 -44
View File
@@ -18,7 +18,55 @@
package appeng.util; package appeng.util;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.recipe.Recipe;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.RayTraceContext;
import net.minecraft.world.World;
import alexiil.mc.lib.attributes.fluid.volume.FluidVolume; import alexiil.mc.lib.attributes.fluid.volume.FluidVolume;
import appeng.api.config.AccessRestriction; import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier; import appeng.api.config.PowerMultiplier;
@@ -64,50 +112,6 @@ import appeng.util.helpers.ItemComparisonHelper;
import appeng.util.helpers.P2PHelper; import appeng.util.helpers.P2PHelper;
import appeng.util.item.AEItemStack; import appeng.util.item.AEItemStack;
import appeng.util.prioritylist.IPartitionList; import appeng.util.prioritylist.IPartitionList;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.recipe.Recipe;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.RayTraceContext;
import net.minecraft.world.World;
import javax.annotation.Nullable;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;
/** /**
* @author AlgorithmX2 * @author AlgorithmX2
@@ -20,13 +20,17 @@ package appeng.util.inv;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper; import alexiil.mc.lib.attributes.item.impl.DirectFixedItemInv;
import alexiil.mc.lib.attributes.item.impl.DelegatingFixedItemInv;
public class WrapperCursorItemHandler extends DelegatingFixedItemInv { public class WrapperCursorItemHandler extends DirectFixedItemInv {
private final PlayerInventory inv;
public WrapperCursorItemHandler(PlayerInventory inventory) { public WrapperCursorItemHandler(PlayerInventory PlayerInventory) {
super(new FixedInventoryVanillaWrapper(inventory).getSubInv(0, 1)); super(1);
this.inv = PlayerInventory;
this.forceSetInvStack(0, PlayerInventory.getCursorStack());
setOwnerListener(view -> this.inv.setCursorStack(getInvStack(0)));
} }
} }