Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d4a1590b51 | |||
| bd1d9701a9 | |||
| 4b3a232add | |||
| b8aa810a5f | |||
| 22facb9748 | |||
| ef3cc8a0a0 | |||
| 55b3dc0823 | |||
| 9445fad5a6 | |||
| 1a7bac1fcc | |||
| 19dee8d339 | |||
| a4f66c5923 | |||
| fe439bfb23 | |||
| 25da0b7357 | |||
| a2344f52e1 | |||
| bafc65d3a8 | |||
| 4e8296d3e7 | |||
| 26eeeb4c75 | |||
| f573b52b1b | |||
| a1042384e3 | |||
| 1ce82cc3b9 | |||
| 7dffbf78ce | |||
| 0f11c1e0a4 | |||
| 77b544ce4f | |||
| c67dba2f13 | |||
| 400fcdb633 | |||
| fba157a707 | |||
| 538965e74a | |||
| 0a56c724ed | |||
| 8d8d3dd2d7 | |||
| d17f8cec92 | |||
| d0acc9ccf1 | |||
| 17b919a171 | |||
| 003ef8672c | |||
| eaf2873649 | |||
| 66d00a4600 | |||
| d79d284690 | |||
| 7233b11284 | |||
| d5491549eb | |||
| f943106419 | |||
| 57fa5576af | |||
| 346e58ff25 | |||
| 42c2be5c05 | |||
| 312abce956 | |||
| 6379cfe3a2 | |||
| 208cd70725 | |||
| 130fc74768 | |||
| 6bbea481b8 | |||
| 55d7ac82e5 |
@@ -21,10 +21,13 @@ jobs:
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
||||
- name: Validate no assets
|
||||
run: test ! -d ./src/generated
|
||||
- name: Generate assets
|
||||
uses: GabrielBB/xvfb-action@v1.2
|
||||
with:
|
||||
run: ./gradlew runData --no-daemon
|
||||
- name: Validate assets
|
||||
run: test -d ./src/generated
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build --no-daemon
|
||||
|
||||
@@ -21,9 +21,13 @@ jobs:
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
||||
- name: Validate no assets
|
||||
run: test ! -d ./src/generated
|
||||
- name: Generate assets
|
||||
uses: GabrielBB/xvfb-action@v1.2
|
||||
with:
|
||||
run: ./gradlew runData --no-daemon
|
||||
- name: Validate assets
|
||||
run: test -d ./src/generated
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build --no-daemon
|
||||
|
||||
@@ -21,10 +21,14 @@ jobs:
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
||||
- name: Validate no assets
|
||||
run: test ! -d ./src/generated
|
||||
- name: Generate assets
|
||||
uses: GabrielBB/xvfb-action@v1.2
|
||||
with:
|
||||
run: ./gradlew runData --no-daemon
|
||||
- name: Validate assets
|
||||
run: test -d ./src/generated
|
||||
- name: Build with Gradle
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
|
||||
@@ -28,10 +28,14 @@ jobs:
|
||||
java-version: 1.8
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Validate no assets
|
||||
run: test ! -d ./src/generated
|
||||
- name: Generate assets
|
||||
uses: GabrielBB/xvfb-action@v1.2
|
||||
with:
|
||||
run: ./gradlew runData --no-daemon
|
||||
- name: Validate assets
|
||||
run: test -d ./src/generated
|
||||
- name: Build, sign, and publish with Gradle
|
||||
env:
|
||||
KEY_STORE_PASS: ${{ secrets.KEY_STORE_PASS }}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ artifact_basename=appliedenergistics2
|
||||
#########################################################
|
||||
minecraft_release=1.15
|
||||
minecraft_version=1.15.2
|
||||
mcp_mappings=20200613-1.15.1
|
||||
mcp_mappings=20200701-1.15.1
|
||||
forge_version=31.2.20
|
||||
|
||||
#########################################################
|
||||
|
||||
@@ -23,12 +23,17 @@
|
||||
|
||||
package appeng.api.config;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
public enum Upgrades {
|
||||
/**
|
||||
@@ -42,7 +47,8 @@ public enum Upgrades {
|
||||
FUZZY(1), SPEED(1), INVERTER(1);
|
||||
|
||||
private final int tier;
|
||||
private final Map<ItemStack, Integer> supportedMax = new HashMap<>();
|
||||
private final List<Supported> supported = new ArrayList<>();
|
||||
private List<ITextComponent> supportedTooltipLines;
|
||||
|
||||
Upgrades(final int tier) {
|
||||
this.tier = tier;
|
||||
@@ -52,8 +58,12 @@ public enum Upgrades {
|
||||
* @return list of Items/Blocks that support this upgrade, and how many it
|
||||
* supports.
|
||||
*/
|
||||
public Map<ItemStack, Integer> getSupported() {
|
||||
return this.supportedMax;
|
||||
public List<Supported> getSupported() {
|
||||
return this.supported;
|
||||
}
|
||||
|
||||
public void registerItem(final IItemProvider item, final int maxSupported) {
|
||||
this.registerItem(item, maxSupported, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,24 +71,93 @@ public enum Upgrades {
|
||||
*
|
||||
* @param item machine in which this upgrade can be installed
|
||||
* @param maxSupported amount how many upgrades can be installed
|
||||
* @param tooltipGroup If more than one item of the same group are supported,
|
||||
* the tooltip will show this group name instead. If the
|
||||
* items have different maxSupported values, the highest
|
||||
* will be shown.
|
||||
*/
|
||||
public void registerItem(final IItemDefinition item, final int maxSupported) {
|
||||
item.maybeStack(1).ifPresent(is -> this.registerItem(is, maxSupported));
|
||||
public void registerItem(final IItemProvider item, final int maxSupported, @Nullable ITextComponent tooltipGroup) {
|
||||
Preconditions.checkNotNull(item);
|
||||
this.supported.add(new Supported(item.asItem(), maxSupported, tooltipGroup));
|
||||
supportedTooltipLines = null; // Reset tooltip
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a specific amount of this upgrade into a specific machine
|
||||
*
|
||||
* @param stack machine in which this upgrade can be installed
|
||||
* @param maxSupported amount how many upgrades can be installed
|
||||
*/
|
||||
public void registerItem(final ItemStack stack, final int maxSupported) {
|
||||
if (stack != null) {
|
||||
this.supportedMax.put(stack, maxSupported);
|
||||
public List<ITextComponent> getTooltipLines() {
|
||||
if (supportedTooltipLines == null) {
|
||||
supported.sort(Comparator.comparingInt(o -> o.maxCount));
|
||||
supportedTooltipLines = new ArrayList<>(supported.size());
|
||||
|
||||
// Use a separate set because the final text will include numbers
|
||||
Set<ITextComponent> namesAdded = new HashSet<>();
|
||||
|
||||
for (int i = 0; i < supported.size(); i++) {
|
||||
Supported supported = this.supported.get(i);
|
||||
ITextComponent name = supported.item.getName();
|
||||
|
||||
// If the group was already added by a previous item, skip this
|
||||
if (supported.tooltipGroup != null && namesAdded.contains(supported.tooltipGroup)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// If any of the following items would be of the same group, use the group name
|
||||
// instead
|
||||
if (supported.tooltipGroup != null) {
|
||||
for (int j = i + 1; j < this.supported.size(); j++) {
|
||||
ITextComponent otherGroup = this.supported.get(j).tooltipGroup;
|
||||
if (supported.tooltipGroup.equals(otherGroup)) {
|
||||
name = supported.tooltipGroup;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (namesAdded.add(name)) {
|
||||
// append the supported count only if its > 1
|
||||
if (supported.maxCount > 1) {
|
||||
name = name.deepCopy().appendText(" (" + supported.maxCount + ")");
|
||||
}
|
||||
supportedTooltipLines.add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return supportedTooltipLines;
|
||||
}
|
||||
|
||||
public int getTier() {
|
||||
return this.tier;
|
||||
}
|
||||
|
||||
public static class Supported {
|
||||
private final Item item;
|
||||
private final Block block;
|
||||
private final int maxCount;
|
||||
@Nullable
|
||||
private final ITextComponent tooltipGroup;
|
||||
|
||||
public Supported(Item item, int maxCount, @Nullable ITextComponent tooltipGroup) {
|
||||
this.item = item;
|
||||
if (item.getItem() instanceof BlockItem) {
|
||||
this.block = ((BlockItem) item.getItem()).getBlock();
|
||||
} else {
|
||||
this.block = null;
|
||||
}
|
||||
this.maxCount = maxCount;
|
||||
this.tooltipGroup = tooltipGroup;
|
||||
}
|
||||
|
||||
public int getMaxCount() {
|
||||
return maxCount;
|
||||
}
|
||||
|
||||
public boolean isSupported(Block block) {
|
||||
return block != null && this.block == block;
|
||||
}
|
||||
|
||||
public boolean isSupported(Item item) {
|
||||
return item != null && this.item == item;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,10 +30,11 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
|
||||
import appeng.api.features.AEFeature;
|
||||
|
||||
public interface IItemDefinition extends IComparableDefinition {
|
||||
public interface IItemDefinition extends IComparableDefinition, IItemProvider {
|
||||
/**
|
||||
* @return the unique name of the definition which will be used to register the
|
||||
* underlying structure. Will never be null
|
||||
@@ -63,4 +64,10 @@ public interface IItemDefinition extends IComparableDefinition {
|
||||
* @return an immutable set of the features of this item
|
||||
*/
|
||||
Set<AEFeature> features();
|
||||
|
||||
@Override
|
||||
default Item asItem() {
|
||||
return item();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-11
@@ -21,23 +21,23 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.implementations.items;
|
||||
package appeng.api.networking;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Lets you specify the name of the group of items this falls under.
|
||||
* A factory for grid cache implementations.
|
||||
*/
|
||||
public interface IItemGroup {
|
||||
@FunctionalInterface
|
||||
public interface IGridCacheFactory<T extends IGridCache> {
|
||||
|
||||
/**
|
||||
* returning null, is the same as not implementing the interface at all.
|
||||
* Creates a grid cache for the given grid.
|
||||
*
|
||||
* @param is item
|
||||
*
|
||||
* @return an unlocalized string to use for the items group name.
|
||||
* @param grid The grid for which the cache should be created.
|
||||
* @return A new grid cache instance.
|
||||
*/
|
||||
String getUnlocalizedGroupName(Set<ItemStack> otherItems, ItemStack is);
|
||||
@Nonnull
|
||||
T createCache(IGrid grid);
|
||||
|
||||
}
|
||||
@@ -36,10 +36,10 @@ public interface IGridCacheRegistry {
|
||||
* Register a new grid cache for use during operation, must be called during the
|
||||
* loading phase.
|
||||
*
|
||||
* @param iface grid cache class
|
||||
* @param iface grid cache class
|
||||
* @param factory Factory for creating a new instance for each constructed grid
|
||||
*/
|
||||
void registerGridCache(@Nonnull Class<? extends IGridCache> iface,
|
||||
@Nonnull Class<? extends IGridCache> implementation);
|
||||
<T extends IGridCache> void registerGridCache(@Nonnull Class<T> iface, @Nonnull IGridCacheFactory<T> factory);
|
||||
|
||||
/**
|
||||
* requests a new INSTANCE of a grid cache for use, used internally
|
||||
|
||||
@@ -32,6 +32,7 @@ import javax.annotation.Nonnull;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -371,4 +372,14 @@ public interface IPart extends ICustomCableConnection {
|
||||
*/
|
||||
void getBoxes(final IPartCollisionHelper bch);
|
||||
|
||||
/**
|
||||
* This will be used by the core to add information about this part to a crash
|
||||
* report if it is attached to a host that caused a crash during tick
|
||||
* processing.
|
||||
*
|
||||
* @param section The crash report section the information will be added to.
|
||||
*/
|
||||
default void addEntityCrashInfo(final CrashReportCategory section) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,5 +50,5 @@ public enum CellState {
|
||||
/**
|
||||
* Full cell, technically could have free types
|
||||
*/
|
||||
FULL,
|
||||
FULL;
|
||||
}
|
||||
@@ -106,4 +106,13 @@ public interface IAEItemStack extends IAEStack<IAEItemStack> {
|
||||
* @return definition stack
|
||||
*/
|
||||
ItemStack getDefinition();
|
||||
|
||||
/**
|
||||
* Compare this AE item stack to another item stack, but ignores the amount. It
|
||||
* checks the item type, NBT and damage values.
|
||||
*
|
||||
* @param is An item stack
|
||||
*/
|
||||
boolean equals(ItemStack is);
|
||||
|
||||
}
|
||||
@@ -18,22 +18,14 @@
|
||||
|
||||
package appeng.block;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
@@ -41,13 +33,11 @@ import net.minecraftforge.common.ToolType;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.AEMaterials;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public abstract class AEBaseBlock extends Block {
|
||||
|
||||
private boolean isOpaque = true;
|
||||
private boolean isFullSize = true;
|
||||
private boolean isInventory = false;
|
||||
|
||||
protected AEBaseBlock(final Block.Properties props) {
|
||||
@@ -74,7 +64,7 @@ public abstract class AEBaseBlock extends Block {
|
||||
}
|
||||
|
||||
private static SoundType getDefaultSoundByMaterial(Material mat) {
|
||||
if (mat == AEGlassMaterial.INSTANCE || mat == Material.GLASS) {
|
||||
if (mat == AEMaterials.GLASS || mat == Material.GLASS) {
|
||||
return SoundType.GLASS;
|
||||
} else if (mat == Material.ROCK) {
|
||||
return SoundType.STONE;
|
||||
@@ -85,11 +75,6 @@ public abstract class AEBaseBlock extends Block {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos) {
|
||||
return this.isFullSize() && this.isOpaque();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride(BlockState state) {
|
||||
return this.isInventory();
|
||||
@@ -129,11 +114,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;
|
||||
@@ -219,24 +199,6 @@ public abstract class AEBaseBlock extends Block {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean isOpaque() {
|
||||
return this.isOpaque;
|
||||
}
|
||||
|
||||
protected boolean setOpaque(final boolean isOpaque) {
|
||||
this.isOpaque = isOpaque;
|
||||
return isOpaque;
|
||||
}
|
||||
|
||||
protected boolean isFullSize() {
|
||||
return this.isFullSize;
|
||||
}
|
||||
|
||||
protected boolean setFullSize(final boolean isFullSize) {
|
||||
this.isFullSize = isFullSize;
|
||||
return isFullSize;
|
||||
}
|
||||
|
||||
protected boolean isInventory() {
|
||||
return this.isInventory;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
}
|
||||
|
||||
ActionResultType result = super.tryPlace(context);
|
||||
if (result != ActionResultType.SUCCESS) {
|
||||
if (!result.isSuccessOrConsume()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
ori = tile;
|
||||
|
||||
if (tile == null) {
|
||||
return ActionResultType.SUCCESS;
|
||||
return result;
|
||||
}
|
||||
|
||||
if (ori.canBeRotated() && !this.blockType.hasCustomRotation()) {
|
||||
@@ -155,7 +155,7 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
ori.setOrientation(forward, up);
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -64,8 +64,6 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
|
||||
public ChargerBlock() {
|
||||
super(defaultProps(Material.IRON).notSolid());
|
||||
|
||||
this.setFullSize(this.setOpaque(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -81,7 +81,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
|
||||
public QuartzFixtureBlock() {
|
||||
super(defaultProps(Material.MISCELLANEOUS).doesNotBlockMovement().hardnessAndResistance(0).lightValue(14)
|
||||
.sound(SoundType.GLASS));
|
||||
.sound(SoundType.GLASS).notSolid());
|
||||
|
||||
this.setDefaultState(getDefaultState().with(FACING, Direction.UP).with(ODD, false));
|
||||
}
|
||||
@@ -199,9 +199,4 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
return new MetaRotation(w, pos, FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaque() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,10 +18,9 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -52,8 +51,7 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
.create(new AxisAlignedBB(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
|
||||
|
||||
public TinyTNTBlock(Block.Properties props) {
|
||||
super(props);
|
||||
setFullSize(setOpaque(false));
|
||||
super(defaultProps(Material.TNT).notSolid());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,17 +65,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ import appeng.client.render.cablebus.CableBusBreakingParticle;
|
||||
import appeng.client.render.cablebus.CableBusRenderState;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.ClickPacket;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.AEMaterials;
|
||||
import appeng.integration.abstraction.IAEFacade;
|
||||
import appeng.parts.ICableBusContainer;
|
||||
import appeng.parts.NullCableBusContainer;
|
||||
@@ -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(AEMaterials.GLASS).notSolid().noDrops().variableOpacity());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,11 +158,12 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
@Override
|
||||
public boolean canConnectRedstone(final BlockState state, final IBlockReader w, final BlockPos pos,
|
||||
Direction side) {
|
||||
// TODO: Verify this.
|
||||
if (side == null) {
|
||||
side = Direction.UP;
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.cb(w, pos).canConnectRedstone(EnumSet.of(side));
|
||||
return this.cb(w, pos).canConnectRedstone(side.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
package appeng.block.networking;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.AEMaterials;
|
||||
import appeng.tile.networking.CreativeEnergyCellTileEntity;
|
||||
|
||||
public class CreativeEnergyCellBlock extends AEBaseTileBlock<CreativeEnergyCellTileEntity> {
|
||||
|
||||
public CreativeEnergyCellBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
||||
super(defaultProps(AEMaterials.GLASS));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.AEMaterials;
|
||||
import appeng.tile.networking.EnergyCellTileEntity;
|
||||
|
||||
public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellTileEntity> {
|
||||
@@ -38,7 +38,7 @@ public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellTileEntity> {
|
||||
public static final IntegerProperty ENERGY_STORAGE = IntegerProperty.create("fullness", 0, 7);
|
||||
|
||||
public EnergyCellBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
||||
super(defaultProps(AEMaterials.GLASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,7 +40,7 @@ import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.WirelessContainer;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.AEMaterials;
|
||||
import appeng.tile.networking.WirelessTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -58,9 +58,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
|
||||
public static final EnumProperty<State> STATE = EnumProperty.create("state", State.class);
|
||||
|
||||
public WirelessBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE).notSolid());
|
||||
this.setFullSize(false);
|
||||
this.setOpaque(false);
|
||||
super(defaultProps(AEMaterials.GLASS).notSolid());
|
||||
this.setDefaultState(this.getDefaultState().with(STATE, State.OFF));
|
||||
}
|
||||
|
||||
|
||||
@@ -42,9 +42,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntity> {
|
||||
public PaintSplotchesBlock() {
|
||||
super(defaultProps(Material.WATER, MaterialColor.AIR));
|
||||
this.setFullSize(false);
|
||||
this.setOpaque(false);
|
||||
super(defaultProps(Material.WATER, MaterialColor.AIR).notSolid());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,6 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeTile
|
||||
|
||||
public QuantumBaseBlock(Block.Properties props) {
|
||||
super(props);
|
||||
this.setFullSize(this.setOpaque(false));
|
||||
this.setDefaultState(this.getDefaultState().with(FORMED, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.QNBContainer;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.AEMaterials;
|
||||
import appeng.tile.qnb.QuantumBridgeTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
public QuantumLinkChamberBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
||||
super(defaultProps(AEMaterials.GLASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,13 +25,13 @@ import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.AEMaterials;
|
||||
import appeng.tile.spatial.SpatialPylonTileEntity;
|
||||
|
||||
public class SpatialPylonBlock extends AEBaseTileBlock<SpatialPylonTileEntity> {
|
||||
|
||||
public SpatialPylonBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
||||
super(defaultProps(AEMaterials.GLASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,6 +37,9 @@ public enum DriveSlotState implements IStringSerializable {
|
||||
// Online and free space
|
||||
ONLINE("online"),
|
||||
|
||||
// Online and not space
|
||||
NOT_EMPTY("not_empty"),
|
||||
|
||||
// Types full, space left
|
||||
TYPES_FULL("types_full"),
|
||||
|
||||
@@ -60,8 +63,9 @@ public enum DriveSlotState implements IStringSerializable {
|
||||
case ABSENT:
|
||||
return DriveSlotState.EMPTY;
|
||||
case EMPTY:
|
||||
case NOT_EMPTY:
|
||||
return DriveSlotState.ONLINE;
|
||||
case NOT_EMPTY:
|
||||
return DriveSlotState.NOT_EMPTY;
|
||||
case TYPES_FULL:
|
||||
return DriveSlotState.TYPES_FULL;
|
||||
case FULL:
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.RenderState;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
@@ -14,7 +13,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;
|
||||
@@ -35,7 +33,8 @@ public class DriveLedTileEntityRenderer extends TileEntityRenderer<DriveTileEnti
|
||||
STATE_COLORS = new EnumMap<>(DriveSlotState.class);
|
||||
STATE_COLORS.put(DriveSlotState.OFFLINE, new Vector3f(0, 0, 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));
|
||||
}
|
||||
|
||||
@@ -80,10 +79,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);
|
||||
|
||||
for (int row = 0; row < 5; row++) {
|
||||
@@ -116,7 +111,6 @@ public class DriveLedTileEntityRenderer extends TileEntityRenderer<DriveTileEnti
|
||||
}
|
||||
|
||||
ms.pop();
|
||||
|
||||
}
|
||||
|
||||
private Vector3f getColorForSlot(DriveTileEntity drive, int slot, float partialTicks) {
|
||||
@@ -125,6 +119,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
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, 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.container.slot;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
// FIXME seems unused
|
||||
public class NullSlot extends Slot {
|
||||
|
||||
public NullSlot() {
|
||||
super(null, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChange(final ItemStack par1ItemStack, final ItemStack par2ItemStack) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onTake(final PlayerEntity par1PlayerEntity, final ItemStack par2ItemStack) {
|
||||
return par2ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack par1ItemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStack() {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack(final ItemStack par1ItemStack) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChanged() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(final int par1) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(final PlayerEntity par1PlayerEntity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotIndex() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,16 @@
|
||||
|
||||
package appeng.core;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.DoubleSupplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -36,7 +45,13 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.config.CondenserOutput;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.util.EnumCycler;
|
||||
@@ -91,6 +106,7 @@ public final class AEConfig {
|
||||
// Spatial IO/Dimension
|
||||
private double spatialPowerExponent;
|
||||
private double spatialPowerMultiplier;
|
||||
private boolean spatialBlockTags;
|
||||
|
||||
// Grindstone
|
||||
private float oreDoublePercentage;
|
||||
@@ -175,9 +191,10 @@ public final class AEConfig {
|
||||
this.matterCannonBattery = COMMON.matterCannonBattery.get();
|
||||
|
||||
this.featureFlags.clear();
|
||||
|
||||
for (final AEFeature feature : AEFeature.values()) {
|
||||
if (feature.isVisible()) {
|
||||
if (COMMON.enabledFeatures.containsKey(feature)) {
|
||||
if (feature.isVisible() && feature.isConfig()) {
|
||||
if (COMMON.enabledFeatures.containsKey(feature) && COMMON.enabledFeatures.get(feature).get()) {
|
||||
this.featureFlags.add(feature);
|
||||
}
|
||||
} else {
|
||||
@@ -192,6 +209,7 @@ public final class AEConfig {
|
||||
|
||||
this.spatialPowerMultiplier = COMMON.spatialPowerMultiplier.get();
|
||||
this.spatialPowerExponent = COMMON.spatialPowerExponent.get();
|
||||
this.spatialBlockTags = COMMON.spatialBlockTags.get();
|
||||
|
||||
this.craftingCalculationTimePerTick = COMMON.craftingCalculationTimePerTick.get();
|
||||
|
||||
@@ -203,7 +221,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) {
|
||||
@@ -319,6 +337,10 @@ public final class AEConfig {
|
||||
return this.spatialPowerMultiplier;
|
||||
}
|
||||
|
||||
public boolean getSpatialBlockTags() {
|
||||
return this.spatialBlockTags;
|
||||
}
|
||||
|
||||
public float getOreDoublePercentage() {
|
||||
return this.oreDoublePercentage;
|
||||
}
|
||||
@@ -441,6 +463,7 @@ public final class AEConfig {
|
||||
// Spatial IO/Dimension
|
||||
public final ConfigValue<Double> spatialPowerExponent;
|
||||
public final ConfigValue<Double> spatialPowerMultiplier;
|
||||
public final ConfigValue<Boolean> spatialBlockTags;
|
||||
|
||||
// Grindstone
|
||||
public final DoubleValue oreDoublePercentage;
|
||||
@@ -528,6 +551,9 @@ public final class AEConfig {
|
||||
builder.push("spatialio");
|
||||
this.spatialPowerMultiplier = builder.define("spatialPowerMultiplier", 1250.0);
|
||||
this.spatialPowerExponent = builder.define("spatialPowerExponent", 1.35);
|
||||
this.spatialBlockTags = builder
|
||||
.comment("BE CAREFUL, CAN CORRUPT YOUR WORLD! Will use #spatial/whitelist as whitelist.")
|
||||
.define("spatialBlockTags", false);
|
||||
builder.pop();
|
||||
|
||||
builder.push("GrindStone");
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
package appeng.core;
|
||||
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IItems;
|
||||
import appeng.api.definitions.IMaterials;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.bootstrap.FeatureFactory;
|
||||
import appeng.core.api.definitions.ApiBlocks;
|
||||
import appeng.core.api.definitions.ApiItems;
|
||||
@@ -57,17 +54,17 @@ public final class ApiDefinitions implements IDefinitions {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItems items() {
|
||||
public ApiItems items() {
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMaterials materials() {
|
||||
public ApiMaterials materials() {
|
||||
return materials;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParts parts() {
|
||||
public ApiParts parts() {
|
||||
return parts;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.gen.GenerationStage;
|
||||
@@ -45,7 +46,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.ModDimension;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
import net.minecraftforge.common.extensions.IForgeContainerType;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
@@ -92,9 +92,9 @@ import appeng.core.features.registries.PartModels;
|
||||
import appeng.core.features.registries.cell.BasicCellHandler;
|
||||
import appeng.core.features.registries.cell.BasicItemCellGuiHandler;
|
||||
import appeng.core.features.registries.cell.CreativeCellHandler;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.stats.AdvancementTriggers;
|
||||
import appeng.core.stats.AeStats;
|
||||
import appeng.core.stats.PartItemPredicate;
|
||||
import appeng.fluids.client.gui.*;
|
||||
import appeng.fluids.container.*;
|
||||
import appeng.fluids.registries.BasicFluidCellGuiHandler;
|
||||
@@ -130,14 +130,14 @@ final class Registration {
|
||||
final IRegistryContainer registries = api.registries();
|
||||
|
||||
final IGridCacheRegistry gcr = registries.gridCache();
|
||||
gcr.registerGridCache(ITickManager.class, TickManagerCache.class);
|
||||
gcr.registerGridCache(IEnergyGrid.class, EnergyGridCache.class);
|
||||
gcr.registerGridCache(IPathingGrid.class, PathGridCache.class);
|
||||
gcr.registerGridCache(IStorageGrid.class, GridStorageCache.class);
|
||||
gcr.registerGridCache(P2PCache.class, P2PCache.class);
|
||||
gcr.registerGridCache(ISpatialCache.class, SpatialPylonCache.class);
|
||||
gcr.registerGridCache(ISecurityGrid.class, SecurityCache.class);
|
||||
gcr.registerGridCache(ICraftingGrid.class, CraftingGridCache.class);
|
||||
gcr.registerGridCache(ITickManager.class, TickManagerCache::new);
|
||||
gcr.registerGridCache(IEnergyGrid.class, EnergyGridCache::new);
|
||||
gcr.registerGridCache(IPathingGrid.class, PathGridCache::new);
|
||||
gcr.registerGridCache(IStorageGrid.class, GridStorageCache::new);
|
||||
gcr.registerGridCache(P2PCache.class, P2PCache::new);
|
||||
gcr.registerGridCache(ISpatialCache.class, SpatialPylonCache::new);
|
||||
gcr.registerGridCache(ISecurityGrid.class, SecurityCache::new);
|
||||
gcr.registerGridCache(ICraftingGrid.class, CraftingGridCache::new);
|
||||
|
||||
registries.cell().addCellHandler(new BasicCellHandler());
|
||||
registries.cell().addCellHandler(new CreativeCellHandler());
|
||||
@@ -145,8 +145,6 @@ final class Registration {
|
||||
registries.cell().addCellGuiHandler(new BasicFluidCellGuiHandler());
|
||||
|
||||
registries.matterCannon().registerAmmoItem(api.definitions().materials().matterBall().item(), 32);
|
||||
|
||||
PartItemPredicate.register();
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -340,8 +338,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) {
|
||||
@@ -384,12 +381,19 @@ final class Registration {
|
||||
final IBlocks blocks = definitions.blocks();
|
||||
final IItems items = definitions.items();
|
||||
|
||||
// Block and part interface have different translation keys, but support the
|
||||
// same upgrades
|
||||
ITextComponent interfaceGroup = parts.iface().asItem().getName();
|
||||
ITextComponent itemIoBusGroup = GuiText.IOBuses.textComponent();
|
||||
ITextComponent fluidIoBusGroup = GuiText.IOBusesFluids.textComponent();
|
||||
ITextComponent storageCellGroup = GuiText.IOBusesFluids.textComponent();
|
||||
|
||||
// default settings..
|
||||
((P2PTunnelRegistry) registries.p2pTunnel()).configure();
|
||||
|
||||
// Interface
|
||||
Upgrades.CRAFTING.registerItem(parts.iface(), 1);
|
||||
Upgrades.CRAFTING.registerItem(blocks.iface(), 1);
|
||||
Upgrades.CRAFTING.registerItem(parts.iface(), 1, interfaceGroup);
|
||||
Upgrades.CRAFTING.registerItem(blocks.iface(), 1, interfaceGroup);
|
||||
|
||||
// IO Port!
|
||||
Upgrades.SPEED.registerItem(blocks.iOPort(), 3);
|
||||
@@ -400,43 +404,43 @@ final class Registration {
|
||||
Upgrades.CRAFTING.registerItem(parts.levelEmitter(), 1);
|
||||
|
||||
// Import Bus
|
||||
Upgrades.FUZZY.registerItem(parts.importBus(), 1);
|
||||
Upgrades.REDSTONE.registerItem(parts.importBus(), 1);
|
||||
Upgrades.CAPACITY.registerItem(parts.importBus(), 2);
|
||||
Upgrades.SPEED.registerItem(parts.importBus(), 4);
|
||||
Upgrades.FUZZY.registerItem(parts.importBus(), 1, itemIoBusGroup);
|
||||
Upgrades.REDSTONE.registerItem(parts.importBus(), 1, itemIoBusGroup);
|
||||
Upgrades.CAPACITY.registerItem(parts.importBus(), 2, itemIoBusGroup);
|
||||
Upgrades.SPEED.registerItem(parts.importBus(), 4, itemIoBusGroup);
|
||||
|
||||
// Fluid Import Bus
|
||||
Upgrades.CAPACITY.registerItem(parts.fluidImportBus(), 2);
|
||||
Upgrades.REDSTONE.registerItem(parts.fluidImportBus(), 1);
|
||||
Upgrades.SPEED.registerItem(parts.fluidImportBus(), 4);
|
||||
Upgrades.CAPACITY.registerItem(parts.fluidImportBus(), 2, fluidIoBusGroup);
|
||||
Upgrades.REDSTONE.registerItem(parts.fluidImportBus(), 1, fluidIoBusGroup);
|
||||
Upgrades.SPEED.registerItem(parts.fluidImportBus(), 4, fluidIoBusGroup);
|
||||
|
||||
// Export Bus
|
||||
Upgrades.FUZZY.registerItem(parts.exportBus(), 1);
|
||||
Upgrades.REDSTONE.registerItem(parts.exportBus(), 1);
|
||||
Upgrades.CAPACITY.registerItem(parts.exportBus(), 2);
|
||||
Upgrades.SPEED.registerItem(parts.exportBus(), 4);
|
||||
Upgrades.CRAFTING.registerItem(parts.exportBus(), 1);
|
||||
Upgrades.FUZZY.registerItem(parts.exportBus(), 1, itemIoBusGroup);
|
||||
Upgrades.REDSTONE.registerItem(parts.exportBus(), 1, itemIoBusGroup);
|
||||
Upgrades.CAPACITY.registerItem(parts.exportBus(), 2, itemIoBusGroup);
|
||||
Upgrades.SPEED.registerItem(parts.exportBus(), 4, itemIoBusGroup);
|
||||
Upgrades.CRAFTING.registerItem(parts.exportBus(), 1, itemIoBusGroup);
|
||||
|
||||
// Fluid Export Bus
|
||||
Upgrades.CAPACITY.registerItem(parts.fluidExportBus(), 2);
|
||||
Upgrades.REDSTONE.registerItem(parts.fluidExportBus(), 1);
|
||||
Upgrades.SPEED.registerItem(parts.fluidExportBus(), 4);
|
||||
Upgrades.CAPACITY.registerItem(parts.fluidExportBus(), 2, fluidIoBusGroup);
|
||||
Upgrades.REDSTONE.registerItem(parts.fluidExportBus(), 1, fluidIoBusGroup);
|
||||
Upgrades.SPEED.registerItem(parts.fluidExportBus(), 4, fluidIoBusGroup);
|
||||
|
||||
// Storage Cells
|
||||
Upgrades.FUZZY.registerItem(items.cell1k(), 1);
|
||||
Upgrades.INVERTER.registerItem(items.cell1k(), 1);
|
||||
Upgrades.FUZZY.registerItem(items.cell1k(), 1, storageCellGroup);
|
||||
Upgrades.INVERTER.registerItem(items.cell1k(), 1, storageCellGroup);
|
||||
|
||||
Upgrades.FUZZY.registerItem(items.cell4k(), 1);
|
||||
Upgrades.INVERTER.registerItem(items.cell4k(), 1);
|
||||
Upgrades.FUZZY.registerItem(items.cell4k(), 1, storageCellGroup);
|
||||
Upgrades.INVERTER.registerItem(items.cell4k(), 1, storageCellGroup);
|
||||
|
||||
Upgrades.FUZZY.registerItem(items.cell16k(), 1);
|
||||
Upgrades.INVERTER.registerItem(items.cell16k(), 1);
|
||||
Upgrades.FUZZY.registerItem(items.cell16k(), 1, storageCellGroup);
|
||||
Upgrades.INVERTER.registerItem(items.cell16k(), 1, storageCellGroup);
|
||||
|
||||
Upgrades.FUZZY.registerItem(items.cell64k(), 1);
|
||||
Upgrades.INVERTER.registerItem(items.cell64k(), 1);
|
||||
Upgrades.FUZZY.registerItem(items.cell64k(), 1, storageCellGroup);
|
||||
Upgrades.INVERTER.registerItem(items.cell64k(), 1, storageCellGroup);
|
||||
|
||||
Upgrades.FUZZY.registerItem(items.portableCell(), 1);
|
||||
Upgrades.INVERTER.registerItem(items.portableCell(), 1);
|
||||
Upgrades.FUZZY.registerItem(items.portableCell(), 1, storageCellGroup);
|
||||
Upgrades.INVERTER.registerItem(items.portableCell(), 1, storageCellGroup);
|
||||
|
||||
Upgrades.FUZZY.registerItem(items.viewCell(), 1);
|
||||
Upgrades.INVERTER.registerItem(items.viewCell(), 1);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.core.api.definitions;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.definitions.IParts;
|
||||
@@ -29,56 +28,21 @@ import appeng.api.parts.IPart;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEColoredItemDefinition;
|
||||
import appeng.bootstrap.FeatureFactory;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.CreativeTab;
|
||||
import appeng.core.features.ActivityState;
|
||||
import appeng.core.features.ColoredItemDefinition;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
import appeng.core.features.registries.PartModels;
|
||||
import appeng.fluids.parts.FluidAnnihilationPlanePart;
|
||||
import appeng.fluids.parts.FluidExportBusPart;
|
||||
import appeng.fluids.parts.FluidFormationPlanePart;
|
||||
import appeng.fluids.parts.FluidImportBusPart;
|
||||
import appeng.fluids.parts.FluidInterfacePart;
|
||||
import appeng.fluids.parts.FluidLevelEmitterPart;
|
||||
import appeng.fluids.parts.FluidStorageBusPart;
|
||||
import appeng.fluids.parts.FluidTerminalPart;
|
||||
import appeng.fluids.parts.*;
|
||||
import appeng.items.parts.ColoredPartItem;
|
||||
import appeng.items.parts.PartItem;
|
||||
import appeng.items.parts.PartItemRendering;
|
||||
import appeng.items.parts.PartType;
|
||||
import appeng.parts.automation.AnnihilationPlanePart;
|
||||
import appeng.parts.automation.ExportBusPart;
|
||||
import appeng.parts.automation.FormationPlanePart;
|
||||
import appeng.parts.automation.IdentityAnnihilationPlanePart;
|
||||
import appeng.parts.automation.ImportBusPart;
|
||||
import appeng.parts.automation.LevelEmitterPart;
|
||||
import appeng.parts.misc.CableAnchorPart;
|
||||
import appeng.parts.misc.InterfacePart;
|
||||
import appeng.parts.misc.InvertedToggleBusPart;
|
||||
import appeng.parts.misc.StorageBusPart;
|
||||
import appeng.parts.misc.ToggleBusPart;
|
||||
import appeng.parts.networking.CoveredCablePart;
|
||||
import appeng.parts.networking.CoveredDenseCablePart;
|
||||
import appeng.parts.networking.GlassCablePart;
|
||||
import appeng.parts.networking.QuartzFiberPart;
|
||||
import appeng.parts.networking.SmartCablePart;
|
||||
import appeng.parts.networking.SmartDenseCablePart;
|
||||
import appeng.parts.p2p.FEP2PTunnelPart;
|
||||
import appeng.parts.p2p.FluidP2PTunnelPart;
|
||||
import appeng.parts.p2p.ItemP2PTunnelPart;
|
||||
import appeng.parts.p2p.LightP2PTunnelPart;
|
||||
import appeng.parts.p2p.MEP2PTunnelPart;
|
||||
import appeng.parts.p2p.RedstoneP2PTunnelPart;
|
||||
import appeng.parts.reporting.ConversionMonitorPart;
|
||||
import appeng.parts.reporting.CraftingTerminalPart;
|
||||
import appeng.parts.reporting.DarkPanelPart;
|
||||
import appeng.parts.reporting.InterfaceTerminalPart;
|
||||
import appeng.parts.reporting.PanelPart;
|
||||
import appeng.parts.reporting.PatternTerminalPart;
|
||||
import appeng.parts.reporting.SemiDarkPanelPart;
|
||||
import appeng.parts.reporting.StorageMonitorPart;
|
||||
import appeng.parts.reporting.TerminalPart;
|
||||
import appeng.items.parts.PartModelsHelper;
|
||||
import appeng.parts.automation.*;
|
||||
import appeng.parts.misc.*;
|
||||
import appeng.parts.networking.*;
|
||||
import appeng.parts.p2p.*;
|
||||
import appeng.parts.reporting.*;
|
||||
|
||||
/**
|
||||
* Internal implementation for the API parts
|
||||
@@ -126,106 +90,91 @@ public final class ApiParts implements IParts {
|
||||
private final IItemDefinition fluidTerminal;
|
||||
private final IItemDefinition fluidStorageBus;
|
||||
|
||||
private FeatureFactory registry;
|
||||
private PartModels partModels;
|
||||
|
||||
public ApiParts(FeatureFactory registry, PartModels partModels) {
|
||||
registerPartModels(partModels);
|
||||
this.registry = registry;
|
||||
this.partModels = partModels;
|
||||
|
||||
this.cableSmart = constructColoredDefinition(registry, "smart_cable", PartType.CABLE_SMART,
|
||||
SmartCablePart::new);
|
||||
this.cableCovered = constructColoredDefinition(registry, "covered_cable", PartType.CABLE_COVERED,
|
||||
CoveredCablePart::new);
|
||||
this.cableGlass = constructColoredDefinition(registry, "glass_cable", PartType.CABLE_GLASS,
|
||||
GlassCablePart::new);
|
||||
this.cableDenseCovered = constructColoredDefinition(registry, "covered_dense_cable",
|
||||
PartType.CABLE_DENSE_COVERED, CoveredDenseCablePart::new);
|
||||
this.cableDenseSmart = constructColoredDefinition(registry, "smart_dense_cable", PartType.CABLE_DENSE_SMART,
|
||||
this.cableSmart = constructColoredDefinition("smart_cable", SmartCablePart.class, SmartCablePart::new);
|
||||
this.cableCovered = constructColoredDefinition("covered_cable", CoveredCablePart.class, CoveredCablePart::new);
|
||||
this.cableGlass = constructColoredDefinition("glass_cable", GlassCablePart.class, GlassCablePart::new);
|
||||
this.cableDenseCovered = constructColoredDefinition("covered_dense_cable", CoveredDenseCablePart.class,
|
||||
CoveredDenseCablePart::new);
|
||||
this.cableDenseSmart = constructColoredDefinition("smart_dense_cable", SmartDenseCablePart.class,
|
||||
SmartDenseCablePart::new);
|
||||
this.quartzFiber = createPart(registry, "quartz_fiber", PartType.QUARTZ_FIBER, QuartzFiberPart::new);
|
||||
this.toggleBus = createPart(registry, "toggle_bus", PartType.TOGGLE_BUS, ToggleBusPart::new);
|
||||
this.invertedToggleBus = createPart(registry, "inverted_toggle_bus", PartType.INVERTED_TOGGLE_BUS,
|
||||
this.quartzFiber = createPart("quartz_fiber", QuartzFiberPart.class, QuartzFiberPart::new);
|
||||
this.toggleBus = createPart("toggle_bus", ToggleBusPart.class, ToggleBusPart::new);
|
||||
this.invertedToggleBus = createPart("inverted_toggle_bus", InvertedToggleBusPart.class,
|
||||
InvertedToggleBusPart::new);
|
||||
this.cableAnchor = createPart(registry, "cable_anchor", PartType.CABLE_ANCHOR, CableAnchorPart::new);
|
||||
this.monitor = createPart(registry, "monitor", PartType.MONITOR, PanelPart::new);
|
||||
this.semiDarkMonitor = createPart(registry, "semi_dark_monitor", PartType.SEMI_DARK_MONITOR,
|
||||
SemiDarkPanelPart::new);
|
||||
this.darkMonitor = createPart(registry, "dark_monitor", PartType.DARK_MONITOR, DarkPanelPart::new);
|
||||
this.storageBus = createPart(registry, "storage_bus", PartType.STORAGE_BUS, StorageBusPart::new);
|
||||
this.fluidStorageBus = createPart(registry, "fluid_storage_bus", PartType.FLUID_STORAGE_BUS,
|
||||
FluidStorageBusPart::new);
|
||||
this.importBus = createPart(registry, "import_bus", PartType.IMPORT_BUS, ImportBusPart::new);
|
||||
this.fluidImportBus = createPart(registry, "fluid_import_bus", PartType.FLUID_IMPORT_BUS,
|
||||
FluidImportBusPart::new);
|
||||
this.exportBus = createPart(registry, "export_bus", PartType.EXPORT_BUS, ExportBusPart::new);
|
||||
this.fluidExportBus = createPart(registry, "fluid_export_bus", PartType.FLUID_EXPORT_BUS,
|
||||
FluidExportBusPart::new);
|
||||
this.levelEmitter = createPart(registry, "level_emitter", PartType.LEVEL_EMITTER, LevelEmitterPart::new);
|
||||
this.fluidLevelEmitter = createPart(registry, "fluid_level_emitter", PartType.FLUID_LEVEL_EMITTER,
|
||||
this.cableAnchor = createPart("cable_anchor", CableAnchorPart.class, CableAnchorPart::new);
|
||||
this.monitor = createPart("monitor", PanelPart.class, PanelPart::new);
|
||||
this.semiDarkMonitor = createPart("semi_dark_monitor", SemiDarkPanelPart.class, SemiDarkPanelPart::new);
|
||||
this.darkMonitor = createPart("dark_monitor", DarkPanelPart.class, DarkPanelPart::new);
|
||||
this.storageBus = createPart("storage_bus", StorageBusPart.class, StorageBusPart::new);
|
||||
this.fluidStorageBus = createPart("fluid_storage_bus", FluidStorageBusPart.class, FluidStorageBusPart::new);
|
||||
this.importBus = createPart("import_bus", ImportBusPart.class, ImportBusPart::new);
|
||||
this.fluidImportBus = createPart("fluid_import_bus", FluidImportBusPart.class, FluidImportBusPart::new);
|
||||
this.exportBus = createPart("export_bus", ExportBusPart.class, ExportBusPart::new);
|
||||
this.fluidExportBus = createPart("fluid_export_bus", FluidExportBusPart.class, FluidExportBusPart::new);
|
||||
this.levelEmitter = createPart("level_emitter", LevelEmitterPart.class, LevelEmitterPart::new);
|
||||
this.fluidLevelEmitter = createPart("fluid_level_emitter", FluidLevelEmitterPart.class,
|
||||
FluidLevelEmitterPart::new);
|
||||
this.annihilationPlane = createPart(registry, "annihilation_plane", PartType.ANNIHILATION_PLANE,
|
||||
this.annihilationPlane = createPart("annihilation_plane", AnnihilationPlanePart.class,
|
||||
AnnihilationPlanePart::new);
|
||||
this.identityAnnihilationPlane = createPart(registry, "identity_annihilation_plane",
|
||||
PartType.IDENTITY_ANNIHILATION_PLANE, IdentityAnnihilationPlanePart::new);
|
||||
this.fluidAnnihilationPlane = createPart(registry, "fluid_annihilation_plane",
|
||||
PartType.FLUID_ANNIHILATION_PLANE, FluidAnnihilationPlanePart::new);
|
||||
this.formationPlane = createPart(registry, "formation_plane", PartType.FORMATION_PLANE,
|
||||
FormationPlanePart::new);
|
||||
this.fluidFormationPlane = createPart(registry, "fluid_formation_plane", PartType.FLUID_FORMATION_PLANE,
|
||||
this.identityAnnihilationPlane = createPart("identity_annihilation_plane", IdentityAnnihilationPlanePart.class,
|
||||
IdentityAnnihilationPlanePart::new);
|
||||
this.fluidAnnihilationPlane = createPart("fluid_annihilation_plane", FluidAnnihilationPlanePart.class,
|
||||
FluidAnnihilationPlanePart::new);
|
||||
this.formationPlane = createPart("formation_plane", FormationPlanePart.class, FormationPlanePart::new);
|
||||
this.fluidFormationPlane = createPart("fluid_formation_plane", FluidFormationPlanePart.class,
|
||||
FluidFormationPlanePart::new);
|
||||
this.patternTerminal = createPart(registry, "pattern_terminal", PartType.PATTERN_TERMINAL,
|
||||
PatternTerminalPart::new);
|
||||
this.craftingTerminal = createPart(registry, "crafting_terminal", PartType.CRAFTING_TERMINAL,
|
||||
CraftingTerminalPart::new);
|
||||
this.terminal = createPart(registry, "terminal", PartType.TERMINAL, TerminalPart::new);
|
||||
this.storageMonitor = createPart(registry, "storage_monitor", PartType.STORAGE_MONITOR,
|
||||
StorageMonitorPart::new);
|
||||
this.conversionMonitor = createPart(registry, "conversion_monitor", PartType.CONVERSION_MONITOR,
|
||||
this.patternTerminal = createPart("pattern_terminal", PatternTerminalPart.class, PatternTerminalPart::new);
|
||||
this.craftingTerminal = createPart("crafting_terminal", CraftingTerminalPart.class, CraftingTerminalPart::new);
|
||||
this.terminal = createPart("terminal", TerminalPart.class, TerminalPart::new);
|
||||
this.storageMonitor = createPart("storage_monitor", StorageMonitorPart.class, StorageMonitorPart::new);
|
||||
this.conversionMonitor = createPart("conversion_monitor", ConversionMonitorPart.class,
|
||||
ConversionMonitorPart::new);
|
||||
this.iface = createPart(registry, "cable_interface", PartType.INTERFACE, InterfacePart::new);
|
||||
this.fluidIface = createPart(registry, "cable_fluid_interface", PartType.FLUID_INTERFACE,
|
||||
FluidInterfacePart::new);
|
||||
this.p2PTunnelME = createPart(registry, "me_p2p_tunnel", PartType.P2P_TUNNEL_ME, MEP2PTunnelPart::new);
|
||||
this.p2PTunnelRedstone = createPart(registry, "redstone_p2p_tunnel", PartType.P2P_TUNNEL_REDSTONE,
|
||||
this.iface = createPart("cable_interface", InterfacePart.class, InterfacePart::new);
|
||||
this.fluidIface = createPart("cable_fluid_interface", FluidInterfacePart.class, FluidInterfacePart::new);
|
||||
this.p2PTunnelME = createPart("me_p2p_tunnel", MEP2PTunnelPart.class, MEP2PTunnelPart::new);
|
||||
this.p2PTunnelRedstone = createPart("redstone_p2p_tunnel", RedstoneP2PTunnelPart.class,
|
||||
RedstoneP2PTunnelPart::new);
|
||||
this.p2PTunnelItems = createPart(registry, "item_p2p_tunnel", PartType.P2P_TUNNEL_ITEM, ItemP2PTunnelPart::new);
|
||||
this.p2PTunnelFluids = createPart(registry, "fluid_p2p_tunnel", PartType.P2P_TUNNEL_FLUID,
|
||||
FluidP2PTunnelPart::new);
|
||||
this.p2PTunnelItems = createPart("item_p2p_tunnel", ItemP2PTunnelPart.class, ItemP2PTunnelPart::new);
|
||||
this.p2PTunnelFluids = createPart("fluid_p2p_tunnel", FluidP2PTunnelPart.class, FluidP2PTunnelPart::new);
|
||||
this.p2PTunnelEU = null; // FIXME createPart( "ic2_p2p_tunnel", PartType.P2P_TUNNEL_IC2,
|
||||
// PartP2PIC2Power::new);
|
||||
this.p2PTunnelFE = createPart(registry, "fe_p2p_tunnel", PartType.P2P_TUNNEL_FE, FEP2PTunnelPart::new);
|
||||
this.p2PTunnelLight = createPart(registry, "light_p2p_tunnel", PartType.P2P_TUNNEL_LIGHT,
|
||||
LightP2PTunnelPart::new);
|
||||
this.interfaceTerminal = createPart(registry, "interface_terminal", PartType.INTERFACE_TERMINAL,
|
||||
// PartP2PIC2Power.class, PartP2PIC2Power::new);
|
||||
this.p2PTunnelFE = createPart("fe_p2p_tunnel", FEP2PTunnelPart.class, FEP2PTunnelPart::new);
|
||||
this.p2PTunnelLight = createPart("light_p2p_tunnel", LightP2PTunnelPart.class, LightP2PTunnelPart::new);
|
||||
this.interfaceTerminal = createPart("interface_terminal", InterfaceTerminalPart.class,
|
||||
InterfaceTerminalPart::new);
|
||||
this.fluidTerminal = createPart(registry, "fluid_terminal", PartType.FLUID_TERMINAL, FluidTerminalPart::new);
|
||||
this.fluidTerminal = createPart("fluid_terminal", FluidTerminalPart.class, FluidTerminalPart::new);
|
||||
|
||||
this.registry = null;
|
||||
this.partModels = null;
|
||||
}
|
||||
|
||||
private void registerPartModels(PartModels partModels) {
|
||||
|
||||
// Register the built-in models for annihilation planes
|
||||
ResourceLocation fluidFormationPlaneTexture = new ResourceLocation(AppEng.MOD_ID,
|
||||
"item/part/fluid_formation_plane");
|
||||
ResourceLocation fluidFormationPlaneOnTexture = new ResourceLocation(AppEng.MOD_ID,
|
||||
"parts/fluid_formation_plane_on");
|
||||
|
||||
// Register all part models
|
||||
for (PartType partType : PartType.values()) {
|
||||
partModels.registerModels(partType.getModels());
|
||||
}
|
||||
}
|
||||
|
||||
private <T extends IPart> IItemDefinition createPart(FeatureFactory registry, String id, PartType type,
|
||||
private <T extends IPart> IItemDefinition createPart(String id, Class<T> partClass,
|
||||
Function<ItemStack, T> factory) {
|
||||
return registry.item(id, props -> new PartItem<>(props, type, factory)).itemGroup(CreativeTab.INSTANCE)
|
||||
|
||||
partModels.registerModels(PartModelsHelper.createModels(partClass));
|
||||
|
||||
return registry.item(id, props -> new PartItem<>(props, factory)).itemGroup(CreativeTab.INSTANCE)
|
||||
.rendering(new PartItemRendering()).build();
|
||||
}
|
||||
|
||||
private <T extends IPart> AEColoredItemDefinition constructColoredDefinition(FeatureFactory registry,
|
||||
String idSuffix, PartType type, Function<ItemStack, T> factory) {
|
||||
private <T extends IPart> AEColoredItemDefinition constructColoredDefinition(String idSuffix, Class<T> partClass,
|
||||
Function<ItemStack, T> factory) {
|
||||
|
||||
partModels.registerModels(PartModelsHelper.createModels(partClass));
|
||||
|
||||
final ColoredItemDefinition definition = new ColoredItemDefinition();
|
||||
|
||||
for (final AEColor color : AEColor.values()) {
|
||||
String id = color.registryPrefix + '_' + idSuffix;
|
||||
|
||||
IItemDefinition itemDef = registry.item(id, props -> new ColoredPartItem<>(props, type, factory, color))
|
||||
IItemDefinition itemDef = registry.item(id, props -> new ColoredPartItem<>(props, factory, color))
|
||||
.itemGroup(CreativeTab.INSTANCE).rendering(new PartItemRendering(color)).build();
|
||||
|
||||
definition.add(color, new ItemStackSrc(itemDef.item(), ActivityState.Enabled));
|
||||
|
||||
@@ -18,54 +18,57 @@
|
||||
|
||||
package appeng.core.features.registries;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridCache;
|
||||
import appeng.api.networking.IGridCacheFactory;
|
||||
import appeng.api.networking.IGridCacheRegistry;
|
||||
import appeng.core.AELog;
|
||||
|
||||
public final class GridCacheRegistry implements IGridCacheRegistry {
|
||||
private final Map<Class<? extends IGridCache>, Class<? extends IGridCache>> caches = new HashMap<>();
|
||||
|
||||
private final List<GridCacheRegistration<?>> registry = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void registerGridCache(final Class<? extends IGridCache> iface,
|
||||
final Class<? extends IGridCache> implementation) {
|
||||
if (iface.isAssignableFrom(implementation)) {
|
||||
this.caches.put(iface, implementation);
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
"Invalid setup, grid cache must either be the same class, or an interface that the implementation implements. Gotten: "
|
||||
+ iface + " and " + implementation);
|
||||
public synchronized <T extends IGridCache> void registerGridCache(@Nonnull Class<T> iface,
|
||||
@Nonnull IGridCacheFactory<T> factory) {
|
||||
|
||||
if (registry.stream().anyMatch(r -> r.cacheClass.equals(iface))) {
|
||||
throw new IllegalArgumentException("Implementation for grid cache " + iface + " is already registered!");
|
||||
}
|
||||
|
||||
registry.add(new GridCacheRegistration<>(iface, factory));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<Class<? extends IGridCache>, IGridCache> createCacheInstance(final IGrid g) {
|
||||
final HashMap<Class<? extends IGridCache>, IGridCache> map = new HashMap<>();
|
||||
public Map<Class<? extends IGridCache>, IGridCache> createCacheInstance(final IGrid g) {
|
||||
final Map<Class<? extends IGridCache>, IGridCache> map = new HashMap<>(registry.size());
|
||||
|
||||
for (final Class<? extends IGridCache> iface : this.caches.keySet()) {
|
||||
try {
|
||||
final Constructor<? extends IGridCache> c = this.caches.get(iface).getConstructor(IGrid.class);
|
||||
map.put(iface, c.newInstance(g));
|
||||
} catch (final NoSuchMethodException e) {
|
||||
AELog.error("Grid Caches must have a constructor with IGrid as the single param.");
|
||||
throw new IllegalArgumentException(e);
|
||||
} catch (final InvocationTargetException e) {
|
||||
AELog.error("Grid Caches must have a constructor with IGrid as the single param.");
|
||||
throw new IllegalStateException(e);
|
||||
} catch (final InstantiationException e) {
|
||||
AELog.error("Grid Caches must have a constructor with IGrid as the single param.");
|
||||
throw new IllegalStateException(e);
|
||||
} catch (final IllegalAccessException e) {
|
||||
AELog.error("Grid Caches must have a constructor with IGrid as the single param.");
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
for (GridCacheRegistration<?> registration : registry) {
|
||||
map.put(registration.cacheClass, registration.factory.createCache(g));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private static class GridCacheRegistration<T extends IGridCache> {
|
||||
|
||||
private final Class<T> cacheClass;
|
||||
|
||||
private final IGridCacheFactory<T> factory;
|
||||
|
||||
public GridCacheRegistration(Class<T> cacheClass, IGridCacheFactory<T> factory) {
|
||||
this.cacheClass = cacheClass;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,29 +19,45 @@
|
||||
package appeng.core.features.registries;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.api.exceptions.AppEngException;
|
||||
import appeng.api.movable.IMovableHandler;
|
||||
import appeng.api.movable.IMovableRegistry;
|
||||
import appeng.api.movable.IMovableTile;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.spatial.DefaultSpatialHandler;
|
||||
|
||||
public class MovableTileRegistry implements IMovableRegistry {
|
||||
|
||||
private final HashSet<Block> blacklisted = new HashSet<>();
|
||||
private static final ResourceLocation TAG_WHITELIST = new ResourceLocation(AppEng.MOD_ID, "spatial/whitelist");
|
||||
private static final ResourceLocation TAG_BLACKLIST = new ResourceLocation(AppEng.MOD_ID, "spatial/blacklist");
|
||||
|
||||
private final HashMap<Class<? extends TileEntity>, IMovableHandler> Valid = new HashMap<>();
|
||||
private final Set<Block> blacklisted = new HashSet<>();
|
||||
|
||||
private final Map<Class<? extends TileEntity>, IMovableHandler> valid = new IdentityHashMap<>();
|
||||
private final List<Class<? extends TileEntity>> test = new ArrayList<>();
|
||||
private final List<IMovableHandler> handlers = new ArrayList<>();
|
||||
private final DefaultSpatialHandler dsh = new DefaultSpatialHandler();
|
||||
|
||||
private final IMovableHandler nullHandler = new DefaultSpatialHandler();
|
||||
private final Tag<Block> blockTagWhiteList;
|
||||
private final Tag<Block> blockTagBlackList;
|
||||
|
||||
public MovableTileRegistry() {
|
||||
this.blockTagWhiteList = BlockTags.getCollection().getOrCreate(TAG_WHITELIST);
|
||||
this.blockTagBlackList = BlockTags.getCollection().getOrCreate(TAG_BLACKLIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blacklistBlock(final Block blk) {
|
||||
@@ -60,8 +76,8 @@ public class MovableTileRegistry implements IMovableRegistry {
|
||||
|
||||
@Override
|
||||
public boolean askToMove(final TileEntity te) {
|
||||
final Class myClass = te.getClass();
|
||||
IMovableHandler canMove = this.Valid.get(myClass);
|
||||
final Class<? extends TileEntity> myClass = te.getClass();
|
||||
IMovableHandler canMove = this.valid.get(myClass);
|
||||
|
||||
if (canMove == null) {
|
||||
canMove = this.testClass(myClass, te);
|
||||
@@ -79,7 +95,7 @@ public class MovableTileRegistry implements IMovableRegistry {
|
||||
return false;
|
||||
}
|
||||
|
||||
private IMovableHandler testClass(final Class myClass, final TileEntity te) {
|
||||
private IMovableHandler testClass(final Class<? extends TileEntity> myClass, final TileEntity te) {
|
||||
IMovableHandler handler = null;
|
||||
|
||||
// ask handlers...
|
||||
@@ -92,25 +108,32 @@ public class MovableTileRegistry implements IMovableRegistry {
|
||||
|
||||
// if you have a handler your opted in
|
||||
if (handler != null) {
|
||||
this.Valid.put(myClass, handler);
|
||||
this.valid.put(myClass, handler);
|
||||
return handler;
|
||||
}
|
||||
|
||||
// if your movable our opted in
|
||||
if (te instanceof IMovableTile) {
|
||||
this.Valid.put(myClass, this.dsh);
|
||||
this.valid.put(myClass, this.dsh);
|
||||
return this.dsh;
|
||||
}
|
||||
|
||||
// if the block itself is via block tags
|
||||
if (AEConfig.instance().getSpatialBlockTags()
|
||||
&& this.blockTagWhiteList.contains(te.getBlockState().getBlock())) {
|
||||
this.valid.put(myClass, this.dsh);
|
||||
return this.dsh;
|
||||
}
|
||||
|
||||
// if you are on the white list your opted in.
|
||||
for (final Class<? extends TileEntity> testClass : this.test) {
|
||||
if (testClass.isAssignableFrom(myClass)) {
|
||||
this.Valid.put(myClass, this.dsh);
|
||||
this.valid.put(myClass, this.dsh);
|
||||
return this.dsh;
|
||||
}
|
||||
}
|
||||
|
||||
this.Valid.put(myClass, this.nullHandler);
|
||||
this.valid.put(myClass, this.nullHandler);
|
||||
return this.nullHandler;
|
||||
}
|
||||
|
||||
@@ -129,8 +152,8 @@ public class MovableTileRegistry implements IMovableRegistry {
|
||||
|
||||
@Override
|
||||
public IMovableHandler getHandler(final TileEntity te) {
|
||||
final Class myClass = te.getClass();
|
||||
final IMovableHandler h = this.Valid.get(myClass);
|
||||
final Class<? extends TileEntity> myClass = te.getClass();
|
||||
final IMovableHandler h = this.valid.get(myClass);
|
||||
return h == null ? this.dsh : h;
|
||||
}
|
||||
|
||||
@@ -141,6 +164,6 @@ public class MovableTileRegistry implements IMovableRegistry {
|
||||
|
||||
@Override
|
||||
public boolean isBlacklisted(final Block blk) {
|
||||
return this.blacklisted.contains(blk);
|
||||
return this.blacklisted.contains(blk) || this.blockTagBlackList.contains(blk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2017, 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.stats;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.advancements.criterion.ItemPredicate;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.JSONUtils;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import appeng.items.parts.PartItem;
|
||||
import appeng.items.parts.PartType;
|
||||
|
||||
public class PartItemPredicate extends ItemPredicate {
|
||||
private final PartType partType;
|
||||
|
||||
public PartItemPredicate(String partName) {
|
||||
this.partType = PartType.valueOf(partName.toUpperCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(ItemStack item) {
|
||||
if (item.getItem() instanceof PartItem) {
|
||||
PartItem<?> itemPart = (PartItem<?>) item.getItem();
|
||||
return itemPart.getType() == partType;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ItemPredicate deserialize(JsonObject jsonobject) {
|
||||
if (jsonobject.has("part")) {
|
||||
return new PartItemPredicate(JSONUtils.getString(jsonobject, "part"));
|
||||
} else {
|
||||
return ItemPredicate.ANY;
|
||||
}
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
ItemPredicate.register(new ResourceLocation(AppEng.MOD_ID, "part"), PartItemPredicate::deserialize);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ final class PlayerData extends WorldSavedData implements IWorldPlayerData {
|
||||
this.mapping.put(profile.getId(), playerId);
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ final class PlayerData extends WorldSavedData implements IWorldPlayerData {
|
||||
UUID profileId = new UUID(profileIds[i * 2], profileIds[i * 2 + 1]);
|
||||
highestPlayerId = Math.max(playerId, highestPlayerId);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class EnergyGeneratorTileEntity extends AEBaseTileEntity implements ITick
|
||||
@Override
|
||||
public void tick() {
|
||||
World world = this.getWorld();
|
||||
if (world == null) {
|
||||
if (world == null || world.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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 -> {
|
||||
|
||||
@@ -26,10 +26,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
@@ -48,10 +50,31 @@ public class ReplicatorCardItem extends AEBaseItem {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
|
||||
if (!worldIn.isRemote()) {
|
||||
final CompoundNBT tag = playerIn.getHeldItem(handIn).getOrCreateTag();
|
||||
final int replications;
|
||||
|
||||
if (tag.contains("r")) {
|
||||
replications = (tag.getInt("r") + 1) % 4;
|
||||
} else {
|
||||
replications = 0;
|
||||
}
|
||||
|
||||
tag.putInt("r", replications);
|
||||
|
||||
playerIn.sendMessage(new StringTextComponent((replications + 1) + "³ Replications"));
|
||||
}
|
||||
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUseFirst(ItemStack stack, ItemUseContext context) {
|
||||
if (context.getWorld().isRemote()) {
|
||||
return ActionResultType.PASS;
|
||||
// Needed, otherwise client will trigger onItemRightClick also on server...
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
PlayerEntity player = context.getPlayer();
|
||||
@@ -70,13 +93,15 @@ public class ReplicatorCardItem extends AEBaseItem {
|
||||
|
||||
if (player.isCrouching()) {
|
||||
if (world.getTileEntity(pos) instanceof IGridHost) {
|
||||
final CompoundNBT tag = new CompoundNBT();
|
||||
final CompoundNBT tag = player.getHeldItem(hand).getOrCreateTag();
|
||||
tag.putInt("x", x);
|
||||
tag.putInt("y", y);
|
||||
tag.putInt("z", z);
|
||||
tag.putInt("side", side.ordinal());
|
||||
tag.putInt("dimid", world.getDimension().getType().getId());
|
||||
player.getHeldItem(hand).setTag(tag);
|
||||
tag.putInt("r", 0);
|
||||
|
||||
this.outputMsg(player, "Set replicator source");
|
||||
} else {
|
||||
this.outputMsg(player, "This is not a Grid Tile.");
|
||||
}
|
||||
@@ -89,56 +114,81 @@ public class ReplicatorCardItem extends AEBaseItem {
|
||||
final int src_side = ish.getInt("side");
|
||||
final int dimid = ish.getInt("dimid");
|
||||
final World src_w = world.getServer().getWorld(DimensionType.getById(dimid));
|
||||
final int replications = ish.getInt("r") + 1;
|
||||
|
||||
final TileEntity te = src_w.getTileEntity(new BlockPos(src_x, src_y, src_z));
|
||||
|
||||
if (te instanceof IGridHost) {
|
||||
final IGridHost gh = (IGridHost) te;
|
||||
final Direction sideOff = Direction.values()[src_side];
|
||||
final Direction currentSideOff = side;
|
||||
final IGridNode n = gh.getGridNode(AEPartLocation.fromFacing(sideOff));
|
||||
|
||||
if (n != null) {
|
||||
final IGrid g = n.getGrid();
|
||||
|
||||
if (g != null) {
|
||||
final ISpatialCache sc = g.getCache(ISpatialCache.class);
|
||||
|
||||
if (sc.isValidRegion()) {
|
||||
final DimensionalCoord min = sc.getMin();
|
||||
final DimensionalCoord max = sc.getMax();
|
||||
|
||||
x += currentSideOff.getXOffset();
|
||||
y += currentSideOff.getYOffset();
|
||||
z += currentSideOff.getZOffset();
|
||||
// TODO: Why??? Places it one block up each time...
|
||||
// x += currentSideOff.getXOffset();
|
||||
// y += currentSideOff.getYOffset();
|
||||
// z += currentSideOff.getZOffset();
|
||||
|
||||
final int sc_size_x = max.x - min.x;
|
||||
final int sc_size_y = max.y - min.y;
|
||||
final int sc_size_z = max.z - min.z;
|
||||
|
||||
final int min_x = min.x;
|
||||
final int min_y = min.y;
|
||||
final int min_z = min.z;
|
||||
|
||||
final int rel_x = min.x - src_x + x;
|
||||
final int rel_y = min.y - src_y + y;
|
||||
final int rel_z = min.z - src_z + z;
|
||||
// Invert to maintain correct sign for west/east
|
||||
final int x_rot = (int) -Math.signum(MathHelper.wrapDegrees(player.rotationYaw));
|
||||
// Rotate by 90 degree, so north/south are negative/positive
|
||||
final int z_rot = (int) Math.signum(MathHelper.wrapDegrees(player.rotationYaw + 90));
|
||||
|
||||
final int scale_x = max.x - min.x;
|
||||
final int scale_y = max.y - min.y;
|
||||
final int scale_z = max.z - min.z;
|
||||
// Loops for replication in each direction
|
||||
for (int r_x = 0; r_x < replications; r_x++) {
|
||||
for (int r_y = 0; r_y < replications; r_y++) {
|
||||
for (int r_z = 0; r_z < replications; r_z++) {
|
||||
|
||||
for (int i = 1; i < scale_x; i++) {
|
||||
for (int j = 1; j < scale_y; j++) {
|
||||
for (int k = 1; k < scale_z; k++) {
|
||||
final BlockPos p = new BlockPos(min_x + i, min_y + j, min_z + k);
|
||||
final BlockPos d = new BlockPos(i + rel_x, j + rel_y, k + rel_z);
|
||||
final BlockState state = src_w.getBlockState(p);
|
||||
final Block blk = state.getBlock();
|
||||
final BlockState prev = world.getBlockState(d);
|
||||
// Offset x/z by the rotation index.
|
||||
// For sake of simplicity always grow upwards.
|
||||
final int rel_x = min.x - src_x + x + (r_x * sc_size_x * x_rot);
|
||||
final int rel_y = min.y - src_y + y + (r_y * sc_size_y);
|
||||
final int rel_z = min.z - src_z + z + (r_z * sc_size_z * z_rot);
|
||||
|
||||
world.setBlockState(d, state);
|
||||
if (blk != null && blk.hasTileEntity(state)) {
|
||||
final TileEntity ote = src_w.getTileEntity(p);
|
||||
final TileEntity nte = blk.createTileEntity(state, world);
|
||||
final CompoundNBT data = new CompoundNBT();
|
||||
ote.write(data);
|
||||
nte.read(data.copy());
|
||||
world.setTileEntity(d, nte);
|
||||
// Copy a single SC instance completely
|
||||
for (int i = 1; i < sc_size_x; i++) {
|
||||
for (int j = 1; j < sc_size_y; j++) {
|
||||
for (int k = 1; k < sc_size_z; k++) {
|
||||
final BlockPos p = new BlockPos(min_x + i, min_y + j,
|
||||
min_z + k);
|
||||
final BlockPos d = new BlockPos(i + rel_x, j + rel_y,
|
||||
k + rel_z);
|
||||
|
||||
final BlockState state = src_w.getBlockState(p);
|
||||
final Block blk = state.getBlock();
|
||||
final BlockState prev = world.getBlockState(d);
|
||||
|
||||
world.setBlockState(d, state);
|
||||
if (blk != null && blk.hasTileEntity(state)) {
|
||||
final TileEntity ote = src_w.getTileEntity(p);
|
||||
final TileEntity nte = blk.createTileEntity(state, world);
|
||||
final CompoundNBT data = new CompoundNBT();
|
||||
ote.write(data);
|
||||
nte.read(data.copy());
|
||||
world.setTileEntity(d, nte);
|
||||
}
|
||||
world.notifyBlockUpdate(d, prev, state, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.notifyBlockUpdate(d, prev, state, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.AEMaterials;
|
||||
|
||||
public class QuartzGlassBlock extends AbstractGlassBlock {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class QuartzGlassBlock extends AbstractGlassBlock {
|
||||
@Override
|
||||
public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, Direction side) {
|
||||
final Material mat = adjacentBlockState.getMaterial();
|
||||
if (mat == Material.GLASS || mat == AEGlassMaterial.INSTANCE) {
|
||||
if (mat == Material.GLASS || mat == AEMaterials.GLASS) {
|
||||
if (adjacentBlockState.getRenderType() == state.getRenderType()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
+24
-3
@@ -22,9 +22,30 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.block.material.PushReaction;
|
||||
|
||||
public class AEGlassMaterial {
|
||||
public class AEMaterials {
|
||||
|
||||
public static final Material INSTANCE = new Material(MaterialColor.AIR, false, false, true, false, true, false,
|
||||
false, PushReaction.NORMAL);
|
||||
public static final Material GLASS = make(MaterialColor.AIR, false, false, true, false, true, false, false,
|
||||
PushReaction.NORMAL);
|
||||
|
||||
/**
|
||||
* Small factory helper with named parameters.
|
||||
*
|
||||
* @param color
|
||||
* @param isLiquid
|
||||
* @param isSolid
|
||||
* @param blocksMovement
|
||||
* @param isOpaque
|
||||
* @param requiresNoTool
|
||||
* @param flammable
|
||||
* @param replaceable
|
||||
* @param pushReaction
|
||||
* @return
|
||||
*/
|
||||
private static Material make(MaterialColor color, boolean isLiquid, boolean isSolid, boolean blocksMovement,
|
||||
boolean isOpaque, boolean requiresNoTool, boolean flammable, boolean replaceable,
|
||||
PushReaction pushReaction) {
|
||||
return new Material(color, isLiquid, isSolid, blocksMovement, isOpaque, requiresNoTool, flammable, replaceable,
|
||||
pushReaction);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
package appeng.integration.modules.jei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -32,7 +34,12 @@ import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.JeiPlugin;
|
||||
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.constants.VanillaTypes;
|
||||
import mezz.jei.api.registration.*;
|
||||
import mezz.jei.api.registration.IAdvancedRegistration;
|
||||
import mezz.jei.api.registration.IRecipeCatalystRegistration;
|
||||
import mezz.jei.api.registration.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.registration.IRecipeRegistration;
|
||||
import mezz.jei.api.registration.IRecipeTransferRegistration;
|
||||
import mezz.jei.api.registration.ISubtypeRegistration;
|
||||
import mezz.jei.api.runtime.IJeiRuntime;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -44,6 +51,7 @@ import appeng.api.features.AEFeature;
|
||||
import appeng.container.implementations.CraftingTermContainer;
|
||||
import appeng.container.implementations.PatternTermContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
@@ -169,6 +177,32 @@ public class JEIPlugin implements IModPlugin {
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
|
||||
JEIFacade.setInstance(new JeiRuntimeAdapter(jeiRuntime));
|
||||
this.hideDebugTools(jeiRuntime);
|
||||
|
||||
}
|
||||
|
||||
private void hideDebugTools(IJeiRuntime jeiRuntime) {
|
||||
Collection<ItemStack> toRemove = new ArrayList<>();
|
||||
|
||||
// We use the internal API here as exception as debug tools are not part of the
|
||||
// public one by design.
|
||||
toRemove.add(Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack(1).orElse(null));
|
||||
|
||||
if (!AEConfig.instance().isFeatureEnabled(AEFeature.UNSUPPORTED_DEVELOPER_TOOLS)) {
|
||||
toRemove.add(Api.INSTANCE.definitions().blocks().cubeGenerator().maybeStack(1).orElse(null));
|
||||
toRemove.add(Api.INSTANCE.definitions().blocks().chunkLoader().maybeStack(1).orElse(null));
|
||||
toRemove.add(Api.INSTANCE.definitions().blocks().energyGenerator().maybeStack(1).orElse(null));
|
||||
toRemove.add(Api.INSTANCE.definitions().blocks().itemGen().maybeStack(1).orElse(null));
|
||||
toRemove.add(Api.INSTANCE.definitions().blocks().phantomNode().maybeStack(1).orElse(null));
|
||||
|
||||
toRemove.add(Api.INSTANCE.definitions().items().toolDebugCard().maybeStack(1).orElse(null));
|
||||
toRemove.add(Api.INSTANCE.definitions().items().toolEraser().maybeStack(1).orElse(null));
|
||||
toRemove.add(Api.INSTANCE.definitions().items().toolMeteoritePlacer().maybeStack(1).orElse(null));
|
||||
toRemove.add(Api.INSTANCE.definitions().items().toolReplicatorCard().maybeStack(1).orElse(null));
|
||||
}
|
||||
|
||||
jeiRuntime.getIngredientManager().removeIngredientsAtRuntime(mezz.jei.api.constants.VanillaTypes.ITEM,
|
||||
toRemove);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,12 +18,7 @@
|
||||
|
||||
package appeng.items.materials;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -37,7 +32,6 @@ import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -45,7 +39,6 @@ import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageComponent;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.api.implementations.tiles.ISegmentedInventory;
|
||||
@@ -86,34 +79,7 @@ public final class MaterialItem extends AEBaseItem implements IStorageComponent,
|
||||
|
||||
final Upgrades u = this.getType(stack);
|
||||
if (u != null) {
|
||||
final List<ITextComponent> textList = new ArrayList<>();
|
||||
for (final Entry<ItemStack, Integer> j : u.getSupported().entrySet()) {
|
||||
ITextComponent name = null;
|
||||
|
||||
final int limit = j.getValue();
|
||||
|
||||
if (j.getKey().getItem() instanceof IItemGroup) {
|
||||
final IItemGroup ig = (IItemGroup) j.getKey().getItem();
|
||||
final String str = ig.getUnlocalizedGroupName(u.getSupported().keySet(), j.getKey());
|
||||
if (str != null) {
|
||||
name = new TranslationTextComponent(str).appendText(limit > 1 ? " (" + limit + ')' : "");
|
||||
}
|
||||
}
|
||||
|
||||
if (name == null) {
|
||||
name = j.getKey().getDisplayName().appendText((limit > 1 ? " (" + limit + ')' : ""));
|
||||
}
|
||||
|
||||
if (!textList.contains(name)) {
|
||||
textList.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
final Pattern p = Pattern.compile("(\\d+)[^\\d]");
|
||||
// FIXME This comparison is not great...
|
||||
final SlightlyBetterSort s = new SlightlyBetterSort(p);
|
||||
textList.sort(s);
|
||||
lines.addAll(textList);
|
||||
lines.addAll(u.getTooltipLines());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,27 +195,4 @@ public final class MaterialItem extends AEBaseItem implements IStorageComponent,
|
||||
return false;
|
||||
}
|
||||
|
||||
private static class SlightlyBetterSort implements Comparator<ITextComponent> {
|
||||
private final Pattern pattern;
|
||||
|
||||
public SlightlyBetterSort(final Pattern pattern) {
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(final ITextComponent o1, final ITextComponent o2) {
|
||||
try {
|
||||
final Matcher a = this.pattern.matcher(o1.getString());
|
||||
final Matcher b = this.pattern.matcher(o2.getString());
|
||||
if (a.find() && b.find()) {
|
||||
final int ia = Integer.parseInt(a.group(1));
|
||||
final int ib = Integer.parseInt(b.group(1));
|
||||
return Integer.compare(ia, ib);
|
||||
}
|
||||
} catch (final Throwable t) {
|
||||
// ek!
|
||||
}
|
||||
return o1.getString().compareTo(o2.getString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ public class ColoredPartItem<T extends IPart> extends PartItem<T> {
|
||||
|
||||
private final AEColor color;
|
||||
|
||||
public ColoredPartItem(Properties properties, PartType type, Function<ItemStack, T> factory, AEColor color) {
|
||||
super(properties, type, factory);
|
||||
public ColoredPartItem(Properties properties, Function<ItemStack, T> factory, AEColor color) {
|
||||
super(properties, factory);
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,31 +18,24 @@
|
||||
|
||||
package appeng.items.parts;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
|
||||
public class PartItem<T extends IPart> extends AEBaseItem implements IPartItem<T>, IItemGroup {
|
||||
private final PartType type;
|
||||
public class PartItem<T extends IPart> extends AEBaseItem implements IPartItem<T> {
|
||||
|
||||
private final Function<ItemStack, T> factory;
|
||||
|
||||
public PartItem(Properties properties, PartType type, Function<ItemStack, T> factory) {
|
||||
public PartItem(Properties properties, Function<ItemStack, T> factory) {
|
||||
super(properties);
|
||||
this.type = type;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@@ -58,75 +51,9 @@ public class PartItem<T extends IPart> extends AEBaseItem implements IPartItem<T
|
||||
context.getHand(), context.getWorld());
|
||||
}
|
||||
|
||||
public PartType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T createPart(ItemStack is) {
|
||||
return factory.apply(is);
|
||||
}
|
||||
|
||||
private static PartType getTypeByStack(ItemStack is) {
|
||||
if (is.getItem() instanceof PartItem) {
|
||||
return ((PartItem<?>) is.getItem()).getType();
|
||||
}
|
||||
return PartType.INVALID_TYPE;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getUnlocalizedGroupName(final Set<ItemStack> others, final ItemStack is) {
|
||||
boolean importBus = false;
|
||||
boolean importBusFluids = false;
|
||||
boolean exportBus = false;
|
||||
boolean exportBusFluids = false;
|
||||
boolean group = false;
|
||||
|
||||
final PartType u = getTypeByStack(is);
|
||||
|
||||
for (final ItemStack stack : others) {
|
||||
if (stack.getItem() == this) {
|
||||
final PartType pt = getTypeByStack(stack);
|
||||
switch (pt) {
|
||||
case IMPORT_BUS:
|
||||
importBus = true;
|
||||
if (u == pt) {
|
||||
group = true;
|
||||
}
|
||||
break;
|
||||
case FLUID_IMPORT_BUS:
|
||||
importBusFluids = true;
|
||||
if (u == pt) {
|
||||
group = true;
|
||||
}
|
||||
break;
|
||||
case EXPORT_BUS:
|
||||
exportBus = true;
|
||||
if (u == pt) {
|
||||
group = true;
|
||||
}
|
||||
break;
|
||||
case FLUID_EXPORT_BUS:
|
||||
exportBusFluids = true;
|
||||
if (u == pt) {
|
||||
group = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (group && importBus && exportBus && (u == PartType.IMPORT_BUS || u == PartType.EXPORT_BUS)) {
|
||||
return GuiText.IOBuses.getTranslationKey();
|
||||
}
|
||||
if (group && importBusFluids && exportBusFluids
|
||||
&& (u == PartType.FLUID_IMPORT_BUS || u == PartType.FLUID_EXPORT_BUS)) {
|
||||
return GuiText.IOBusesFluids.getTranslationKey();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ import appeng.core.AELog;
|
||||
* Helps with the reflection magic needed to gather all models for AE2 cable bus
|
||||
* parts.
|
||||
*/
|
||||
class PartModelsHelper {
|
||||
public class PartModelsHelper {
|
||||
|
||||
static List<ResourceLocation> createModels(Class<?> clazz) {
|
||||
public static List<ResourceLocation> createModels(Class<?> clazz) {
|
||||
List<ResourceLocation> locations = new ArrayList<>();
|
||||
|
||||
// Check all static fields for used models
|
||||
@@ -78,7 +78,7 @@ class PartModelsHelper {
|
||||
continue;
|
||||
}
|
||||
|
||||
Object value = null;
|
||||
Object value;
|
||||
try {
|
||||
method.setAccessible(true);
|
||||
value = method.invoke(null);
|
||||
@@ -108,7 +108,7 @@ class PartModelsHelper {
|
||||
locations.addAll(((IPartModel) value).getModels());
|
||||
} else if (value instanceof Collection) {
|
||||
// Check that each object is an IPartModel
|
||||
Collection values = (Collection) value;
|
||||
Collection<?> values = (Collection<?>) value;
|
||||
for (Object candidate : values) {
|
||||
if (!(candidate instanceof IPartModel)) {
|
||||
AELog.error("List of locations obtained from {} contains a non resource location: {}", source,
|
||||
|
||||
@@ -1,243 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, 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.items.parts;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.fluids.parts.FluidAnnihilationPlanePart;
|
||||
import appeng.fluids.parts.FluidExportBusPart;
|
||||
import appeng.fluids.parts.FluidFormationPlanePart;
|
||||
import appeng.fluids.parts.FluidImportBusPart;
|
||||
import appeng.fluids.parts.FluidInterfacePart;
|
||||
import appeng.fluids.parts.FluidLevelEmitterPart;
|
||||
import appeng.fluids.parts.FluidStorageBusPart;
|
||||
import appeng.fluids.parts.FluidTerminalPart;
|
||||
import appeng.parts.automation.AnnihilationPlanePart;
|
||||
import appeng.parts.automation.ExportBusPart;
|
||||
import appeng.parts.automation.FormationPlanePart;
|
||||
import appeng.parts.automation.IdentityAnnihilationPlanePart;
|
||||
import appeng.parts.automation.ImportBusPart;
|
||||
import appeng.parts.automation.LevelEmitterPart;
|
||||
import appeng.parts.misc.CableAnchorPart;
|
||||
import appeng.parts.misc.InterfacePart;
|
||||
import appeng.parts.misc.InvertedToggleBusPart;
|
||||
import appeng.parts.misc.StorageBusPart;
|
||||
import appeng.parts.misc.ToggleBusPart;
|
||||
import appeng.parts.networking.CoveredCablePart;
|
||||
import appeng.parts.networking.CoveredDenseCablePart;
|
||||
import appeng.parts.networking.GlassCablePart;
|
||||
import appeng.parts.networking.QuartzFiberPart;
|
||||
import appeng.parts.networking.SmartCablePart;
|
||||
import appeng.parts.networking.SmartDenseCablePart;
|
||||
import appeng.parts.p2p.FEP2PTunnelPart;
|
||||
import appeng.parts.p2p.FluidP2PTunnelPart;
|
||||
import appeng.parts.p2p.ItemP2PTunnelPart;
|
||||
import appeng.parts.p2p.LightP2PTunnelPart;
|
||||
import appeng.parts.p2p.MEP2PTunnelPart;
|
||||
import appeng.parts.p2p.RedstoneP2PTunnelPart;
|
||||
import appeng.parts.reporting.ConversionMonitorPart;
|
||||
import appeng.parts.reporting.CraftingTerminalPart;
|
||||
import appeng.parts.reporting.DarkPanelPart;
|
||||
import appeng.parts.reporting.InterfaceTerminalPart;
|
||||
import appeng.parts.reporting.PanelPart;
|
||||
import appeng.parts.reporting.PatternTerminalPart;
|
||||
import appeng.parts.reporting.SemiDarkPanelPart;
|
||||
import appeng.parts.reporting.StorageMonitorPart;
|
||||
import appeng.parts.reporting.TerminalPart;
|
||||
|
||||
public enum PartType {
|
||||
INVALID_TYPE(EnumSet.of(AEFeature.CORE), EnumSet.noneOf(IntegrationType.class), null),
|
||||
|
||||
CABLE_GLASS(EnumSet.of(AEFeature.GLASS_CABLES), EnumSet.noneOf(IntegrationType.class), GlassCablePart.class) {
|
||||
@Override
|
||||
public boolean isCable() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
CABLE_COVERED(EnumSet.of(AEFeature.COVERED_CABLES), EnumSet.noneOf(IntegrationType.class), CoveredCablePart.class) {
|
||||
@Override
|
||||
public boolean isCable() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
CABLE_SMART(EnumSet.of(AEFeature.CHANNELS, AEFeature.SMART_CABLES), EnumSet.noneOf(IntegrationType.class),
|
||||
SmartCablePart.class) {
|
||||
@Override
|
||||
public boolean isCable() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
CABLE_DENSE_SMART(EnumSet.of(AEFeature.CHANNELS, AEFeature.DENSE_CABLES), EnumSet.noneOf(IntegrationType.class),
|
||||
SmartDenseCablePart.class) {
|
||||
@Override
|
||||
public boolean isCable() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
CABLE_DENSE_COVERED(EnumSet.of(AEFeature.CHANNELS, AEFeature.DENSE_CABLES), EnumSet.noneOf(IntegrationType.class),
|
||||
CoveredDenseCablePart.class) {
|
||||
@Override
|
||||
public boolean isCable() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
TOGGLE_BUS(EnumSet.of(AEFeature.TOGGLE_BUS), EnumSet.noneOf(IntegrationType.class), ToggleBusPart.class),
|
||||
|
||||
INVERTED_TOGGLE_BUS(EnumSet.of(AEFeature.TOGGLE_BUS), EnumSet.noneOf(IntegrationType.class),
|
||||
InvertedToggleBusPart.class),
|
||||
|
||||
CABLE_ANCHOR(EnumSet.of(AEFeature.CABLE_ANCHOR), EnumSet.noneOf(IntegrationType.class), CableAnchorPart.class),
|
||||
|
||||
QUARTZ_FIBER(EnumSet.of(AEFeature.QUARTZ_FIBER), EnumSet.noneOf(IntegrationType.class), QuartzFiberPart.class),
|
||||
|
||||
MONITOR(EnumSet.of(AEFeature.PANELS), EnumSet.noneOf(IntegrationType.class), PanelPart.class),
|
||||
|
||||
SEMI_DARK_MONITOR(EnumSet.of(AEFeature.PANELS), EnumSet.noneOf(IntegrationType.class), SemiDarkPanelPart.class),
|
||||
|
||||
DARK_MONITOR(EnumSet.of(AEFeature.PANELS), EnumSet.noneOf(IntegrationType.class), DarkPanelPart.class),
|
||||
|
||||
STORAGE_BUS(EnumSet.of(AEFeature.STORAGE_BUS), EnumSet.noneOf(IntegrationType.class), StorageBusPart.class),
|
||||
FLUID_STORAGE_BUS(EnumSet.of(AEFeature.FLUID_STORAGE_BUS), EnumSet.noneOf(IntegrationType.class),
|
||||
FluidStorageBusPart.class),
|
||||
|
||||
IMPORT_BUS(EnumSet.of(AEFeature.IMPORT_BUS), EnumSet.noneOf(IntegrationType.class), ImportBusPart.class),
|
||||
|
||||
FLUID_IMPORT_BUS(EnumSet.of(AEFeature.FLUID_IMPORT_BUS), EnumSet.noneOf(IntegrationType.class),
|
||||
FluidImportBusPart.class),
|
||||
|
||||
EXPORT_BUS(EnumSet.of(AEFeature.EXPORT_BUS), EnumSet.noneOf(IntegrationType.class), ExportBusPart.class),
|
||||
|
||||
FLUID_EXPORT_BUS(EnumSet.of(AEFeature.FLUID_EXPORT_BUS), EnumSet.noneOf(IntegrationType.class),
|
||||
FluidExportBusPart.class),
|
||||
|
||||
LEVEL_EMITTER(EnumSet.of(AEFeature.LEVEL_EMITTER), EnumSet.noneOf(IntegrationType.class), LevelEmitterPart.class),
|
||||
FLUID_LEVEL_EMITTER(EnumSet.of(AEFeature.FLUID_LEVEL_EMITTER), EnumSet.noneOf(IntegrationType.class),
|
||||
FluidLevelEmitterPart.class),
|
||||
|
||||
ANNIHILATION_PLANE(EnumSet.of(AEFeature.ANNIHILATION_PLANE), EnumSet.noneOf(IntegrationType.class),
|
||||
AnnihilationPlanePart.class),
|
||||
|
||||
IDENTITY_ANNIHILATION_PLANE(EnumSet.of(AEFeature.ANNIHILATION_PLANE, AEFeature.IDENTITY_ANNIHILATION_PLANE),
|
||||
EnumSet.noneOf(IntegrationType.class), IdentityAnnihilationPlanePart.class),
|
||||
|
||||
FLUID_ANNIHILATION_PLANE(EnumSet.of(AEFeature.FLUID_ANNIHILATION_PLANE), EnumSet.noneOf(IntegrationType.class),
|
||||
FluidAnnihilationPlanePart.class),
|
||||
|
||||
FORMATION_PLANE(EnumSet.of(AEFeature.FORMATION_PLANE), EnumSet.noneOf(IntegrationType.class),
|
||||
FormationPlanePart.class),
|
||||
|
||||
FLUID_FORMATION_PLANE(EnumSet.of(AEFeature.FLUID_FORMATION_PLANE), EnumSet.noneOf(IntegrationType.class),
|
||||
FluidFormationPlanePart.class),
|
||||
|
||||
PATTERN_TERMINAL(EnumSet.of(AEFeature.PATTERNS), EnumSet.noneOf(IntegrationType.class), PatternTerminalPart.class),
|
||||
|
||||
CRAFTING_TERMINAL(EnumSet.of(AEFeature.CRAFTING_TERMINAL), EnumSet.noneOf(IntegrationType.class),
|
||||
CraftingTerminalPart.class),
|
||||
|
||||
TERMINAL(EnumSet.of(AEFeature.TERMINAL), EnumSet.noneOf(IntegrationType.class), TerminalPart.class),
|
||||
|
||||
STORAGE_MONITOR(EnumSet.of(AEFeature.STORAGE_MONITOR), EnumSet.noneOf(IntegrationType.class),
|
||||
StorageMonitorPart.class),
|
||||
|
||||
CONVERSION_MONITOR(EnumSet.of(AEFeature.PART_CONVERSION_MONITOR), EnumSet.noneOf(IntegrationType.class),
|
||||
ConversionMonitorPart.class),
|
||||
|
||||
INTERFACE(EnumSet.of(AEFeature.INTERFACE), EnumSet.noneOf(IntegrationType.class), InterfacePart.class),
|
||||
FLUID_INTERFACE(EnumSet.of(AEFeature.FLUID_INTERFACE), EnumSet.noneOf(IntegrationType.class),
|
||||
FluidInterfacePart.class),
|
||||
|
||||
P2P_TUNNEL_ME(EnumSet.of(AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_ME), EnumSet.noneOf(IntegrationType.class),
|
||||
MEP2PTunnelPart.class),
|
||||
|
||||
P2P_TUNNEL_REDSTONE(EnumSet.of(AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_REDSTONE),
|
||||
EnumSet.noneOf(IntegrationType.class), RedstoneP2PTunnelPart.class),
|
||||
|
||||
P2P_TUNNEL_ITEM(EnumSet.of(AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_ITEMS), EnumSet.noneOf(IntegrationType.class),
|
||||
ItemP2PTunnelPart.class),
|
||||
|
||||
P2P_TUNNEL_FLUID(EnumSet.of(AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FLUIDS),
|
||||
EnumSet.noneOf(IntegrationType.class), FluidP2PTunnelPart.class),
|
||||
|
||||
//FIXME P2P_TUNNEL_IC2( 465, "p2p_tunnel_ic2", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_EU ), EnumSet
|
||||
//FIXME .of( IntegrationType.IC2 ), PartP2PIC2Power.class ),
|
||||
|
||||
P2P_TUNNEL_LIGHT(EnumSet.of(AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_LIGHT),
|
||||
EnumSet.noneOf(IntegrationType.class), LightP2PTunnelPart.class),
|
||||
|
||||
P2P_TUNNEL_FE(EnumSet.of(AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FE), EnumSet.noneOf(IntegrationType.class),
|
||||
FEP2PTunnelPart.class),
|
||||
|
||||
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel,
|
||||
// AEFeature.P2PTunnelOpenComputers ), EnumSet.of(
|
||||
// IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel
|
||||
// ),
|
||||
|
||||
INTERFACE_TERMINAL(EnumSet.of(AEFeature.INTERFACE_TERMINAL), EnumSet.noneOf(IntegrationType.class),
|
||||
InterfaceTerminalPart.class),
|
||||
|
||||
FLUID_TERMINAL(EnumSet.of(AEFeature.FLUID_TERMINAL), EnumSet.noneOf(IntegrationType.class),
|
||||
FluidTerminalPart.class);
|
||||
|
||||
private final Set<AEFeature> features;
|
||||
private final Set<IntegrationType> integrations;
|
||||
private final Set<ResourceLocation> models;
|
||||
|
||||
PartType(final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c) {
|
||||
this.features = Collections.unmodifiableSet(features);
|
||||
this.integrations = Collections.unmodifiableSet(integrations);
|
||||
|
||||
if (c != null) {
|
||||
this.models = new HashSet<>(PartModelsHelper.createModels(c));
|
||||
} else {
|
||||
this.models = Collections.emptySet();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Set<AEFeature> getFeature() {
|
||||
return this.features;
|
||||
}
|
||||
|
||||
Set<IntegrationType> getIntegrations() {
|
||||
return this.integrations;
|
||||
}
|
||||
|
||||
public Set<ResourceLocation> getModels() {
|
||||
return this.models;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
enum IntegrationType {
|
||||
}
|
||||
@@ -39,7 +39,6 @@ import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.exceptions.MissingDefinitionException;
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
@@ -60,8 +59,7 @@ import appeng.util.Platform;
|
||||
* @version rv6 - 2018-01-17
|
||||
* @since rv6 2018-01-17
|
||||
*/
|
||||
public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseItem
|
||||
implements IStorageCell<T>, IItemGroup {
|
||||
public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseItem implements IStorageCell<T> {
|
||||
protected final MaterialType component;
|
||||
protected final int totalBytes;
|
||||
|
||||
@@ -104,11 +102,6 @@ public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseI
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName(final Set<ItemStack> others, final ItemStack is) {
|
||||
return GuiText.StorageCells.getTranslationKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable(final ItemStack is) {
|
||||
return true;
|
||||
|
||||
@@ -52,7 +52,6 @@ import net.minecraftforge.items.IItemHandler;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.implementations.tiles.IColorableTile;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
@@ -80,7 +79,7 @@ import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class ColorApplicatorItem extends AEBasePoweredItem
|
||||
implements IStorageCell<IAEItemStack>, IItemGroup, IBlockTool, IMouseWheelItem {
|
||||
implements IStorageCell<IAEItemStack>, IBlockTool, IMouseWheelItem {
|
||||
|
||||
private static final Map<ResourceLocation, AEColor> TAG_TO_COLOR = ImmutableMap.<ResourceLocation, AEColor>builder()
|
||||
.put(new ResourceLocation("forge:dyes/black"), AEColor.BLACK)
|
||||
@@ -409,11 +408,6 @@ public class ColorApplicatorItem extends AEBasePoweredItem
|
||||
return AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName(final Set<ItemStack> others, final ItemStack is) {
|
||||
return GuiText.StorageCells.getTranslationKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable(final ItemStack is) {
|
||||
return true;
|
||||
|
||||
@@ -39,7 +39,6 @@ import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.implementations.guiobjects.IGuiItem;
|
||||
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.storage.IStorageChannel;
|
||||
import appeng.api.storage.cells.ICellInventoryHandler;
|
||||
@@ -55,7 +54,7 @@ import appeng.items.contents.CellUpgrades;
|
||||
import appeng.items.contents.PortableCellViewer;
|
||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
|
||||
public class PortableCellItem extends AEBasePoweredItem implements IStorageCell<IAEItemStack>, IGuiItem, IItemGroup {
|
||||
public class PortableCellItem extends AEBasePoweredItem implements IStorageCell<IAEItemStack>, IGuiItem {
|
||||
public PortableCellItem(Item.Properties props) {
|
||||
super(AEConfig.instance().getPortableCellBattery(), props);
|
||||
}
|
||||
@@ -118,11 +117,6 @@ public class PortableCellItem extends AEBasePoweredItem implements IStorageCell<
|
||||
return AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName(final Set<ItemStack> others, final ItemStack is) {
|
||||
return GuiText.StorageCells.getTranslationKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable(final ItemStack is) {
|
||||
return true;
|
||||
|
||||
@@ -42,7 +42,7 @@ import appeng.util.ReadOnlyCollection;
|
||||
public class Grid implements IGrid {
|
||||
private final NetworkEventBus eventBus = new NetworkEventBus();
|
||||
private final Map<Class<? extends IGridHost>, MachineSet> machines = new HashMap<>();
|
||||
private final Map<Class<? extends IGridCache>, GridCacheWrapper> caches = new HashMap<>();
|
||||
private final Map<Class<? extends IGridCache>, GridCacheWrapper> caches;
|
||||
private GridNode pivot;
|
||||
private int priority; // how import is this network?
|
||||
private GridStorage myStorage;
|
||||
@@ -52,6 +52,7 @@ public class Grid implements IGrid {
|
||||
|
||||
final Map<Class<? extends IGridCache>, IGridCache> myCaches = AEApi.instance().registries().gridCache()
|
||||
.createCacheInstance(this);
|
||||
this.caches = new HashMap<>(myCaches.size());
|
||||
for (final Entry<Class<? extends IGridCache>, IGridCache> c : myCaches.entrySet()) {
|
||||
final Class<? extends IGridCache> key = c.getKey();
|
||||
final IGridCache value = c.getValue();
|
||||
|
||||
+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) {
|
||||
|
||||
+3
-12
@@ -39,7 +39,6 @@ import appeng.me.cache.helpers.TickTracker;
|
||||
|
||||
public class TickManagerCache implements ITickManager {
|
||||
|
||||
private final IGrid myGrid;
|
||||
private final HashMap<IGridNode, TickTracker> alertable = new HashMap<>();
|
||||
private final HashMap<IGridNode, TickTracker> sleeping = new HashMap<>();
|
||||
private final HashMap<IGridNode, TickTracker> awake = new HashMap<>();
|
||||
@@ -47,12 +46,7 @@ public class TickManagerCache implements ITickManager {
|
||||
|
||||
private long currentTick = 0;
|
||||
|
||||
public TickManagerCache(final IGrid g) {
|
||||
this.myGrid = g;
|
||||
}
|
||||
|
||||
public long getCurrentTick() {
|
||||
return this.currentTick;
|
||||
public TickManagerCache(@SuppressWarnings("unused") final IGrid g) {
|
||||
}
|
||||
|
||||
public long getAvgNanoTime(final IGridNode node) {
|
||||
@@ -66,7 +60,7 @@ public class TickManagerCache implements ITickManager {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return tt.getAvgNanos();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,7 +140,7 @@ public class TickManagerCache implements ITickManager {
|
||||
|
||||
Preconditions.checkNotNull(tr);
|
||||
|
||||
final TickTracker tt = new TickTracker(tr, gridNode, (IGridTickable) machine, this.currentTick, this);
|
||||
final TickTracker tt = new TickTracker(tr, gridNode, (IGridTickable) machine, this.currentTick);
|
||||
|
||||
if (tr.canBeAlerted) {
|
||||
this.alertable.put(gridNode, tt);
|
||||
@@ -184,9 +178,6 @@ public class TickManagerCache implements ITickManager {
|
||||
if (tt == null) {
|
||||
return false;
|
||||
}
|
||||
// throw new RuntimeException(
|
||||
// "Invalid alerted device, this node is not marked as alertable, or part of
|
||||
// this grid." );
|
||||
|
||||
// set to awake, this is for sanity.
|
||||
this.sleeping.remove(node);
|
||||
|
||||
+4
-12
@@ -25,9 +25,8 @@ import net.minecraft.crash.CrashReportCategory;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.ticking.IGridTickable;
|
||||
import appeng.api.networking.ticking.TickingRequest;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.me.cache.TickManagerCache;
|
||||
import appeng.parts.AEBasePart;
|
||||
|
||||
public class TickTracker implements Comparable<TickTracker> {
|
||||
|
||||
@@ -35,13 +34,10 @@ public class TickTracker implements Comparable<TickTracker> {
|
||||
private final IGridTickable gt;
|
||||
private final IGridNode node;
|
||||
|
||||
private final long LastFiveTicksTime = 0;
|
||||
|
||||
private long lastTick;
|
||||
private int currentRate;
|
||||
|
||||
public TickTracker(final TickingRequest req, final IGridNode node, final IGridTickable gt, final long currentTick,
|
||||
final TickManagerCache tickManagerCache) {
|
||||
public TickTracker(final TickingRequest req, final IGridNode node, final IGridTickable gt, final long currentTick) {
|
||||
this.request = req;
|
||||
this.gt = gt;
|
||||
this.node = node;
|
||||
@@ -49,10 +45,6 @@ public class TickTracker implements Comparable<TickTracker> {
|
||||
this.setLastTick(currentTick);
|
||||
}
|
||||
|
||||
public long getAvgNanos() {
|
||||
return (this.LastFiveTicksTime / 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@Nonnull final TickTracker t) {
|
||||
int next = Long.compare(this.getNextTick(), t.getNextTick());
|
||||
@@ -72,8 +64,8 @@ public class TickTracker implements Comparable<TickTracker> {
|
||||
}
|
||||
|
||||
public void addEntityCrashInfo(final CrashReportCategory crashreportcategory) {
|
||||
if (this.getGridTickable() instanceof AEBasePart) {
|
||||
final AEBasePart part = (AEBasePart) this.getGridTickable();
|
||||
if (this.getGridTickable() instanceof IPart) {
|
||||
final IPart part = (IPart) this.getGridTickable();
|
||||
part.addEntityCrashInfo(crashreportcategory);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ import net.minecraft.crash.CrashReportCategory;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
@@ -67,8 +66,6 @@ import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.helpers.ICustomNameObject;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.items.parts.PartItem;
|
||||
import appeng.items.parts.PartType;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
import appeng.me.helpers.IGridProxyable;
|
||||
import appeng.parts.networking.CablePart;
|
||||
@@ -96,15 +93,6 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
return this.host;
|
||||
}
|
||||
|
||||
public PartType getType() {
|
||||
Item item = this.is.getItem();
|
||||
if (!(item instanceof PartItem)) {
|
||||
return PartType.INVALID_TYPE;
|
||||
}
|
||||
|
||||
return ((PartItem<?>) item).getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode(final AEPartLocation dir) {
|
||||
return this.proxy.getNode();
|
||||
@@ -182,6 +170,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
return this.getItemStack().hasDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEntityCrashInfo(final CrashReportCategory crashreportcategory) {
|
||||
crashreportcategory.addDetail("Part Side", this.getSide());
|
||||
}
|
||||
|
||||
@@ -623,14 +623,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone(final EnumSet<Direction> enumSet) {
|
||||
for (final Direction dir : enumSet) {
|
||||
final IPart part = this.getPart(dir);
|
||||
if (part != null && part.canConnectRedstone()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
public boolean canConnectRedstone(final Direction opposite) {
|
||||
final IPart part = this.getPart(opposite);
|
||||
return part != null && part.canConnectRedstone();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package appeng.parts;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -43,7 +42,7 @@ public interface ICableBusContainer {
|
||||
|
||||
int isProvidingWeakPower(Direction opposite);
|
||||
|
||||
boolean canConnectRedstone(EnumSet<Direction> of);
|
||||
boolean canConnectRedstone(Direction opposite);
|
||||
|
||||
void onEntityCollision(Entity e);
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package appeng.parts;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -48,7 +47,7 @@ public class NullCableBusContainer implements ICableBusContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone(final EnumSet<Direction> of) {
|
||||
public boolean canConnectRedstone(final Direction opposite) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -225,24 +225,22 @@ public class PartPlacement {
|
||||
host = (IPartHost) tile;
|
||||
}
|
||||
|
||||
final Optional<ItemStack> maybeMultiPartStack = multiPart.maybeStack(1);
|
||||
final Optional<Block> maybeMultiPartBlock = multiPart.maybeBlock();
|
||||
final Optional<BlockItem> maybeMultiPartBlockItem = multiPart.maybeBlockItem();
|
||||
ItemStack multiPartStack = multiPart.stack(1);
|
||||
Block multiPartBlock = multiPart.block();
|
||||
BlockItem multiPartBlockItem = multiPart.blockItem();
|
||||
|
||||
final boolean hostIsNotPresent = host == null;
|
||||
final boolean multiPartPresent = maybeMultiPartBlock.isPresent() && maybeMultiPartStack.isPresent()
|
||||
&& maybeMultiPartBlockItem.isPresent();
|
||||
BlockState multiPartBlockState = maybeMultiPartBlock.get().getDefaultState();
|
||||
final boolean canMultiPartBePlaced = multiPartBlockState.isValidPosition(world, te_pos);
|
||||
boolean hostIsNotPresent = host == null;
|
||||
BlockState multiPartBlockState = multiPartBlock.getDefaultState();
|
||||
boolean canMultiPartBePlaced = multiPartBlockState.isValidPosition(world, te_pos);
|
||||
|
||||
// We cannot override the item stack of normal use context, so we use this hack
|
||||
BlockItemUseContext mpUseCtx = new BlockItemUseContext(
|
||||
new DirectionalPlaceContext(world, te_pos, side, maybeMultiPartStack.get(), side));
|
||||
new DirectionalPlaceContext(world, te_pos, side, multiPartStack, side));
|
||||
|
||||
// FIXME: This is super-fishy and all needs to be re-checked. what does this
|
||||
// even do???
|
||||
if (hostIsNotPresent && multiPartPresent && canMultiPartBePlaced
|
||||
&& maybeMultiPartBlockItem.get().tryPlace(mpUseCtx) == ActionResultType.SUCCESS) {
|
||||
if (hostIsNotPresent && canMultiPartBePlaced
|
||||
&& multiPartBlockItem.tryPlace(mpUseCtx).isSuccessOrConsume()) {
|
||||
if (!world.isRemote) {
|
||||
tile = world.getTileEntity(te_pos);
|
||||
|
||||
|
||||
@@ -36,17 +36,12 @@ public class BlockUpgradeInventory extends UpgradeInventory {
|
||||
|
||||
@Override
|
||||
public int getMaxInstalled(final Upgrades upgrades) {
|
||||
int max = 0;
|
||||
|
||||
for (final ItemStack is : upgrades.getSupported().keySet()) {
|
||||
final Item encodedItem = is.getItem();
|
||||
|
||||
if (encodedItem instanceof BlockItem && Block.getBlockFromItem(encodedItem) == this.block) {
|
||||
max = upgrades.getSupported().get(is);
|
||||
break;
|
||||
for (final Upgrades.Supported supported : upgrades.getSupported()) {
|
||||
if (supported.isSupported(block)) {
|
||||
return supported.getMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
return max;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,15 +35,12 @@ public final class DefinitionUpgradeInventory extends UpgradeInventory {
|
||||
|
||||
@Override
|
||||
public int getMaxInstalled(final Upgrades upgrades) {
|
||||
int max = 0;
|
||||
|
||||
for (final ItemStack stack : upgrades.getSupported().keySet()) {
|
||||
if (this.definition.isSameAs(stack)) {
|
||||
max = upgrades.getSupported().get(stack);
|
||||
break;
|
||||
for (final Upgrades.Supported supported : upgrades.getSupported()) {
|
||||
if (supported.isSupported(definition.item())) {
|
||||
return supported.getMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
return max;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,15 +33,12 @@ public class StackUpgradeInventory extends UpgradeInventory {
|
||||
|
||||
@Override
|
||||
public int getMaxInstalled(final Upgrades upgrades) {
|
||||
int max = 0;
|
||||
|
||||
for (final ItemStack is : upgrades.getSupported().keySet()) {
|
||||
if (ItemStack.areItemsEqual(this.stack, is)) {
|
||||
max = upgrades.getSupported().get(is);
|
||||
break;
|
||||
for (final Upgrades.Supported supported : upgrades.getSupported()) {
|
||||
if (supported.isSupported(stack.getItem())) {
|
||||
return supported.getMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
return max;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class StorageChunkGenerator extends ChunkGenerator<GenerationSettings> {
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,13 @@ import appeng.util.item.AEItemStack;
|
||||
|
||||
public class ChestTileEntity extends AENetworkPowerTileEntity
|
||||
implements IMEChest, ITerminalHost, IPriorityHost, IConfigManagerHost, IColorableTile, ITickableTileEntity {
|
||||
|
||||
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 cellInventory = new AppEngInternalInventory(this, 1);
|
||||
private final IItemHandler internalInventory = new WrapperChainedItemHandler(this.inputInventory,
|
||||
@@ -163,13 +170,13 @@ public class ChestTileEntity extends AENetworkPowerTileEntity
|
||||
final int oldState = this.state;
|
||||
|
||||
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()) {
|
||||
this.state |= 0x40;
|
||||
this.state |= BIT_POWER_MASK;
|
||||
} else {
|
||||
this.state &= ~0x40;
|
||||
this.state &= ~BIT_POWER_MASK;
|
||||
}
|
||||
|
||||
final boolean currentActive = this.getProxy().isActive();
|
||||
@@ -245,7 +252,7 @@ public class ChestTileEntity extends AENetworkPowerTileEntity
|
||||
@Override
|
||||
public CellState getCellStatus(final int slot) {
|
||||
if (isRemote()) {
|
||||
return CellState.values()[(this.state >> (slot * 3)) & 3];
|
||||
return CellState.values()[(this.state >> (slot * BIT_CELL_STATE_BITS)) & BIT_CELL_STATE_MASK];
|
||||
}
|
||||
|
||||
this.updateHandler();
|
||||
@@ -273,7 +280,7 @@ public class ChestTileEntity extends AENetworkPowerTileEntity
|
||||
@Override
|
||||
public boolean isPowered() {
|
||||
if (isRemote()) {
|
||||
return (this.state & 0x40) == 0x40;
|
||||
return (this.state & BIT_POWER_MASK) == BIT_POWER_MASK;
|
||||
}
|
||||
|
||||
boolean gridPowered = this.getAECurrentPower() > 64;
|
||||
@@ -290,12 +297,7 @@ public class ChestTileEntity extends AENetworkPowerTileEntity
|
||||
|
||||
@Override
|
||||
public boolean isCellBlinking(final int slot) {
|
||||
final long now = this.world.getGameTime();
|
||||
if (now - this.lastStateChange > 8) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ((this.state >> (slot * 3 + 2)) & 0x01) == 0x01;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -327,14 +329,14 @@ public class ChestTileEntity extends AENetworkPowerTileEntity
|
||||
try {
|
||||
if (!this.getProxy().getEnergy().isNetworkPowered()) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
} catch (final GridAccessException e) {
|
||||
final double powerUsed = this.extractAEPower(this.getProxy().getIdlePowerUsage(), 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();
|
||||
}
|
||||
}
|
||||
@@ -348,20 +350,16 @@ public class ChestTileEntity extends AENetworkPowerTileEntity
|
||||
protected void writeToStream(final PacketBuffer data) throws IOException {
|
||||
super.writeToStream(data);
|
||||
|
||||
if (this.world.getGameTime() - this.lastStateChange > 8) {
|
||||
this.state = 0;
|
||||
} else {
|
||||
this.state &= 0x24924924; // just keep the blinks...
|
||||
}
|
||||
this.state = 0;
|
||||
|
||||
for (int x = 0; x < this.getCellCount(); x++) {
|
||||
this.state |= (this.getCellStatus(x).ordinal() << (3 * x));
|
||||
}
|
||||
|
||||
if (this.isPowered()) {
|
||||
this.state |= 0x40;
|
||||
this.state |= BIT_POWER_MASK;
|
||||
} else {
|
||||
this.state &= ~0x40;
|
||||
this.state &= ~BIT_POWER_MASK;
|
||||
}
|
||||
|
||||
data.writeByte(this.state);
|
||||
@@ -519,7 +517,7 @@ public class ChestTileEntity extends AENetworkPowerTileEntity
|
||||
}
|
||||
this.lastStateChange = now;
|
||||
|
||||
this.state |= 1 << (slot * 3 + 2);
|
||||
this.state |= 1 << (slot * BIT_CELL_STATE_BITS + 2);
|
||||
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -75,9 +77,11 @@ import appeng.util.inv.filter.IAEItemFilter;
|
||||
|
||||
public class DriveTileEntity extends AENetworkInvTileEntity implements IChestOrDrive, IPriorityHost {
|
||||
|
||||
private static final int BIT_POWER_MASK = 0x80000000;
|
||||
private static final int BIT_BLINK_MASK = 0x24924924;
|
||||
private static final int BIT_STATE_MASK = 0xDB6DB6DB;
|
||||
private static final int BIT_POWER_MASK = Integer.MIN_VALUE;
|
||||
private static final int BIT_STATE_MASK = 0b111111111111111111111111111111;
|
||||
|
||||
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 ICellHandler[] handlersBySlot = new ICellHandler[10];
|
||||
@@ -93,13 +97,18 @@ public class DriveTileEntity extends AENetworkInvTileEntity implements IChestOrD
|
||||
/**
|
||||
* 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
|
||||
* state of each cell with the cell in slot 0 located in the 3 least significant
|
||||
* bits.
|
||||
* - Bit 31: power state. 0 = off, 1 = on.
|
||||
*
|
||||
* - 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;
|
||||
|
||||
@@ -111,6 +120,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);
|
||||
@@ -120,8 +135,11 @@ public class DriveTileEntity extends AENetworkInvTileEntity implements IChestOrD
|
||||
newState |= BIT_POWER_MASK;
|
||||
}
|
||||
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);
|
||||
|
||||
writeCellItemIds(data);
|
||||
@@ -216,7 +234,8 @@ public class DriveTileEntity extends AENetworkInvTileEntity implements IChestOrD
|
||||
@Override
|
||||
public CellState getCellStatus(final int slot) {
|
||||
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];
|
||||
@@ -238,7 +257,7 @@ public class DriveTileEntity extends AENetworkInvTileEntity implements IChestOrD
|
||||
|
||||
@Override
|
||||
public boolean isCellBlinking(final int slot) {
|
||||
return ((this.state >> (slot * 3 + 2)) & 0x01) == 0x01;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -278,7 +297,7 @@ public class DriveTileEntity extends AENetworkInvTileEntity implements IChestOrD
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -408,8 +427,6 @@ public class DriveTileEntity extends AENetworkInvTileEntity implements IChestOrD
|
||||
|
||||
@Override
|
||||
public void blinkCell(final int slot) {
|
||||
this.state |= 1 << (slot * 3 + 2);
|
||||
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
|
||||
|
||||
@@ -216,11 +216,16 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
if (ia instanceof AEItemStack) {
|
||||
return this.isSameType((AEItemStack) ia);
|
||||
} else if (ia instanceof ItemStack) {
|
||||
return this.isSameType((ItemStack) ia);
|
||||
// this actually breaks the equals contract (being equals to unrelated classes)
|
||||
return equals((ItemStack) ia);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(final ItemStack is) {
|
||||
return this.isSameType(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getStackSize() + "x" + this.getDefinition().getItem().getRegistryName();
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MeteoriteStructureStart extends StructureStart {
|
||||
int scanRadius = (int) Math.max(1, meteoriteRadius * 2);
|
||||
for (int x = -scanRadius; x <= scanRadius; x++) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ public class MeteoriteStructureStart extends StructureStart {
|
||||
final double distanceFrom = dx * dx + dz * dz;
|
||||
|
||||
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) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"slot_state": "online|types_full|full"
|
||||
"slot_state": "online|not_empty|types_full|full"
|
||||
},
|
||||
"apply": {
|
||||
"model": "appliedenergistics2:block/chest/lights_on"
|
||||
@@ -45,6 +45,14 @@
|
||||
"model": "appliedenergistics2:block/chest/cell_state_online"
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"slot_state": "not_empty"
|
||||
},
|
||||
"apply": {
|
||||
"model": "appliedenergistics2:block/chest/cell_state_not_empty"
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 146 B |
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"values": []
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"values": []
|
||||
}
|
||||
Reference in New Issue
Block a user