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