Merge remote-tracking branch 'origin/master' into fabric-1.16

# Conflicts:
#	build.gradle
#	core/src/main/java/appeng/block/AEBaseBlock.java
#	core/src/main/java/appeng/block/misc/TinyTNTBlock.java
#	core/src/main/java/appeng/entity/TinyTNTPrimedRenderer.java
#	core/src/main/java/appeng/fluids/util/AEFluidStack.java
#	src/main/java/appeng/core/AEConfig.java
#	src/main/java/appeng/core/api/definitions/ApiItems.java
#	src/main/java/appeng/debug/EnergyGeneratorBlockEntity.java
#	src/main/java/appeng/entity/TinyTNTPrimedEntity.java
#	src/main/java/appeng/tile/storage/DriveBlockEntity.java
This commit is contained in:
Sebastian Hartte
2020-06-29 21:33:44 +02:00
22 changed files with 314 additions and 125 deletions
@@ -125,6 +125,10 @@ public class DriveLedTileEntityRenderer extends BlockEntityRenderer<DriveBlockEn
return null;
}
if (!drive.isPowered()) {
return STATE_COLORS.get(DriveSlotState.OFFLINE);
}
Vector3f col = STATE_COLORS.get(state);
if (drive.isCellBlinking(slot)) {
// 200 ms interval (100ms to get to red, then 100ms back)
@@ -127,15 +127,6 @@ public class CellWorkbenchContainer extends UpgradeableContainer {
upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.getPlayerInventory()));
}
}
/*
* if ( supportCapacity() ) { for (int w = 0; w < 2; w++) for (int z = 0; z < 9;
* z++) addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, offset++,
* x, y, z, w, 1 ) ); for (int w = 0; w < 2; w++) for (int z = 0; z < 9; z++)
* addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, offset++, x, y,
* z, w + 2, 2 ) ); for (int w = 0; w < 2; w++) for (int z = 0; z < 9; z++)
* addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, offset++, x, y,
* z, w + 4, 3 ) ); }
*/
}
@Override
+1 -2
View File
@@ -285,8 +285,7 @@ final class Registration {
FacadeItem facadeItem = (FacadeItem) Api.INSTANCE.definitions().items().facade().item();
r.registerAll(DisassembleRecipe.SERIALIZER, GrinderRecipeSerializer.INSTANCE,
InscriberRecipeSerializer.INSTANCE, FacadeRecipe.getSerializer(facadeItem),
DisassembleRecipe.SERIALIZER);
InscriberRecipeSerializer.INSTANCE, FacadeRecipe.getSerializer(facadeItem));
}
// FIXME LATER
@@ -65,6 +65,9 @@ public class EnergyGeneratorBlockEntity extends AEBaseBlockEntity implements Tic
for (Direction facing : Direction.values()) {
final BlockEntity te = this.getWorld().getBlockEntity(this.getPos().offset(facing));
if (te == null) {
continue;
}
final LazyOptional<IEnergyStorage> cap = te.getCapability(CapabilityEnergy.ENERGY, facing.getOpposite());
cap.ifPresent(consumer -> {
@@ -0,0 +1,27 @@
package appeng.fluids.items;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fluids.FluidStack;
@OnlyIn(Dist.CLIENT)
public class FluidDummyItemColor implements IItemColor {
@Override
public int getColor(ItemStack stack, int tintIndex) {
Item item = stack.getItem();
if (!(item instanceof FluidDummyItem)) {
return -1;
}
FluidDummyItem fluidItem = (FluidDummyItem) item;
FluidStack fluidStack = fluidItem.getFluidStack(stack);
return fluidStack.getFluid().getAttributes().getColor(fluidStack);
}
}
@@ -1,35 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2018, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.fluids.items;
import appeng.bootstrap.IItemRendering;
import appeng.bootstrap.ItemRenderingCustomizer;
/**
* @author DrummerMC
* @version rv6 - 2018-01-22
* @since rv6 2018-01-22
*/
public class FluidDummyItemRendering extends ItemRenderingCustomizer {
@Override
public void customize(IItemRendering rendering) {
// FIXME rendering.builtInModel( "models/item/dummy_fluid_item", new
// DummyFluidItemModel() );
}
}
+1 -10
View File
@@ -95,16 +95,7 @@ public class PathGridCache implements IPathingGrid {
this.updateNetwork = false;
this.setChannelsInUse(0);
if (!AEConfig.instance().isFeatureEnabled(AEFeature.CHANNELS)) {
final int used = this.calculateRequiredChannels();
final int nodes = this.myGrid.getNodes().size();
this.ticksUntilReady = 20 + Math.max(0, nodes / 100 - 20);
this.setChannelsByBlocks(nodes * used);
this.setChannelPowerUsage(this.getChannelsByBlocks() / 128.0);
this.myGrid.getPivot().beginVisit(new AdHocChannelUpdater(used));
} else if (this.controllerState == ControllerState.NO_CONTROLLER) {
if (this.controllerState == ControllerState.NO_CONTROLLER) {
final int requiredChannels = this.calculateRequiredChannels();
int used = requiredChannels;
if (requiredChannels > 8) {
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
@@ -36,8 +37,8 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.util.Direction;
import net.minecraft.util.Identifier;
import net.minecraftforge.registries.ForgeRegistries;
import appeng.api.AEApi;
@@ -111,6 +112,12 @@ public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestO
this.inventoryHandlers = new IdentityHashMap<>();
}
@Override
public void setOrientation(Direction inForward, Direction inUp) {
super.setOrientation(inForward, inUp);
this.getProxy().setValidSides(EnumSet.complementOf(EnumSet.of(inForward)));
}
@Override
protected void writeToStream(final PacketByteBuf data) throws IOException {
super.writeToStream(data);