Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17b919a171 | |||
| 003ef8672c | |||
| eaf2873649 | |||
| 66d00a4600 | |||
| d79d284690 | |||
| 7233b11284 | |||
| d5491549eb | |||
| f943106419 | |||
| 57fa5576af | |||
| 346e58ff25 | |||
| 42c2be5c05 | |||
| 312abce956 | |||
| 6379cfe3a2 | |||
| 208cd70725 | |||
| 130fc74768 | |||
| 6bbea481b8 | |||
| 55d7ac82e5 |
@@ -129,11 +129,6 @@ public abstract class AEBaseBlock extends Block {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
|
||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
public final Direction mapRotation(final IOrientable ori, final Direction dir) {
|
||||
// case DOWN: return bottomIcon;
|
||||
// case UP: return blockIcon;
|
||||
|
||||
@@ -278,6 +278,11 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
return this.onActivated(world, pos, player, hand, player.getHeldItem(hand), hit);
|
||||
}
|
||||
|
||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
|
||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockReader w, final BlockPos pos) {
|
||||
return this.getTileEntity(w, pos);
|
||||
|
||||
@@ -67,17 +67,18 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
|
||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
||||
if (heldItem != null && heldItem.getItem() == Items.FLINT_AND_STEEL) {
|
||||
this.startFuse(w, pos, player);
|
||||
w.removeBlock(pos, false);
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player,
|
||||
Hand handIn, BlockRayTraceResult hit) {
|
||||
ItemStack heldItem = player.getHeldItem(handIn);
|
||||
if (!heldItem.isEmpty() && heldItem.getItem() == Items.FLINT_AND_STEEL) {
|
||||
this.startFuse(world, pos, player);
|
||||
world.removeBlock(pos, false);
|
||||
heldItem.damageItem(1, player, p -> {
|
||||
p.sendBreakAnimation(hand);
|
||||
p.sendBreakAnimation(handIn);
|
||||
}); // FIXME Check if onBroken is equivalent
|
||||
return ActionResultType.SUCCESS;
|
||||
} else {
|
||||
return super.onActivated(w, pos, player, hand, heldItem, hit);
|
||||
return super.onBlockActivated(state, world, pos, player, handIn, hit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||
|
||||
public CableBusBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE).notSolid().noDrops());
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE).notSolid().noDrops().variableOpacity());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -63,7 +63,7 @@ public class DriveBakedModel extends DelegateBakedModel {
|
||||
|
||||
DriveSlotsState slotsState = driveModelData.getSlotsState();
|
||||
|
||||
if (side == null && slotsState != null) {
|
||||
if (slotsState != null) {
|
||||
for (int row = 0; row < 5; row++) {
|
||||
for (int col = 0; col < 2; col++) {
|
||||
Matrix4f transform = new Matrix4f();
|
||||
@@ -80,7 +80,7 @@ public class DriveBakedModel extends DelegateBakedModel {
|
||||
// Add the drive chassis
|
||||
Item cell = slotsState.getCell(slot);
|
||||
IBakedModel cellChassisModel = getCellChassisModel(cell);
|
||||
addModel(state, rand, extraData, result, cellChassisModel, transform);
|
||||
addModel(state, rand, extraData, result, side, cellChassisModel, transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,9 +112,9 @@ public class DriveBakedModel extends DelegateBakedModel {
|
||||
}
|
||||
|
||||
private static void addModel(@Nullable BlockState state, @Nonnull Random rand, @Nonnull IModelData extraData,
|
||||
List<BakedQuad> result, IBakedModel bakedCell, Matrix4f transform) {
|
||||
List<BakedQuad> result, Direction side, IBakedModel bakedCell, Matrix4f transform) {
|
||||
MatrixVertexTransformer transformer = new MatrixVertexTransformer(transform);
|
||||
for (BakedQuad bakedQuad : bakedCell.getQuads(state, null, rand, extraData)) {
|
||||
for (BakedQuad bakedQuad : bakedCell.getQuads(state, side, rand, extraData)) {
|
||||
BakedQuadBuilder builder = new BakedQuadBuilder();
|
||||
transformer.setParent(builder);
|
||||
transformer.setVertexFormat(builder.getVertexFormat());
|
||||
|
||||
@@ -3,6 +3,7 @@ package appeng.client.render.tesr;
|
||||
import java.util.EnumMap;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
@@ -14,7 +15,6 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
import appeng.block.storage.DriveSlotState;
|
||||
import appeng.client.render.FacingToRotation;
|
||||
@@ -26,6 +26,14 @@ import appeng.tile.storage.DriveTileEntity;
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class DriveLedTileEntityRenderer extends TileEntityRenderer<DriveTileEntity> {
|
||||
|
||||
private static final RenderState.TransparencyState TRANSLUCENT_TRANSPARENCY = new RenderState.TransparencyState(
|
||||
"translucent_transparency", () -> {
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
}, () -> {
|
||||
RenderSystem.disableBlend();
|
||||
});
|
||||
|
||||
private static final EnumMap<DriveSlotState, Vector3f> STATE_COLORS;
|
||||
|
||||
// Color used for the cell indicator for blinking during recent activity
|
||||
@@ -80,8 +88,6 @@ public class DriveLedTileEntityRenderer extends TileEntityRenderer<DriveTileEnti
|
||||
FacingToRotation.get(drive.getForward(), drive.getUp()).push(ms);
|
||||
ms.translate(-0.5, -0.5, -0.5);
|
||||
|
||||
RenderState.TransparencyState TRANSLUCENT_TRANSPARENCY = ObfuscationReflectionHelper
|
||||
.getPrivateValue(RenderState.class, null, "field_228515_g_");
|
||||
RenderType rt = RenderType.makeType("ae_drive_leds", DefaultVertexFormats.POSITION_COLOR, 7, 32565, false, true,
|
||||
RenderType.State.getBuilder().transparency(TRANSLUCENT_TRANSPARENCY).build(false));
|
||||
IVertexBuilder buffer = buffers.getBuffer(STATE);
|
||||
@@ -125,6 +131,10 @@ public class DriveLedTileEntityRenderer extends TileEntityRenderer<DriveTileEnti
|
||||
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)
|
||||
|
||||
@@ -128,15 +128,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
|
||||
|
||||
@@ -203,7 +203,7 @@ public final class AEConfig {
|
||||
}
|
||||
|
||||
public boolean isFeatureEnabled(final AEFeature f) {
|
||||
return this.featureFlags.contains(f);
|
||||
return (!f.isConfig() && f.isEnabled()) || this.featureFlags.contains(f);
|
||||
}
|
||||
|
||||
public boolean areFeaturesEnabled(Collection<AEFeature> features) {
|
||||
|
||||
@@ -340,8 +340,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));
|
||||
}
|
||||
|
||||
public void registerEntities(RegistryEvent.Register<EntityType<?>> event) {
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.function.Consumer;
|
||||
import net.minecraft.entity.EntityClassification;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
@@ -31,6 +33,8 @@ import appeng.api.features.AEFeature;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEColoredItemDefinition;
|
||||
import appeng.bootstrap.FeatureFactory;
|
||||
import appeng.bootstrap.IItemRendering;
|
||||
import appeng.bootstrap.ItemRenderingCustomizer;
|
||||
import appeng.core.features.ActivityState;
|
||||
import appeng.core.features.ColoredItemDefinition;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
@@ -42,7 +46,7 @@ import appeng.debug.ReplicatorCardItem;
|
||||
import appeng.entity.GrowingCrystalEntity;
|
||||
import appeng.fluids.items.BasicFluidStorageCell;
|
||||
import appeng.fluids.items.FluidDummyItem;
|
||||
import appeng.fluids.items.FluidDummyItemRendering;
|
||||
import appeng.fluids.items.FluidDummyItemColor;
|
||||
import appeng.hooks.BlockToolDispenseItemBehavior;
|
||||
import appeng.hooks.MatterCannonDispenseItemBehavior;
|
||||
import appeng.items.materials.MaterialType;
|
||||
@@ -303,7 +307,13 @@ public final class ApiItems implements IItems {
|
||||
debugTools.item("debug_part_placer", DebugPartPlacerItem::new).build();
|
||||
|
||||
this.dummyFluidItem = registry.item("dummy_fluid_item", FluidDummyItem::new)
|
||||
.rendering(new FluidDummyItemRendering()).build();
|
||||
.rendering(new ItemRenderingCustomizer() {
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void customize(IItemRendering rendering) {
|
||||
rendering.color(new FluidDummyItemColor());
|
||||
}
|
||||
}).build();
|
||||
}
|
||||
|
||||
private static AEColoredItemDefinition createPaintBalls(FeatureFactory registry, String idSuffix, boolean lumen) {
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2015, 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.core.worlddata;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.network.NetworkManager;
|
||||
|
||||
import appeng.api.util.WorldCoord;
|
||||
|
||||
/**
|
||||
* @author thatsIch
|
||||
* @version rv3 - 30.05.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
public interface IWorldDimensionData {
|
||||
void addStorageCell(int newStorageCellID);
|
||||
|
||||
WorldCoord getStoredSize(int dim);
|
||||
|
||||
void setStoredSize(int dim, int targetX, int targetY, int targetZ);
|
||||
|
||||
void sendToPlayer(@Nullable NetworkManager manager);
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2015, 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.core.worlddata;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.world.dimension.Dimension;
|
||||
|
||||
/**
|
||||
* @author thatsIch
|
||||
* @version rv3 - 30.05.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
public interface IWorldSpawnData {
|
||||
void setGenerated(Dimension dim, int chunkX, int chunkZ);
|
||||
|
||||
boolean hasGenerated(Dimension dim, int chunkX, int chunkZ);
|
||||
|
||||
boolean addNearByMeteorites(Dimension dim, int chunkX, int chunkZ, CompoundNBT newData);
|
||||
|
||||
Collection<CompoundNBT> getNearByMeteorites(Dimension dim, int chunkX, int chunkZ);
|
||||
}
|
||||
@@ -65,6 +65,9 @@ public class EnergyGeneratorTileEntity extends AEBaseTileEntity implements ITick
|
||||
|
||||
for (Direction facing : Direction.values()) {
|
||||
final TileEntity te = this.getWorld().getTileEntity(this.getPos().offset(facing));
|
||||
if (te == null) {
|
||||
continue;
|
||||
}
|
||||
final LazyOptional<IEnergyStorage> cap = te.getCapability(CapabilityEnergy.ENERGY, facing.getOpposite());
|
||||
|
||||
cap.ifPresent(consumer -> {
|
||||
|
||||
@@ -20,6 +20,8 @@ package appeng.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -29,6 +31,7 @@ import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.MoverType;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.item.TNTEntity;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -40,6 +43,7 @@ import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.Explosion.Mode;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.features.AEFeature;
|
||||
@@ -52,6 +56,8 @@ public final class TinyTNTPrimedEntity extends TNTEntity implements IEntityAddit
|
||||
|
||||
public static EntityType<TinyTNTPrimedEntity> TYPE;
|
||||
|
||||
private LivingEntity placedBy;
|
||||
|
||||
public TinyTNTPrimedEntity(EntityType<? extends TinyTNTPrimedEntity> type, World worldIn) {
|
||||
super(type, worldIn);
|
||||
this.preventEntitySpawning = true;
|
||||
@@ -59,7 +65,21 @@ public final class TinyTNTPrimedEntity extends TNTEntity implements IEntityAddit
|
||||
|
||||
public TinyTNTPrimedEntity(final World w, final double x, final double y, final double z,
|
||||
final LivingEntity igniter) {
|
||||
super(w, x, y, z, igniter);
|
||||
super(TYPE, w);
|
||||
this.setPosition(x, y, z);
|
||||
double d0 = w.rand.nextDouble() * (double) ((float) Math.PI * 2F);
|
||||
this.setMotion(-Math.sin(d0) * 0.02D, (double) 0.2F, -Math.cos(d0) * 0.02D);
|
||||
this.setFuse(80);
|
||||
this.prevPosX = x;
|
||||
this.prevPosY = y;
|
||||
this.prevPosZ = z;
|
||||
this.placedBy = igniter;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public LivingEntity getTntPlacedBy() {
|
||||
return this.placedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,6 +190,11 @@ public final class TinyTNTPrimedEntity extends TNTEntity implements IEntityAddit
|
||||
new MockExplosionPacket(this.getPosX(), this.getPosY(), this.getPosZ()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacket<?> createSpawnPacket() {
|
||||
return NetworkHooks.getEntitySpawningPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSpawnData(PacketBuffer buffer) {
|
||||
buffer.writeByte(this.getFuse());
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TinyTNTPrimedRenderer extends EntityRenderer<TinyTNTPrimedEntity> {
|
||||
|
||||
public TinyTNTPrimedRenderer(final EntityRendererManager manager) {
|
||||
super(manager);
|
||||
this.shadowSize = 0.5F;
|
||||
this.shadowSize = 0.25F;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@ import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.fluid.EmptyFluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -240,26 +239,25 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
|
||||
public static IAEFluidStack fromPacket(final PacketBuffer buffer) {
|
||||
final boolean isCraftable = buffer.readBoolean();
|
||||
final FluidStack fluidStack = buffer.readFluidStack();
|
||||
Fluid fluid = buffer.readRegistryIdUnsafe(ForgeRegistries.FLUIDS);
|
||||
CompoundNBT tag = buffer.readCompoundTag();
|
||||
|
||||
final long stackSize = buffer.readVarLong();
|
||||
final long countRequestable = buffer.readVarLong();
|
||||
|
||||
if (fluidStack.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final AEFluidStack fluid = AEFluidStack.fromFluidStack(fluidStack);
|
||||
fluid.setStackSize(stackSize);
|
||||
fluid.setCountRequestable(countRequestable);
|
||||
fluid.setCraftable(isCraftable);
|
||||
return fluid;
|
||||
final AEFluidStack stack = new AEFluidStack(fluid, stackSize, tag);
|
||||
stack.setCountRequestable(countRequestable);
|
||||
stack.setCraftable(isCraftable);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToPacket(final PacketBuffer buffer) {
|
||||
buffer.writeBoolean(this.isCraftable());
|
||||
buffer.writeFluidStack(this.getFluidStack());
|
||||
// Cannot use writeFluidStack here because for FluidStacks with amount==0, it
|
||||
// will not write the fluid
|
||||
buffer.writeRegistryIdUnsafe(ForgeRegistries.FLUIDS, fluid);
|
||||
buffer.writeCompoundTag(getFluidStack().getTag());
|
||||
buffer.writeVarLong(this.getStackSize());
|
||||
buffer.writeVarLong(this.getCountRequestable());
|
||||
}
|
||||
|
||||
+1
-10
@@ -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;
|
||||
@@ -35,6 +36,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
@@ -111,6 +113,12 @@ public class DriveTileEntity extends AENetworkInvTileEntity implements IChestOrD
|
||||
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 PacketBuffer data) throws IOException {
|
||||
super.writeToStream(data);
|
||||
|
||||
@@ -13,9 +13,16 @@ version="${file.jarVersion}"
|
||||
displayName="Applied Energistics 2"
|
||||
description="A Mod about Matter, Energy and using them to conquer the world.."
|
||||
|
||||
[[dependencies.jei]]
|
||||
[[dependencies.appliedenergistics2]]
|
||||
modId="forge"
|
||||
mandatory=true
|
||||
versionRange="[31.0.0,)"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
side="BOTH"
|
||||
|
||||
[[dependencies.appliedenergistics2]]
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.15.2]"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
@@ -14,10 +14,23 @@
|
||||
"from": [0, 1, 0],
|
||||
"to": [1, 15, 16],
|
||||
"faces": {
|
||||
"north": { "uv": [15, 1, 16, 15], "texture": "#front" },
|
||||
"east": { "uv": [0, 0, 16, 16], "rotation": 180, "texture": "#inside" },
|
||||
"south": { "uv": [0, 1, 1, 15], "texture": "#side" },
|
||||
"west": { "uv": [0, 1, 16, 15], "texture": "#side" }
|
||||
"north": {
|
||||
"uv": [15, 1, 16, 15],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"east": {
|
||||
"uv": [0, 0, 16, 16],
|
||||
"rotation": 180,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
},
|
||||
"south": {
|
||||
"uv": [0, 1, 1, 15],
|
||||
"texture": "#side",
|
||||
"cullface": "south"
|
||||
},
|
||||
"west": { "uv": [0, 1, 16, 15], "texture": "#side", "cullface": "west" }
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -25,10 +38,26 @@
|
||||
"from": [15, 1, 0],
|
||||
"to": [16, 15, 16],
|
||||
"faces": {
|
||||
"north": { "uv": [0, 1, 1, 15], "texture": "#front" },
|
||||
"east": { "uv": [0, 1, 16, 15], "texture": "#side" },
|
||||
"south": { "uv": [15, 1, 16, 15], "texture": "#side" },
|
||||
"west": { "uv": [0, 0, 16, 16], "texture": "#inside" }
|
||||
"north": {
|
||||
"uv": [0, 1, 1, 15],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"east": {
|
||||
"uv": [0, 1, 16, 15],
|
||||
"texture": "#side",
|
||||
"cullface": "east"
|
||||
},
|
||||
"south": {
|
||||
"uv": [15, 1, 16, 15],
|
||||
"texture": "#side",
|
||||
"cullface": "south"
|
||||
},
|
||||
"west": {
|
||||
"uv": [0, 0, 16, 16],
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -38,7 +67,11 @@
|
||||
"rotation": { "angle": 0, "axis": "y", "origin": [8, 8, 9] },
|
||||
"faces": {
|
||||
"north": { "uv": [15, 1, 16, 15], "texture": "#inside" },
|
||||
"south": { "uv": [1, 1, 15, 15], "texture": "#side" }
|
||||
"south": {
|
||||
"uv": [1, 1, 15, 15],
|
||||
"texture": "#side",
|
||||
"cullface": "south"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -46,12 +79,37 @@
|
||||
"from": [0, 0, 0],
|
||||
"to": [16, 1, 16],
|
||||
"faces": {
|
||||
"north": { "uv": [0, 15, 16, 16], "texture": "#front" },
|
||||
"east": { "uv": [0, 15, 16, 16], "texture": "#side" },
|
||||
"south": { "uv": [0, 15, 16, 16], "texture": "#side" },
|
||||
"west": { "uv": [0, 15, 16, 16], "texture": "#side" },
|
||||
"up": { "uv": [0, 0, 16, 16], "rotation": 90, "texture": "#inside" },
|
||||
"down": { "uv": [0, 0, 16, 16], "texture": "#bottom" }
|
||||
"north": {
|
||||
"uv": [0, 15, 16, 16],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"east": {
|
||||
"uv": [0, 15, 16, 16],
|
||||
"texture": "#side",
|
||||
"cullface": "east"
|
||||
},
|
||||
"south": {
|
||||
"uv": [0, 15, 16, 16],
|
||||
"texture": "#side",
|
||||
"cullface": "south"
|
||||
},
|
||||
"west": {
|
||||
"uv": [0, 15, 16, 16],
|
||||
"texture": "#side",
|
||||
"cullface": "west"
|
||||
},
|
||||
"up": {
|
||||
"uv": [0, 0, 16, 16],
|
||||
"rotation": 90,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
},
|
||||
"down": {
|
||||
"uv": [0, 0, 16, 16],
|
||||
"texture": "#bottom",
|
||||
"cullface": "down"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -59,12 +117,25 @@
|
||||
"from": [0, 15, 0],
|
||||
"to": [16, 16, 16],
|
||||
"faces": {
|
||||
"north": { "uv": [0, 0, 16, 1], "texture": "#front" },
|
||||
"east": { "uv": [0, 0, 16, 1], "texture": "#side" },
|
||||
"south": { "uv": [0, 0, 16, 1], "texture": "#side" },
|
||||
"west": { "uv": [0, 0, 16, 1], "texture": "#side" },
|
||||
"up": { "uv": [0, 0, 16, 16], "texture": "#top" },
|
||||
"down": { "uv": [0, 0, 16, 16], "rotation": 270, "texture": "#inside" }
|
||||
"north": {
|
||||
"uv": [0, 0, 16, 1],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"east": { "uv": [0, 0, 16, 1], "texture": "#side", "cullface": "east" },
|
||||
"south": {
|
||||
"uv": [0, 0, 16, 1],
|
||||
"texture": "#side",
|
||||
"cullface": "south"
|
||||
},
|
||||
"west": { "uv": [0, 0, 16, 1], "texture": "#side", "cullface": "west" },
|
||||
"up": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "up" },
|
||||
"down": {
|
||||
"uv": [0, 0, 16, 16],
|
||||
"rotation": 270,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -72,9 +143,22 @@
|
||||
"from": [7, 1, 1],
|
||||
"to": [9, 15, 7],
|
||||
"faces": {
|
||||
"north": { "uv": [7, 1, 9, 15], "texture": "#front" },
|
||||
"east": { "uv": [1, 1, 7, 15], "rotation": 180, "texture": "#inside" },
|
||||
"west": { "uv": [1, 1, 7, 15], "texture": "#inside" }
|
||||
"north": {
|
||||
"uv": [7, 1, 9, 15],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"east": {
|
||||
"uv": [1, 1, 7, 15],
|
||||
"rotation": 180,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
},
|
||||
"west": {
|
||||
"uv": [1, 1, 7, 15],
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -82,9 +166,23 @@
|
||||
"from": [1, 3, 2],
|
||||
"to": [15, 4, 7],
|
||||
"faces": {
|
||||
"north": { "uv": [1, 12, 15, 13], "texture": "#front" },
|
||||
"up": { "uv": [2, 1, 7, 15], "rotation": 90, "texture": "#inside" },
|
||||
"down": { "uv": [2, 1, 7, 15], "rotation": 270, "texture": "#inside" }
|
||||
"north": {
|
||||
"uv": [1, 12, 15, 13],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"up": {
|
||||
"uv": [2, 1, 7, 15],
|
||||
"rotation": 90,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
},
|
||||
"down": {
|
||||
"uv": [2, 1, 7, 15],
|
||||
"rotation": 270,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -92,9 +190,23 @@
|
||||
"from": [1, 6, 2],
|
||||
"to": [15, 7, 7],
|
||||
"faces": {
|
||||
"north": { "uv": [1, 9, 15, 10], "texture": "#front" },
|
||||
"up": { "uv": [2, 1, 7, 15], "rotation": 90, "texture": "#inside" },
|
||||
"down": { "uv": [2, 1, 7, 15], "rotation": 270, "texture": "#inside" }
|
||||
"north": {
|
||||
"uv": [1, 9, 15, 10],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"up": {
|
||||
"uv": [2, 1, 7, 15],
|
||||
"rotation": 90,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
},
|
||||
"down": {
|
||||
"uv": [2, 1, 7, 15],
|
||||
"rotation": 270,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -102,9 +214,23 @@
|
||||
"from": [1, 9, 2],
|
||||
"to": [15, 10, 7],
|
||||
"faces": {
|
||||
"north": { "uv": [1, 6, 15, 7], "texture": "#front" },
|
||||
"up": { "uv": [2, 1, 7, 15], "rotation": 90, "texture": "#inside" },
|
||||
"down": { "uv": [2, 1, 7, 15], "rotation": 270, "texture": "#inside" }
|
||||
"north": {
|
||||
"uv": [1, 6, 15, 7],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"up": {
|
||||
"uv": [2, 1, 7, 15],
|
||||
"rotation": 90,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
},
|
||||
"down": {
|
||||
"uv": [2, 1, 7, 15],
|
||||
"rotation": 270,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -112,9 +238,23 @@
|
||||
"from": [1, 12, 2],
|
||||
"to": [15, 13, 7],
|
||||
"faces": {
|
||||
"north": { "uv": [1, 3, 15, 4], "texture": "#front" },
|
||||
"up": { "uv": [2, 1, 7, 15], "rotation": 90, "texture": "#inside" },
|
||||
"down": { "uv": [2, 1, 7, 15], "rotation": 270, "texture": "#inside" }
|
||||
"north": {
|
||||
"uv": [1, 3, 15, 4],
|
||||
"texture": "#front",
|
||||
"cullface": "north"
|
||||
},
|
||||
"up": {
|
||||
"uv": [2, 1, 7, 15],
|
||||
"rotation": 90,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
},
|
||||
"down": {
|
||||
"uv": [2, 1, 7, 15],
|
||||
"rotation": 270,
|
||||
"texture": "#inside",
|
||||
"cullface": "north"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"textures": {
|
||||
"cell": "appliedenergistics2:block/drive/item_cell"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Cell Backdrop",
|
||||
"from": [9, 13, 1],
|
||||
"to": [15, 15, 3],
|
||||
"rotation": { "angle": 0, "axis": "y", "origin": [9, 8, 8] },
|
||||
"faces": {
|
||||
"north": {
|
||||
"uv": [0, 2, 6, 4],
|
||||
"texture": "#cell",
|
||||
"cullface": "north"
|
||||
},
|
||||
"up": { "uv": [0, 0, 6, 2], "texture": "#cell", "cullface": "north" },
|
||||
"down": { "uv": [0, 4, 6, 6], "texture": "#cell", "cullface": "north" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+3
-15
@@ -1,18 +1,6 @@
|
||||
{
|
||||
"parent": "appliedenergistics2:block/drive/drive_cell",
|
||||
"textures": {
|
||||
"front": "appliedenergistics2:block/drive/fluid_cell"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Cell Backdrop",
|
||||
"from": [9, 13, 1],
|
||||
"to": [15, 15, 3],
|
||||
"rotation": { "angle": 0, "axis": "y", "origin": [9, 8, 8] },
|
||||
"faces": {
|
||||
"north": { "uv": [0, 2, 6, 4], "texture": "#front" },
|
||||
"up": { "uv": [0, 0, 6, 2], "texture": "#front" },
|
||||
"down": { "uv": [0, 4, 6, 6], "texture": "#front" }
|
||||
}
|
||||
}
|
||||
]
|
||||
"cell": "appliedenergistics2:block/drive/fluid_cell"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-15
@@ -1,18 +1,6 @@
|
||||
{
|
||||
"parent": "appliedenergistics2:block/drive/drive_cell",
|
||||
"textures": {
|
||||
"front": "appliedenergistics2:block/drive/item_cell"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Cell Backdrop",
|
||||
"from": [9, 13, 1],
|
||||
"to": [15, 15, 3],
|
||||
"rotation": { "angle": 0, "axis": "y", "origin": [9, 8, 8] },
|
||||
"faces": {
|
||||
"north": { "uv": [0, 2, 6, 4], "texture": "#front" },
|
||||
"up": { "uv": [0, 0, 6, 2], "texture": "#front" },
|
||||
"down": { "uv": [0, 4, 6, 6], "texture": "#front" }
|
||||
}
|
||||
}
|
||||
]
|
||||
"cell": "appliedenergistics2:block/drive/item_cell"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"loader": "appliedenergistics2:dummy_fluid_item"
|
||||
}
|
||||
Reference in New Issue
Block a user