Merged more parts
This commit is contained in:
@@ -27,6 +27,8 @@ import java.util.function.Function;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.ModelBakeSettings;
|
||||
import net.minecraft.client.render.model.UnbakedModel;
|
||||
@@ -44,6 +46,7 @@ import javax.annotation.Nullable;
|
||||
/**
|
||||
* The built-in model for the cable bus block.
|
||||
*/
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class CableBusModel implements UnbakedModel {
|
||||
|
||||
private final PartModels partModels;
|
||||
|
||||
@@ -34,7 +34,12 @@ import appeng.items.parts.ColoredPartItem;
|
||||
import appeng.items.parts.PartItem;
|
||||
import appeng.items.parts.PartItemRendering;
|
||||
import appeng.parts.misc.CableAnchorPart;
|
||||
import appeng.parts.misc.InvertedToggleBusPart;
|
||||
import appeng.parts.misc.ToggleBusPart;
|
||||
import appeng.parts.networking.*;
|
||||
import appeng.parts.reporting.DarkPanelPart;
|
||||
import appeng.parts.reporting.PanelPart;
|
||||
import appeng.parts.reporting.SemiDarkPanelPart;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
@@ -98,14 +103,14 @@ public final class ApiParts implements IParts {
|
||||
this.cableDenseSmart = constructColoredDefinition(registry, "smart_dense_cable",
|
||||
SmartDenseCablePart::new);
|
||||
this.quartzFiber = createPart(registry, "quartz_fiber", QuartzFiberPart::new);
|
||||
// FIXME this.toggleBus = createPart(registry, "toggle_bus", ToggleBusPart::new);
|
||||
// FIXME this.invertedToggleBus = createPart(registry, "inverted_toggle_bus",
|
||||
// FIXME InvertedToggleBusPart::new);
|
||||
this.toggleBus = createPart(registry, "toggle_bus", ToggleBusPart::new);
|
||||
this.invertedToggleBus = createPart(registry, "inverted_toggle_bus",
|
||||
InvertedToggleBusPart::new);
|
||||
this.cableAnchor = createPart(registry, "cable_anchor", CableAnchorPart::new);
|
||||
// FIXME this.monitor = createPart(registry, "monitor", PanelPart::new);
|
||||
// FIXME this.semiDarkMonitor = createPart(registry, "semi_dark_monitor",
|
||||
// FIXME SemiDarkPanelPart::new);
|
||||
// FIXME this.darkMonitor = createPart(registry, "dark_monitor", DarkPanelPart::new);
|
||||
this.monitor = createPart(registry, "monitor", PanelPart::new);
|
||||
this.semiDarkMonitor = createPart(registry, "semi_dark_monitor",
|
||||
SemiDarkPanelPart::new);
|
||||
this.darkMonitor = createPart(registry, "dark_monitor", DarkPanelPart::new);
|
||||
// FIXME this.storageBus = createPart(registry, "storage_bus", StorageBusPart::new);
|
||||
// FIXME this.fluidStorageBus = createPart(registry, "fluid_storage_bus",
|
||||
// FIXME FluidStorageBusPart::new);
|
||||
@@ -165,9 +170,9 @@ public final class ApiParts implements IParts {
|
||||
"parts/fluid_formation_plane_on");
|
||||
|
||||
// Register all part models
|
||||
// FIXME FABRIC for (PartType partType : PartType.values()) {
|
||||
// FIXME FABRIC partModels.registerModels(partType.getModels());
|
||||
// FIXME FABRIC }
|
||||
for (PartType partType : PartType.values()) {
|
||||
partModels.registerModels(partType.getModels());
|
||||
}
|
||||
}
|
||||
|
||||
private <T extends IPart> IItemDefinition createPart(FeatureFactory registry, String id,
|
||||
|
||||
-2
@@ -23,7 +23,6 @@ import net.minecraft.util.Identifier;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.items.parts.PartModels;
|
||||
import appeng.parts.PartModel;
|
||||
|
||||
@@ -36,7 +35,6 @@ public class InvertedToggleBusPart extends ToggleBusPart {
|
||||
public static final PartModel MODELS_ON = new PartModel(MODEL_BASE, MODEL_STATUS_ON);
|
||||
public static final PartModel MODELS_HAS_CHANNEL = new PartModel(MODEL_BASE, MODEL_STATUS_HAS_CHANNEL);
|
||||
|
||||
@Reflected
|
||||
public InvertedToggleBusPart(final ItemStack is) {
|
||||
super(is);
|
||||
this.getProxy().setIdlePowerUsage(0.0);
|
||||
-2
@@ -40,7 +40,6 @@ import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.items.parts.PartModels;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
import appeng.parts.BasicStatePart;
|
||||
@@ -69,7 +68,6 @@ public class ToggleBusPart extends BasicStatePart {
|
||||
private IGridConnection connection;
|
||||
private boolean hasRedstone = false;
|
||||
|
||||
@Reflected
|
||||
public ToggleBusPart(final ItemStack is) {
|
||||
super(is);
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ public abstract class AbstractReportingPart extends AEBasePart implements IMonit
|
||||
public boolean onPartActivate(final PlayerEntity player, final Hand hand, final Vec3d pos) {
|
||||
final BlockEntity te = this.getTile();
|
||||
|
||||
if (Platform.isWrench(player, player.inventory.getCurrentItem(), te.getPos())) {
|
||||
if (Platform.isWrench(player, player.inventory.getMainHandStack(), te.getPos())) {
|
||||
if (Platform.isServer()) {
|
||||
if (this.getSpin() > 3) {
|
||||
this.spin = 0;
|
||||
-2
@@ -23,7 +23,6 @@ import net.minecraft.util.Identifier;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.items.parts.PartModels;
|
||||
import appeng.parts.PartModel;
|
||||
|
||||
@@ -37,7 +36,6 @@ public class DarkPanelPart extends AbstractPanelPart {
|
||||
public static final IPartModel MODELS_OFF = new PartModel(MODEL_BASE, MODEL_OFF);
|
||||
public static final IPartModel MODELS_ON = new PartModel(MODEL_BASE, MODEL_ON);
|
||||
|
||||
@Reflected
|
||||
public DarkPanelPart(final ItemStack is) {
|
||||
super(is);
|
||||
}
|
||||
-2
@@ -23,7 +23,6 @@ import net.minecraft.util.Identifier;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.items.parts.PartModels;
|
||||
import appeng.parts.PartModel;
|
||||
|
||||
@@ -37,7 +36,6 @@ public class PanelPart extends AbstractPanelPart {
|
||||
public static final IPartModel MODELS_OFF = new PartModel(MODEL_BASE, MODEL_OFF);
|
||||
public static final IPartModel MODELS_ON = new PartModel(MODEL_BASE, MODEL_ON);
|
||||
|
||||
@Reflected
|
||||
public PanelPart(final ItemStack is) {
|
||||
super(is);
|
||||
}
|
||||
-2
@@ -23,7 +23,6 @@ import net.minecraft.util.Identifier;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.items.parts.PartModels;
|
||||
import appeng.parts.PartModel;
|
||||
|
||||
@@ -36,7 +35,6 @@ public class SemiDarkPanelPart extends AbstractPanelPart {
|
||||
public static final PartModel MODELS_OFF = new PartModel(MODEL_BASE, MODEL_OFF);
|
||||
public static final IPartModel MODELS_ON = new PartModel(MODEL_BASE, MODEL_ON);
|
||||
|
||||
@Reflected
|
||||
public SemiDarkPanelPart(final ItemStack is) {
|
||||
super(is);
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class MEPortableCellContainer extends MEMonitorableContainer {
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem()
|
||||
final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getMainHandStack()
|
||||
: this.getPlayerInv().getStack(this.slot);
|
||||
|
||||
if (this.civ == null || currentItem.isEmpty()) {
|
||||
|
||||
@@ -75,7 +75,7 @@ public class NetworkToolContainer extends AEBaseContainer {
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
final ItemStack currentItem = this.getPlayerInv().getCurrentItem();
|
||||
final ItemStack currentItem = this.getPlayerInv().getMainHandStack();
|
||||
|
||||
if (currentItem != this.toolInv.getItemStack()) {
|
||||
if (!currentItem.isEmpty()) {
|
||||
|
||||
@@ -79,7 +79,7 @@ public class QuartzKnifeContainer extends AEBaseContainer {
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
final ItemStack currentItem = this.getPlayerInv().getCurrentItem();
|
||||
final ItemStack currentItem = this.getPlayerInv().getMainHandStack();
|
||||
|
||||
if (currentItem != this.toolInv.getItemStack()) {
|
||||
if (!currentItem.isEmpty()) {
|
||||
|
||||
@@ -83,7 +83,7 @@ public class CubeGeneratorBlockEntity extends AEBaseBlockEntity implements Ticka
|
||||
|
||||
void click(final PlayerEntity player) {
|
||||
if (Platform.isServer()) {
|
||||
final ItemStack hand = player.inventory.getCurrentItem();
|
||||
final ItemStack hand = player.inventory.getMainHandStack();
|
||||
this.who = player;
|
||||
|
||||
if (hand.isEmpty()) {
|
||||
|
||||
@@ -147,7 +147,7 @@ public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseI
|
||||
final PlayerInventory playerInventory = player.inventory;
|
||||
final IMEInventoryHandler inv = AEApi.instance().registries().cell().getCellInventory(stack, null,
|
||||
this.getChannel());
|
||||
if (inv != null && playerInventory.getCurrentItem() == stack) {
|
||||
if (inv != null && playerInventory.getMainHandStack() == stack) {
|
||||
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor(player);
|
||||
final IItemList<IAEItemStack> list = inv.getAvailableItems(this.getChannel().createList());
|
||||
if (list.isEmpty() && ia != null) {
|
||||
|
||||
@@ -281,7 +281,7 @@ public abstract class P2PTunnelPart<T extends P2PTunnelPart> extends BasicStateP
|
||||
|
||||
@Override
|
||||
public boolean onPartShiftActivate(final PlayerEntity player, final Hand hand, final Vec3d pos) {
|
||||
final ItemStack is = player.inventory.getCurrentItem();
|
||||
final ItemStack is = player.inventory.getMainHandStack();
|
||||
if (!is.isEmpty() && is.getItem() instanceof IMemoryCard) {
|
||||
if (Platform.isClient()) {
|
||||
return true;
|
||||
|
||||
@@ -155,7 +155,7 @@ public class ChargerBlockEntity extends AENetworkPowerBlockEntity implements ICr
|
||||
|
||||
final ItemStack myItem = this.inv.getInvStack(0);
|
||||
if (myItem.isEmpty()) {
|
||||
ItemStack held = player.inventory.getCurrentItem();
|
||||
ItemStack held = player.inventory.getMainHandStack();
|
||||
|
||||
if (AEApi.instance().definitions().materials().certusQuartzCrystal().isSameAs(held)
|
||||
|| Platform.isChargeable(held)) {
|
||||
|
||||
Reference in New Issue
Block a user