Merge remote-tracking branch 'origin/master' into fabric-1.16
# Conflicts: # gradle.properties # src/main/java/appeng/block/AEBaseBlock.java # src/main/java/appeng/block/misc/QuartzFixtureBlock.java # src/main/java/appeng/block/misc/TinyTNTBlock.java # src/main/java/appeng/block/networking/CableBusBlock.java # src/main/java/appeng/helpers/AEMaterials.java # src/unported/java/appeng/block/misc/ChargerBlock.java # src/unported/java/appeng/block/networking/CreativeEnergyCellBlock.java # src/unported/java/appeng/block/networking/EnergyCellBlock.java # src/unported/java/appeng/block/networking/WirelessBlock.java # src/unported/java/appeng/block/paint/PaintSplotchesBlock.java # src/unported/java/appeng/block/qnb/QuantumLinkChamberBlock.java # src/unported/java/appeng/block/spatial/SpatialPylonBlock.java # src/unported/java/appeng/client/render/tesr/DriveLedTileEntityRenderer.java # src/unported/java/appeng/tile/storage/ChestBlockEntity.java
This commit is contained in:
@@ -50,5 +50,5 @@ public enum CellState {
|
|||||||
/**
|
/**
|
||||||
* Full cell, technically could have free types
|
* Full cell, technically could have free types
|
||||||
*/
|
*/
|
||||||
FULL,
|
FULL;
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
|||||||
|
|
||||||
import appeng.api.util.IOrientable;
|
import appeng.api.util.IOrientable;
|
||||||
import appeng.api.util.IOrientableBlock;
|
import appeng.api.util.IOrientableBlock;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEMaterials;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
public abstract class AEBaseBlock extends Block {
|
public abstract class AEBaseBlock extends Block {
|
||||||
@@ -74,7 +74,7 @@ public abstract class AEBaseBlock extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static BlockSoundGroup getDefaultSoundByMaterial(Material mat) {
|
private static BlockSoundGroup getDefaultSoundByMaterial(Material mat) {
|
||||||
if (mat == AEGlassMaterial.INSTANCE || mat == Material.GLASS) {
|
if (mat == AEMaterials.GLASS || mat == Material.GLASS) {
|
||||||
return BlockSoundGroup.GLASS;
|
return BlockSoundGroup.GLASS;
|
||||||
} else if (mat == Material.STONE) {
|
} else if (mat == Material.STONE) {
|
||||||
return BlockSoundGroup.STONE;
|
return BlockSoundGroup.STONE;
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
|
|
||||||
package appeng.block.misc;
|
package appeng.block.misc;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import appeng.client.render.cablebus.CableBusBakedModel;
|
|||||||
import appeng.client.render.cablebus.CableBusBreakingParticle;
|
import appeng.client.render.cablebus.CableBusBreakingParticle;
|
||||||
import appeng.client.render.cablebus.CableBusRenderState;
|
import appeng.client.render.cablebus.CableBusRenderState;
|
||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEMaterials;
|
||||||
import appeng.integration.abstraction.IAEFacade;
|
import appeng.integration.abstraction.IAEFacade;
|
||||||
import appeng.parts.ICableBusContainer;
|
import appeng.parts.ICableBusContainer;
|
||||||
import appeng.parts.NullCableBusContainer;
|
import appeng.parts.NullCableBusContainer;
|
||||||
@@ -75,7 +75,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
|||||||
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||||
|
|
||||||
public CableBusBlock() {
|
public CableBusBlock() {
|
||||||
super(defaultProps(AEGlassMaterial.INSTANCE)
|
super(defaultProps(AEMaterials.GLASS)
|
||||||
.nonOpaque()
|
.nonOpaque()
|
||||||
.dropsNothing()
|
.dropsNothing()
|
||||||
.dynamicBounds());
|
.dynamicBounds());
|
||||||
@@ -172,11 +172,12 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
|||||||
// FIXME FABRIC @Override
|
// FIXME FABRIC @Override
|
||||||
// FIXME FABRIC public boolean canConnectRedstone(final BlockState state, final BlockView w, final BlockPos pos,
|
// FIXME FABRIC public boolean canConnectRedstone(final BlockState state, final BlockView w, final BlockPos pos,
|
||||||
// FIXME FABRIC Direction side) {
|
// FIXME FABRIC Direction side) {
|
||||||
|
// FIXME FABRIC // TODO: Verify this.
|
||||||
// FIXME FABRIC if (side == null) {
|
// FIXME FABRIC if (side == null) {
|
||||||
// FIXME FABRIC side = Direction.UP;
|
// FIXME FABRIC return false;
|
||||||
// FIXME FABRIC }
|
// FIXME FABRIC }
|
||||||
// FIXME FABRIC
|
// FIXME FABRIC
|
||||||
// FIXME FABRIC return this.cb(w, pos).canConnectRedstone(EnumSet.of(side));
|
// FIXME FABRIC return this.cb(w, pos).canConnectRedstone(side.getOpposite());
|
||||||
// FIXME FABRIC }
|
// FIXME FABRIC }
|
||||||
|
|
||||||
public ItemStack getPickBlock(BlockState state, HitResult target, BlockView world, BlockPos pos,
|
public ItemStack getPickBlock(BlockState state, HitResult target, BlockView world, BlockPos pos,
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ final class PlayerData extends PersistentState implements IWorldPlayerData {
|
|||||||
this.mapping.put(profile.getId(), playerId);
|
this.mapping.put(profile.getId(), playerId);
|
||||||
markDirty();
|
markDirty();
|
||||||
|
|
||||||
AELog.info("Assigning ME player id {} to Minecraft profile {} ({})", playerId, profile.getId(),
|
AELog.info("Assigning ME player id %s to Minecraft profile %s (%s)", playerId, profile.getId(),
|
||||||
profile.getName());
|
profile.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ final class PlayerData extends PersistentState implements IWorldPlayerData {
|
|||||||
UUID profileId = new UUID(profileIds[i * 2], profileIds[i * 2 + 1]);
|
UUID profileId = new UUID(profileIds[i * 2], profileIds[i * 2 + 1]);
|
||||||
highestPlayerId = Math.max(playerId, highestPlayerId);
|
highestPlayerId = Math.max(playerId, highestPlayerId);
|
||||||
mapping.put(profileId, playerId);
|
mapping.put(profileId, playerId);
|
||||||
AELog.debug("AE player ID {} is assigned to profile ID {}", playerId, profileId);
|
AELog.debug("AE player ID %s is assigned to profile ID %s", playerId, profileId);
|
||||||
}
|
}
|
||||||
this.nextPlayerId = highestPlayerId + 1;
|
this.nextPlayerId = highestPlayerId + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import net.minecraft.block.BlockState;
|
|||||||
import net.minecraft.block.Material;
|
import net.minecraft.block.Material;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
|
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEMaterials;
|
||||||
|
|
||||||
public class QuartzGlassBlock extends AbstractGlassBlock {
|
public class QuartzGlassBlock extends AbstractGlassBlock {
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class QuartzGlassBlock extends AbstractGlassBlock {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, Direction side) {
|
public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, Direction side) {
|
||||||
final Material mat = adjacentBlockState.getMaterial();
|
final Material mat = adjacentBlockState.getMaterial();
|
||||||
if (mat == Material.GLASS || mat == AEGlassMaterial.INSTANCE) {
|
if (mat == Material.GLASS || mat == AEMaterials.GLASS) {
|
||||||
if (adjacentBlockState.getRenderType() == state.getRenderType()) {
|
if (adjacentBlockState.getRenderType() == state.getRenderType()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -22,9 +22,9 @@ import net.minecraft.block.Material;
|
|||||||
import net.minecraft.block.MaterialColor;
|
import net.minecraft.block.MaterialColor;
|
||||||
import net.minecraft.block.piston.PistonBehavior;
|
import net.minecraft.block.piston.PistonBehavior;
|
||||||
|
|
||||||
public class AEGlassMaterial {
|
public class AEMaterials {
|
||||||
|
|
||||||
public static final Material INSTANCE = new Material(MaterialColor.CLEAR, false, false, true, false, false,
|
public static final Material GLASS = new Material(MaterialColor.CLEAR, false, false, true, false, false,
|
||||||
false, PistonBehavior.NORMAL);
|
false, PistonBehavior.NORMAL);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -624,14 +624,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectRedstone(final EnumSet<Direction> enumSet) {
|
public boolean canConnectRedstone(final Direction opposite) {
|
||||||
for (final Direction dir : enumSet) {
|
final IPart part = this.getPart(opposite);
|
||||||
final IPart part = this.getPart(dir);
|
return part != null && part.canConnectRedstone();
|
||||||
if (part != null && part.canConnectRedstone()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
package appeng.parts;
|
package appeng.parts;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
@@ -43,7 +42,7 @@ public interface ICableBusContainer {
|
|||||||
|
|
||||||
int isProvidingWeakPower(Direction opposite);
|
int isProvidingWeakPower(Direction opposite);
|
||||||
|
|
||||||
boolean canConnectRedstone(EnumSet<Direction> of);
|
boolean canConnectRedstone(Direction opposite);
|
||||||
|
|
||||||
void onEntityCollision(Entity e);
|
void onEntityCollision(Entity e);
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
package appeng.parts;
|
package appeng.parts;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -48,7 +47,7 @@ public class NullCableBusContainer implements ICableBusContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectRedstone(final EnumSet<Direction> of) {
|
public boolean canConnectRedstone(final Direction opposite) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"slot_state": "online|types_full|full"
|
"slot_state": "online|not_empty|types_full|full"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "appliedenergistics2:block/chest/lights_on"
|
"model": "appliedenergistics2:block/chest/lights_on"
|
||||||
@@ -45,6 +45,14 @@
|
|||||||
"model": "appliedenergistics2:block/chest/cell_state_online"
|
"model": "appliedenergistics2:block/chest/cell_state_online"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"when": {
|
||||||
|
"slot_state": "not_empty"
|
||||||
|
},
|
||||||
|
"apply": {
|
||||||
|
"model": "appliedenergistics2:block/chest/cell_state_not_empty"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"slot_state": "types_full"
|
"slot_state": "types_full"
|
||||||
|
|||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"loader": "appliedenergistics2:uvlightmap",
|
||||||
|
"textures": {
|
||||||
|
"backdrop": "appliedenergistics2:block/chest/cell_state_backdrop",
|
||||||
|
"state": "appliedenergistics2:block/chest/cell_state_not_empty"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"north": {
|
||||||
|
"texture": "#backdrop"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"north": {
|
||||||
|
"texture": "#state",
|
||||||
|
"uvlightmap": {
|
||||||
|
"block": 0.007,
|
||||||
|
"sky": 0.007
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 146 B |
@@ -64,7 +64,7 @@ import appeng.util.Platform;
|
|||||||
public class ChargerBlock extends AEBaseTileBlock<ChargerBlockEntity> {
|
public class ChargerBlock extends AEBaseTileBlock<ChargerBlockEntity> {
|
||||||
|
|
||||||
public ChargerBlock() {
|
public ChargerBlock() {
|
||||||
super(defaultProps(Material.METAL));
|
super(defaultProps(Material.METAL).solidBlock(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
package appeng.block.networking;
|
package appeng.block.networking;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEMaterials;
|
||||||
import appeng.tile.networking.CreativeEnergyCellBlockEntity;
|
import appeng.tile.networking.CreativeEnergyCellBlockEntity;
|
||||||
|
|
||||||
public class CreativeEnergyCellBlock extends AEBaseTileBlock<CreativeEnergyCellBlockEntity> {
|
public class CreativeEnergyCellBlock extends AEBaseTileBlock<CreativeEnergyCellBlockEntity> {
|
||||||
|
|
||||||
public CreativeEnergyCellBlock() {
|
public CreativeEnergyCellBlock() {
|
||||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
super(defaultProps(AEMaterials.GLASS));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import net.minecraft.state.StateManager;
|
|||||||
import net.minecraft.util.collection.DefaultedList;
|
import net.minecraft.util.collection.DefaultedList;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEMaterials;
|
||||||
import appeng.tile.networking.EnergyCellBlockEntity;
|
import appeng.tile.networking.EnergyCellBlockEntity;
|
||||||
|
|
||||||
public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellBlockEntity> {
|
public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellBlockEntity> {
|
||||||
@@ -38,7 +38,7 @@ public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellBlockEntity> {
|
|||||||
public static final IntegerProperty ENERGY_STORAGE = IntegerProperty.create("fullness", 0, 7);
|
public static final IntegerProperty ENERGY_STORAGE = IntegerProperty.create("fullness", 0, 7);
|
||||||
|
|
||||||
public EnergyCellBlock() {
|
public EnergyCellBlock() {
|
||||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
super(defaultProps(AEMaterials.GLASS));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import appeng.block.AEBaseTileBlock;
|
|||||||
import appeng.container.ContainerLocator;
|
import appeng.container.ContainerLocator;
|
||||||
import appeng.container.ContainerOpener;
|
import appeng.container.ContainerOpener;
|
||||||
import appeng.container.implementations.WirelessContainer;
|
import appeng.container.implementations.WirelessContainer;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEMaterials;
|
||||||
import appeng.tile.networking.WirelessBlockEntity;
|
import appeng.tile.networking.WirelessBlockEntity;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> {
|
|||||||
public static final EnumProperty<State> STATE = EnumProperty.create("state", State.class);
|
public static final EnumProperty<State> STATE = EnumProperty.create("state", State.class);
|
||||||
|
|
||||||
public WirelessBlock() {
|
public WirelessBlock() {
|
||||||
super(defaultProps(AEGlassMaterial.INSTANCE)
|
super(defaultProps(AEMaterials.GLASS)
|
||||||
.nonOpaque()
|
.nonOpaque()
|
||||||
.solidBlock((state, world, pos) -> false)
|
.solidBlock((state, world, pos) -> false)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ import appeng.util.Platform;
|
|||||||
|
|
||||||
public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesBlockEntity> {
|
public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesBlockEntity> {
|
||||||
public PaintSplotchesBlock() {
|
public PaintSplotchesBlock() {
|
||||||
super(defaultProps(Material.WATER, MaterialColor.CLEAR));
|
super(defaultProps(Material.WATER, MaterialColor.CLEAR).notSolid());
|
||||||
this.setFullSize(false);
|
|
||||||
this.setOpaque(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeBloc
|
|||||||
|
|
||||||
public QuantumBaseBlock(Settings props) {
|
public QuantumBaseBlock(Settings props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.setFullSize(this.setOpaque(false));
|
|
||||||
this.setDefaultState(this.getDefaultState().with(FORMED, false));
|
this.setDefaultState(this.getDefaultState().with(FORMED, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import appeng.container.ContainerLocator;
|
|||||||
import appeng.container.ContainerOpener;
|
import appeng.container.ContainerOpener;
|
||||||
import appeng.container.implementations.QNBContainer;
|
import appeng.container.implementations.QNBContainer;
|
||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEMaterials;
|
||||||
import appeng.tile.qnb.QuantumBridgeBlockEntity;
|
import appeng.tile.qnb.QuantumBridgeBlockEntity;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public QuantumLinkChamberBlock() {
|
public QuantumLinkChamberBlock() {
|
||||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
super(defaultProps(AEMaterials.GLASS));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ import net.minecraft.world.BlockView;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEMaterials;
|
||||||
import appeng.tile.spatial.SpatialPylonBlockEntity;
|
import appeng.tile.spatial.SpatialPylonBlockEntity;
|
||||||
|
|
||||||
public class SpatialPylonBlock extends AEBaseTileBlock<SpatialPylonBlockEntity> {
|
public class SpatialPylonBlock extends AEBaseTileBlock<SpatialPylonBlockEntity> {
|
||||||
|
|
||||||
public SpatialPylonBlock() {
|
public SpatialPylonBlock() {
|
||||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
super(defaultProps(AEMaterials.GLASS));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ public enum DriveSlotState implements StringIdentifiable {
|
|||||||
// Online and free space
|
// Online and free space
|
||||||
ONLINE("online"),
|
ONLINE("online"),
|
||||||
|
|
||||||
|
// Online and not space
|
||||||
|
NOT_EMPTY("not_empty"),
|
||||||
|
|
||||||
// Types full, space left
|
// Types full, space left
|
||||||
TYPES_FULL("types_full"),
|
TYPES_FULL("types_full"),
|
||||||
|
|
||||||
@@ -60,8 +63,9 @@ public enum DriveSlotState implements StringIdentifiable {
|
|||||||
case ABSENT:
|
case ABSENT:
|
||||||
return DriveSlotState.EMPTY;
|
return DriveSlotState.EMPTY;
|
||||||
case EMPTY:
|
case EMPTY:
|
||||||
case NOT_EMPTY:
|
|
||||||
return DriveSlotState.ONLINE;
|
return DriveSlotState.ONLINE;
|
||||||
|
case NOT_EMPTY:
|
||||||
|
return DriveSlotState.NOT_EMPTY;
|
||||||
case TYPES_FULL:
|
case TYPES_FULL:
|
||||||
return DriveSlotState.TYPES_FULL;
|
return DriveSlotState.TYPES_FULL;
|
||||||
case FULL:
|
case FULL:
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
|||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
import net.minecraft.client.renderer.RenderState;
|
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
import net.minecraft.client.util.math.Vector3f;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
@@ -27,14 +26,6 @@ import appeng.tile.storage.DriveBlockEntity;
|
|||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class DriveLedTileEntityRenderer extends BlockEntityRenderer<DriveBlockEntity> {
|
public class DriveLedTileEntityRenderer extends BlockEntityRenderer<DriveBlockEntity> {
|
||||||
|
|
||||||
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;
|
private static final EnumMap<DriveSlotState, Vector3f> STATE_COLORS;
|
||||||
|
|
||||||
// Color used for the cell indicator for blinking during recent activity
|
// Color used for the cell indicator for blinking during recent activity
|
||||||
@@ -44,7 +35,8 @@ public class DriveLedTileEntityRenderer extends BlockEntityRenderer<DriveBlockEn
|
|||||||
STATE_COLORS = new EnumMap<>(DriveSlotState.class);
|
STATE_COLORS = new EnumMap<>(DriveSlotState.class);
|
||||||
STATE_COLORS.put(DriveSlotState.OFFLINE, new Vector3f(0, 0, 0));
|
STATE_COLORS.put(DriveSlotState.OFFLINE, new Vector3f(0, 0, 0));
|
||||||
STATE_COLORS.put(DriveSlotState.ONLINE, new Vector3f(0, 1, 0));
|
STATE_COLORS.put(DriveSlotState.ONLINE, new Vector3f(0, 1, 0));
|
||||||
STATE_COLORS.put(DriveSlotState.TYPES_FULL, new Vector3f(0, 0.667f, 0));
|
STATE_COLORS.put(DriveSlotState.NOT_EMPTY, new Vector3f(0f, 0.667f, 1));
|
||||||
|
STATE_COLORS.put(DriveSlotState.TYPES_FULL, new Vector3f(1, 0.667f, 0));
|
||||||
STATE_COLORS.put(DriveSlotState.FULL, new Vector3f(1, 0, 0));
|
STATE_COLORS.put(DriveSlotState.FULL, new Vector3f(1, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,8 +81,6 @@ public class DriveLedTileEntityRenderer extends BlockEntityRenderer<DriveBlockEn
|
|||||||
FacingToRotation.get(drive.getForward(), drive.getUp()).push(ms);
|
FacingToRotation.get(drive.getForward(), drive.getUp()).push(ms);
|
||||||
ms.translate(-0.5, -0.5, -0.5);
|
ms.translate(-0.5, -0.5, -0.5);
|
||||||
|
|
||||||
RenderType rt = RenderType.makeType("ae_drive_leds", VertexFormats.POSITION_COLOR, 7, 32565, false, true,
|
|
||||||
RenderType.State.getBuilder().transparency(TRANSLUCENT_TRANSPARENCY).build(false));
|
|
||||||
VertexConsumer buffer = buffers.getBuffer(STATE);
|
VertexConsumer buffer = buffers.getBuffer(STATE);
|
||||||
|
|
||||||
for (int row = 0; row < 5; row++) {
|
for (int row = 0; row < 5; row++) {
|
||||||
@@ -123,7 +113,6 @@ public class DriveLedTileEntityRenderer extends BlockEntityRenderer<DriveBlockEn
|
|||||||
}
|
}
|
||||||
|
|
||||||
ms.pop();
|
ms.pop();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector3f getColorForSlot(DriveBlockEntity drive, int slot, float partialTicks) {
|
private Vector3f getColorForSlot(DriveBlockEntity drive, int slot, float partialTicks) {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class StorageChunkGenerator extends ChunkGenerator<GenerationSettings> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int func_222529_a(int p_222529_1_, int p_222529_2_, Heightmap.Type heightmapType) {
|
public int getHeight(int p_222529_1_, int p_222529_2_, Heightmap.Type heightmapType) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,12 @@ import appeng.util.item.AEItemStack;
|
|||||||
|
|
||||||
public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
||||||
implements IMEChest, ITerminalHost, IPriorityHost, IConfigManagerHost, IColorableTile, Tickable {
|
implements IMEChest, ITerminalHost, IPriorityHost, IConfigManagerHost, IColorableTile, Tickable {
|
||||||
|
|
||||||
|
private static final int BIT_POWER_MASK = Byte.MIN_VALUE;
|
||||||
|
private static final int BIT_STATE_MASK = 0b111;
|
||||||
|
|
||||||
|
private static final int BIT_CELL_STATE_MASK = 0b111;
|
||||||
|
private static final int BIT_CELL_STATE_BITS = 3;
|
||||||
private final AppEngInternalInventory inputInventory = new AppEngInternalInventory(this, 1);
|
private final AppEngInternalInventory inputInventory = new AppEngInternalInventory(this, 1);
|
||||||
private final AppEngInternalInventory cellInventory = new AppEngInternalInventory(this, 1);
|
private final AppEngInternalInventory cellInventory = new AppEngInternalInventory(this, 1);
|
||||||
private final FixedItemInv internalInventory = new WrapperChainedItemHandler(this.inputInventory,
|
private final FixedItemInv internalInventory = new WrapperChainedItemHandler(this.inputInventory,
|
||||||
@@ -164,13 +170,13 @@ public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
|||||||
final int oldState = this.state;
|
final int oldState = this.state;
|
||||||
|
|
||||||
for (int x = 0; x < this.getCellCount(); x++) {
|
for (int x = 0; x < this.getCellCount(); x++) {
|
||||||
this.state |= (this.getCellStatus(x).ordinal() << (3 * x));
|
this.state |= (this.getCellStatus(x).ordinal() << (BIT_CELL_STATE_BITS * x));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isPowered()) {
|
if (this.isPowered()) {
|
||||||
this.state |= 0x40;
|
this.state |= BIT_POWER_MASK;
|
||||||
} else {
|
} else {
|
||||||
this.state &= ~0x40;
|
this.state &= ~BIT_POWER_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean currentActive = this.getProxy().isActive();
|
final boolean currentActive = this.getProxy().isActive();
|
||||||
@@ -246,7 +252,7 @@ public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
|||||||
@Override
|
@Override
|
||||||
public CellState getCellStatus(final int slot) {
|
public CellState getCellStatus(final int slot) {
|
||||||
if (isClient()) {
|
if (isClient()) {
|
||||||
return CellState.values()[(this.state >> (slot * 3)) & 3];
|
return CellState.values()[(this.state >> (slot * BIT_CELL_STATE_BITS)) & BIT_CELL_STATE_MASK];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateHandler();
|
this.updateHandler();
|
||||||
@@ -274,7 +280,7 @@ public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
|||||||
@Override
|
@Override
|
||||||
public boolean isPowered() {
|
public boolean isPowered() {
|
||||||
if (isClient()) {
|
if (isClient()) {
|
||||||
return (this.state & 0x40) == 0x40;
|
return (this.state & BIT_POWER_MASK) == BIT_POWER_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean gridPowered = this.getAECurrentPower() > 64;
|
boolean gridPowered = this.getAECurrentPower() > 64;
|
||||||
@@ -291,12 +297,7 @@ public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCellBlinking(final int slot) {
|
public boolean isCellBlinking(final int slot) {
|
||||||
final long now = this.world.getGameTime();
|
return false;
|
||||||
if (now - this.lastStateChange > 8) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ((this.state >> (slot * 3 + 2)) & 0x01) == 0x01;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -328,14 +329,14 @@ public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
|||||||
try {
|
try {
|
||||||
if (!this.getProxy().getEnergy().isNetworkPowered()) {
|
if (!this.getProxy().getEnergy().isNetworkPowered()) {
|
||||||
final double powerUsed = this.extractAEPower(idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG); // drain
|
final double powerUsed = this.extractAEPower(idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG); // drain
|
||||||
if (powerUsed + 0.1 >= idleUsage != (this.state & 0x40) > 0) {
|
if (powerUsed + 0.1 >= idleUsage != (this.state & BIT_POWER_MASK) > 0) {
|
||||||
this.recalculateDisplay();
|
this.recalculateDisplay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (final GridAccessException e) {
|
} catch (final GridAccessException e) {
|
||||||
final double powerUsed = this.extractAEPower(this.getProxy().getIdlePowerUsage(), Actionable.MODULATE,
|
final double powerUsed = this.extractAEPower(this.getProxy().getIdlePowerUsage(), Actionable.MODULATE,
|
||||||
PowerMultiplier.CONFIG); // drain
|
PowerMultiplier.CONFIG); // drain
|
||||||
if (powerUsed + 0.1 >= idleUsage != (this.state & 0x40) > 0) {
|
if (powerUsed + 0.1 >= idleUsage != (this.state & BIT_POWER_MASK) > 0) {
|
||||||
this.recalculateDisplay();
|
this.recalculateDisplay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,20 +350,16 @@ public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
|||||||
protected void writeToStream(final PacketByteBuf data) throws IOException {
|
protected void writeToStream(final PacketByteBuf data) throws IOException {
|
||||||
super.writeToStream(data);
|
super.writeToStream(data);
|
||||||
|
|
||||||
if (this.world.getGameTime() - this.lastStateChange > 8) {
|
this.state = 0;
|
||||||
this.state = 0;
|
|
||||||
} else {
|
|
||||||
this.state &= 0x24924924; // just keep the blinks...
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int x = 0; x < this.getCellCount(); x++) {
|
for (int x = 0; x < this.getCellCount(); x++) {
|
||||||
this.state |= (this.getCellStatus(x).ordinal() << (3 * x));
|
this.state |= (this.getCellStatus(x).ordinal() << (3 * x));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isPowered()) {
|
if (this.isPowered()) {
|
||||||
this.state |= 0x40;
|
this.state |= BIT_POWER_MASK;
|
||||||
} else {
|
} else {
|
||||||
this.state &= ~0x40;
|
this.state &= ~BIT_POWER_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
data.writeByte(this.state);
|
data.writeByte(this.state);
|
||||||
@@ -520,7 +517,7 @@ public class ChestBlockEntity extends AENetworkPowerBlockEntity
|
|||||||
}
|
}
|
||||||
this.lastStateChange = now;
|
this.lastStateChange = now;
|
||||||
|
|
||||||
this.state |= 1 << (slot * 3 + 2);
|
this.state |= 1 << (slot * BIT_CELL_STATE_BITS + 2);
|
||||||
|
|
||||||
this.recalculateDisplay();
|
this.recalculateDisplay();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,9 +76,11 @@ import appeng.util.inv.filter.IAEItemFilter;
|
|||||||
|
|
||||||
public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestOrDrive, IPriorityHost {
|
public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestOrDrive, IPriorityHost {
|
||||||
|
|
||||||
private static final int BIT_POWER_MASK = 0x80000000;
|
private static final int BIT_POWER_MASK = Integer.MIN_VALUE;
|
||||||
private static final int BIT_BLINK_MASK = 0x24924924;
|
private static final int BIT_STATE_MASK = 0b111111111111111111111111111111;
|
||||||
private static final int BIT_STATE_MASK = 0xDB6DB6DB;
|
|
||||||
|
private static final int BIT_CELL_STATE_MASK = 0b111;
|
||||||
|
private static final int BIT_CELL_STATE_BITS = 3;
|
||||||
|
|
||||||
private final AppEngCellInventory inv = new AppEngCellInventory(this, 10);
|
private final AppEngCellInventory inv = new AppEngCellInventory(this, 10);
|
||||||
private final ICellHandler[] handlersBySlot = new ICellHandler[10];
|
private final ICellHandler[] handlersBySlot = new ICellHandler[10];
|
||||||
@@ -94,13 +96,18 @@ public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestO
|
|||||||
/**
|
/**
|
||||||
* The state of all cells inside a drive as bitset, using the following format.
|
* The state of all cells inside a drive as bitset, using the following format.
|
||||||
*
|
*
|
||||||
* Bit 31: power state. 0 = off, 1 = on. Bit 30: undefined Bit 29-0: 3 bits as
|
* - Bit 31: power state. 0 = off, 1 = on.
|
||||||
* state of each cell with the cell in slot 0 located in the 3 least significant
|
*
|
||||||
* bits.
|
* - Bit 30: reserved
|
||||||
|
*
|
||||||
|
* - Bit 29-0: 3 bits for the state of each cell
|
||||||
*
|
*
|
||||||
* Cell states: Bit 2: blink. 0 = off, 1 = on. Bit 1-0: cell status
|
* Cell states:
|
||||||
|
*
|
||||||
|
* - Bit 2-0: {@link CellState} ordinal
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
private int state = 0;
|
private int state = 0;
|
||||||
|
|
||||||
@@ -127,8 +134,11 @@ public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestO
|
|||||||
newState |= BIT_POWER_MASK;
|
newState |= BIT_POWER_MASK;
|
||||||
}
|
}
|
||||||
for (int x = 0; x < this.getCellCount(); x++) {
|
for (int x = 0; x < this.getCellCount(); x++) {
|
||||||
newState |= (this.getCellStatus(x).ordinal() << (3 * x));
|
final int o = this.getCellStatus(x).ordinal();
|
||||||
|
final int i = (o << (BIT_CELL_STATE_BITS * x));
|
||||||
|
newState |= i;
|
||||||
}
|
}
|
||||||
|
|
||||||
data.writeInt(newState);
|
data.writeInt(newState);
|
||||||
|
|
||||||
writeCellItemIds(data);
|
writeCellItemIds(data);
|
||||||
@@ -223,7 +233,8 @@ public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestO
|
|||||||
@Override
|
@Override
|
||||||
public CellState getCellStatus(final int slot) {
|
public CellState getCellStatus(final int slot) {
|
||||||
if (Platform.isClient()) {
|
if (Platform.isClient()) {
|
||||||
return CellState.values()[(this.state >> (slot * 3)) & 3];
|
final int cellState = ((this.state >> (slot * BIT_CELL_STATE_BITS)) & BIT_CELL_STATE_MASK);
|
||||||
|
return CellState.values()[cellState];
|
||||||
}
|
}
|
||||||
|
|
||||||
final DriveWatcher handler = this.invBySlot[slot];
|
final DriveWatcher handler = this.invBySlot[slot];
|
||||||
@@ -245,7 +256,7 @@ public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestO
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCellBlinking(final int slot) {
|
public boolean isCellBlinking(final int slot) {
|
||||||
return ((this.state >> (slot * 3 + 2)) & 0x01) == 0x01;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -285,7 +296,7 @@ public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestO
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int x = 0; x < this.getCellCount(); x++) {
|
for (int x = 0; x < this.getCellCount(); x++) {
|
||||||
newState |= (this.getCellStatus(x).ordinal() << (3 * x));
|
newState |= (this.getCellStatus(x).ordinal() << (BIT_CELL_STATE_BITS * x));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newState != this.state) {
|
if (newState != this.state) {
|
||||||
@@ -415,8 +426,6 @@ public class DriveBlockEntity extends AENetworkInvBlockEntity implements IChestO
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void blinkCell(final int slot) {
|
public void blinkCell(final int slot) {
|
||||||
this.state |= 1 << (slot * 3 + 2);
|
|
||||||
|
|
||||||
this.recalculateDisplay();
|
this.recalculateDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class MeteoriteStructureStart extends StructureStart {
|
|||||||
int scanRadius = (int) Math.max(1, meteoriteRadius * 2);
|
int scanRadius = (int) Math.max(1, meteoriteRadius * 2);
|
||||||
for (int x = -scanRadius; x <= scanRadius; x++) {
|
for (int x = -scanRadius; x <= scanRadius; x++) {
|
||||||
for (int z = -scanRadius; z <= scanRadius; z++) {
|
for (int z = -scanRadius; z <= scanRadius; z++) {
|
||||||
int h = generator.func_222529_a(centerX + x, centerZ + z, heightmapType);
|
int h = generator.getHeight(centerX + x, centerZ + z, heightmapType);
|
||||||
stats.add(h);
|
stats.add(h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ public class MeteoriteStructureStart extends StructureStart {
|
|||||||
final double distanceFrom = dx * dx + dz * dz;
|
final double distanceFrom = dx * dx + dz * dz;
|
||||||
|
|
||||||
if (maxY > h + distanceFrom * 0.0175 && maxY < h + distanceFrom * 0.02) {
|
if (maxY > h + distanceFrom * 0.0175 && maxY < h + distanceFrom * 0.02) {
|
||||||
int heigth = generator.func_222529_a(blockPos.getX(), blockPos.getZ(), Heightmap.Type.OCEAN_FLOOR);
|
int heigth = generator.getHeight(blockPos.getX(), blockPos.getZ(), Heightmap.Type.OCEAN_FLOOR);
|
||||||
if (heigth < seaLevel) {
|
if (heigth < seaLevel) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user