More moves and compilation fixes
This commit is contained in:
@@ -43,10 +43,10 @@ import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.*;
|
||||
import net.minecraft.util.hit.HitResult.Type;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -87,7 +87,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
|
||||
public boolean isTranslucent(BlockState state, BlockView reader, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
ICableBusContainer cb = this.cb(world, blockPos);
|
||||
|
||||
// Our built-in model has the actual baked sprites we need
|
||||
BakedModel model = MinecraftClient.getInstance().getBlockRendererDispatcher()
|
||||
BakedModel model = MinecraftClient.getInstance().getBlockRenderManager()
|
||||
.getModelForState(this.getDefaultState());
|
||||
|
||||
// We cannot add the effect if we don't have the model
|
||||
@@ -234,7 +234,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
ICableBusContainer cb = this.cb(world, pos);
|
||||
|
||||
// Our built-in model has the actual baked sprites we need
|
||||
BakedModel model = MinecraftClient.getInstance().getBlockRendererDispatcher()
|
||||
BakedModel model = MinecraftClient.getInstance().getBlockRenderManager()
|
||||
.getModelForState(this.getDefaultState());
|
||||
|
||||
// We cannot add the effect if we dont have the model
|
||||
@@ -347,7 +347,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> itemStacks) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.state.IntegerProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
@@ -43,8 +43,8 @@ public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellBlockEntity> {
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
|
||||
super.fillItemGroup(group, itemStacks);
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> itemStacks) {
|
||||
super.appendStacks(group, itemStacks);
|
||||
|
||||
final ItemStack charged = new ItemStack(this, 1);
|
||||
final CompoundTag tag = charged.getOrCreateTag();
|
||||
|
||||
@@ -221,7 +221,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
|
||||
public boolean isTranslucent(BlockState state, BlockView reader, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.Direction;
|
||||
@@ -35,11 +35,11 @@ import appeng.tile.misc.PaintSplotchesBlockEntity;
|
||||
*/
|
||||
class PaintSplotchesBakedModel implements IDynamicBakedModel {
|
||||
|
||||
private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_PAINT1 = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/paint1"));
|
||||
private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_PAINT2 = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/paint2"));
|
||||
private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_PAINT3 = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/paint3"));
|
||||
|
||||
private final Sprite[] textures;
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
@@ -49,7 +49,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesBlockEnti
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> itemStacks) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.Direction;
|
||||
@@ -32,17 +32,17 @@ import appeng.tile.qnb.QuantumBridgeBlockEntity;
|
||||
|
||||
class QnbFormedBakedModel implements IDynamicBakedModel {
|
||||
|
||||
private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_LINK = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/quantum_link"));
|
||||
private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_RING = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/quantum_ring"));
|
||||
private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_RING_LIGHT = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/quantum_ring_light"));
|
||||
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/quantum_ring_light_corner"));
|
||||
private static final Material TEXTURE_CABLE_GLASS = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_CABLE_GLASS = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "parts/cable/glass/transparent"));
|
||||
private static final Material TEXTURE_COVERED_CABLE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_COVERED_CABLE = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "parts/cable/covered/transparent"));
|
||||
|
||||
private static final float DEFAULT_RENDER_MIN = 2.0f;
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.block.piston.PistonBehavior;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
@@ -60,7 +60,7 @@ public class MatrixFrameBlock extends AEBaseBlock {
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> itemStacks) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class MatrixFrameBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
|
||||
public boolean isTranslucent(BlockState state, BlockView reader, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,124 +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.block.storage;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.SkyChestContainer;
|
||||
import appeng.tile.storage.SkyChestBlockEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class SkyChestBlock extends AEBaseTileBlock<SkyChestBlockEntity> {
|
||||
|
||||
private static final double AABB_OFFSET_BOTTOM = 0.00;
|
||||
private static final double AABB_OFFSET_SIDES = 0.06;
|
||||
private static final double AABB_OFFSET_TOP = 0.125;
|
||||
|
||||
public enum SkyChestType {
|
||||
STONE, BLOCK
|
||||
};
|
||||
|
||||
public final SkyChestType type;
|
||||
|
||||
public SkyChestBlock(final SkyChestType type, Settings props) {
|
||||
super(props);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType(BlockState state) {
|
||||
return BlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
|
||||
final @Nullable ItemStack heldItem, final BlockHitResult hit) {
|
||||
if (Platform.isServer()) {
|
||||
SkyChestBlockEntity tile = getBlockEntity(w, pos);
|
||||
if (tile == null) {
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
ContainerOpener.openContainer(SkyChestContainer.TYPE, player, ContainerLocator.forTileEntity(tile));
|
||||
}
|
||||
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
// TODO Cache this! It can't be that hard!
|
||||
Box aabb = computeAABB(worldIn, pos);
|
||||
return VoxelShapes.cuboid(aabb);
|
||||
}
|
||||
|
||||
private Box computeAABB(final BlockView w, final BlockPos pos) {
|
||||
final SkyChestBlockEntity sk = this.getBlockEntity(w, pos);
|
||||
Direction o = Direction.UP;
|
||||
|
||||
if (sk != null) {
|
||||
o = sk.getUp();
|
||||
}
|
||||
|
||||
final double offsetX = o.getOffsetX() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
final double offsetY = o.getOffsetY() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
final double offsetZ = o.getOffsetZ() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
|
||||
// for x/z top and bottom is swapped
|
||||
final double minX = Math.max(0.0,
|
||||
offsetX + (o.getOffsetX() < 0 ? AABB_OFFSET_BOTTOM : (o.getOffsetX() * AABB_OFFSET_TOP)));
|
||||
final double minY = Math.max(0.0,
|
||||
offsetY + (o.getOffsetY() < 0 ? AABB_OFFSET_TOP : (o.getOffsetY() * AABB_OFFSET_BOTTOM)));
|
||||
final double minZ = Math.max(0.0,
|
||||
offsetZ + (o.getOffsetZ() < 0 ? AABB_OFFSET_BOTTOM : (o.getOffsetZ() * AABB_OFFSET_TOP)));
|
||||
|
||||
final double maxX = Math.min(1.0,
|
||||
1.0 - offsetX - (o.getOffsetX() < 0 ? AABB_OFFSET_TOP : (o.getOffsetX() * AABB_OFFSET_BOTTOM)));
|
||||
final double maxY = Math.min(1.0,
|
||||
1.0 - offsetY - (o.getOffsetY() < 0 ? AABB_OFFSET_BOTTOM : (o.getOffsetY() * AABB_OFFSET_TOP)));
|
||||
final double maxZ = Math.min(1.0,
|
||||
1.0 - offsetZ - (o.getOffsetZ() < 0 ? AABB_OFFSET_TOP : (o.getOffsetZ() * AABB_OFFSET_BOTTOM)));
|
||||
|
||||
return new Box(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
package appeng.client;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public enum ActionKey {
|
||||
TOGGLE_FOCUS(GLFW.GLFW_KEY_TAB);
|
||||
|
||||
private final int defaultKey;
|
||||
|
||||
private ActionKey(int defaultKey) {
|
||||
this.defaultKey = defaultKey;
|
||||
}
|
||||
|
||||
public String getTranslationKey() {
|
||||
return "key." + this.name().toLowerCase() + ".desc";
|
||||
}
|
||||
|
||||
public int getDefaultKey() {
|
||||
return this.defaultKey;
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import java.util.Random;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
@@ -91,9 +92,6 @@ public class ClientHelper extends ServerHelper {
|
||||
case Energy:
|
||||
this.spawnEnergy(world, posX, posY, posZ);
|
||||
return;
|
||||
case Lightning:
|
||||
this.spawnLightning(world, posX, posY, posZ);
|
||||
return;
|
||||
case LightningArc:
|
||||
this.spawnLightningArc(world, posX, posY, posZ, (Vec3d) o);
|
||||
return;
|
||||
@@ -188,11 +186,6 @@ public class ClientHelper extends ServerHelper {
|
||||
-x * 0.1, -y * 0.1, -z * 0.1);
|
||||
}
|
||||
|
||||
private void spawnLightning(final World world, final double posX, final double posY, final double posZ) {
|
||||
MinecraftClient.getInstance().particleManager.addParticle(ParticleTypes.LIGHTNING, posX, posY + 0.3f, posZ, 0.0f, 0.0f,
|
||||
0.0f);
|
||||
}
|
||||
|
||||
private void spawnLightningArc(final World world, final double posX, final double posY, final double posZ,
|
||||
final Vec3d second) {
|
||||
final LightningFX fx = new LightningArcFX(world, posX, posY, posZ, second.x, second.y, second.z, 0.0f, 0.0f,
|
||||
@@ -220,7 +213,7 @@ public class ClientHelper extends ServerHelper {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActionKey(ActionKey key, InputMappings.Input pressedKey) {
|
||||
public boolean isActionKey(ActionKey key, InputUtil.Key pressedKey) {
|
||||
return this.bindings.get(key).isActiveAndMatches(pressedKey);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +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.client;
|
||||
|
||||
public enum EffectType {
|
||||
Energy, Lightning, Vibrant, LightningArc
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.util.Formatting;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -42,7 +43,7 @@ import net.minecraft.client.gui.widget.Widget;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -499,7 +500,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
return Preconditions.checkNotNull(getMinecraft().player);
|
||||
}
|
||||
|
||||
protected boolean checkHotbarKeys(final InputMappings.Input input) {
|
||||
protected boolean checkHotbarKeys(final InputUtil.Key input) {
|
||||
final Slot theSlot = this.getSlotUnderMouse();
|
||||
|
||||
if (getPlayer().inventory.getItemStack().isEmpty() && theSlot != null) {
|
||||
@@ -645,10 +646,10 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
RenderSystem.disableBlend();
|
||||
final Fluid fluid = fs.getFluid();
|
||||
FluidAttributes fluidAttributes = fluid.getAttributes();
|
||||
bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
|
||||
bindTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEX);
|
||||
Identifier fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack());
|
||||
final Sprite sprite = getMinecraft()
|
||||
.getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStillTexture);
|
||||
.getAtlasSpriteGetter(SpriteAtlasTexture.BLOCK_ATLAS_TEX).apply(fluidStillTexture);
|
||||
|
||||
// Set color for dynamic fluids
|
||||
// Convert int color to RGB
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.function.Consumer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -34,7 +34,7 @@ import appeng.tile.storage.ChestBlockEntity;
|
||||
final class AESubScreen {
|
||||
|
||||
private final AEBaseScreen<?> gui;
|
||||
private final ContainerType<?> previousContainerType;
|
||||
private final ScreenHandlerType<?> previousContainerType;
|
||||
private final ItemStack previousContainerIcon;
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.util.WeakHashMap;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
@@ -106,7 +107,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
final Object lineObj = this.lines.get(ex + x);
|
||||
if (lineObj instanceof ClientDCInternalInv) {
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
for (int z = 0; z < inv.getInventory().getSlots(); z++) {
|
||||
for (int z = 0; z < inv.getInventory().getSlotCount(); z++) {
|
||||
this.container.inventorySlots.add(new SlotDisconnected(inv, z, z * 18 + 8, 1 + offset));
|
||||
}
|
||||
} else if (lineObj instanceof String) {
|
||||
@@ -153,7 +154,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
|
||||
RenderSystem.color4f(1, 1, 1, 1);
|
||||
final int width = inv.getInventory().getSlots() * 18;
|
||||
final int width = inv.getInventory().getSlotCount() * 18;
|
||||
GuiUtils.drawTexturedModalRect(offsetX + 7, offsetY + offset, 7, 139, width, 18, getBlitOffset());
|
||||
}
|
||||
offset += 18;
|
||||
@@ -179,7 +180,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
|
||||
|
||||
InputMappings.Input input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
InputUtil.Key input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
|
||||
if (keyCode != GLFW.GLFW_KEY_ESCAPE) {
|
||||
if (AppEng.proxy.isActionKey(ActionKey.TOGGLE_FOCUS, input)) {
|
||||
@@ -211,7 +212,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
this.refreshList = true;
|
||||
}
|
||||
|
||||
for (final Object oKey : in.keySet()) {
|
||||
for (final Object oKey : in.getKeys()) {
|
||||
final String key = (String) oKey;
|
||||
if (key.startsWith("=")) {
|
||||
try {
|
||||
@@ -220,10 +221,10 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
Text un = Text.Serializer.fromJson(invData.getString("un"));
|
||||
final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un);
|
||||
|
||||
for (int x = 0; x < current.getInventory().getSlots(); x++) {
|
||||
for (int x = 0; x < current.getInventory().getSlotCount(); x++) {
|
||||
final String which = Integer.toString(x);
|
||||
if (invData.contains(which)) {
|
||||
current.getInventory().setStackInSlot(x, ItemStack.fromTag(invData.getCompound(which)));
|
||||
current.getInventory().setInvStack(x, ItemStack.fromTag(invData.getCompound(which)));
|
||||
}
|
||||
}
|
||||
} catch (final NumberFormatException ignored) {
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
@@ -383,7 +384,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
|
||||
|
||||
InputMappings.Input input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
InputUtil.Key input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
|
||||
if (keyCode != GLFW.GLFW_KEY_ESCAPE && !this.checkHotbarKeys(input)) {
|
||||
if (AppEng.proxy.isActionKey(ActionKey.TOGGLE_FOCUS, input)) {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
@@ -83,7 +84,7 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
|
||||
|
||||
InputMappings.Input input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
InputUtil.Key input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
|
||||
if (keyCode != GLFW.GLFW_KEY_ESCAPE && !this.checkHotbarKeys(input)) {
|
||||
if (AppEng.proxy.isActionKey(ActionKey.TOGGLE_FOCUS, input)) {
|
||||
|
||||
@@ -30,11 +30,11 @@ import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.math.AffineTransformation;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
@@ -99,9 +99,9 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel {
|
||||
fluidStack = new FluidVolume(Fluids.WATER, FluidAttributes.BUCKET_VOLUME);
|
||||
}
|
||||
|
||||
FluidAttributes attributes = fluidStack.getFluid().getAttributes();
|
||||
FluidAttributes attributes = fluidStack.getFluidKey().getAttributes();
|
||||
Identifier stillTexture = attributes.getStillTexture(fluidStack);
|
||||
Material stillMaterial = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, stillTexture);
|
||||
Material stillMaterial = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX, stillTexture);
|
||||
Sprite sprite = DummyFluidDispatcherBakedModel.this.bakedTextureGetter.apply(stillMaterial);
|
||||
if (sprite == null) {
|
||||
return new DummyFluidBakedModel(ImmutableList.of());
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.client.renderer.Quaternion;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.renderer.Vector4f;
|
||||
@@ -66,9 +66,9 @@ public enum FacingToRotation implements StringIdentifiable {
|
||||
this.rot = rot;
|
||||
this.mat = new Matrix4f();
|
||||
this.mat.setIdentity();
|
||||
this.mat.mul(xRot = Vector3f.XP.rotationDegrees(rot.getX()));
|
||||
this.mat.mul(yRot = Vector3f.YP.rotationDegrees(rot.getY()));
|
||||
this.mat.mul(zRot = Vector3f.ZP.rotationDegrees(rot.getZ()));
|
||||
this.mat.mul(xRot = Vector3f.POSITIVE_X.getDegreesQuaternion(rot.getX()));
|
||||
this.mat.mul(yRot = Vector3f.POSITIVE_Y.getDegreesQuaternion(rot.getY()));
|
||||
this.mat.mul(zRot = Vector3f.POSITIVE_Z.getDegreesQuaternion(rot.getZ()));
|
||||
}
|
||||
|
||||
public boolean isRedundant() {
|
||||
@@ -84,9 +84,9 @@ public enum FacingToRotation implements StringIdentifiable {
|
||||
}
|
||||
|
||||
public void push(MatrixStack mStack) {
|
||||
mStack.rotate(xRot);
|
||||
mStack.rotate(yRot);
|
||||
mStack.rotate(zRot);
|
||||
mStack.multiply(xRot);
|
||||
mStack.multiply(yRot);
|
||||
mStack.multiply(zRot);
|
||||
}
|
||||
|
||||
public Direction rotate(Direction facing) {
|
||||
|
||||
@@ -82,7 +82,7 @@ public class SpatialSkyRender implements SkyRenderHandler {
|
||||
// The skybox is pitch black and untextured
|
||||
for (Quaternion rotation : SKYBOX_SIDE_ROTATIONS) {
|
||||
matrixStack.push();
|
||||
matrixStack.rotate(rotation);
|
||||
matrixStack.multiply(rotation);
|
||||
|
||||
RenderSystem.disableTexture();
|
||||
VertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
|
||||
|
||||
@@ -47,25 +47,25 @@ public class TesrRenderHelper {
|
||||
public static void rotateToFace(MatrixStack mStack, Direction face, byte spin) {
|
||||
switch (face) {
|
||||
case UP:
|
||||
mStack.rotate(Vector3f.XP.rotationDegrees(270));
|
||||
mStack.rotate(Vector3f.ZP.rotationDegrees(-spin * 90.0F));
|
||||
mStack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(270));
|
||||
mStack.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(-spin * 90.0F));
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
mStack.rotate(Vector3f.XP.rotationDegrees(90.0F));
|
||||
mStack.rotate(Vector3f.ZP.rotationDegrees(spin * -90.0F));
|
||||
mStack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(90.0F));
|
||||
mStack.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(spin * -90.0F));
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
mStack.rotate(Vector3f.YP.rotationDegrees(90.0F));
|
||||
mStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90.0F));
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
mStack.rotate(Vector3f.YP.rotationDegrees(-90.0F));
|
||||
mStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-90.0F));
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
mStack.rotate(Vector3f.YP.rotationDegrees(180.0F));
|
||||
mStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(180.0F));
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Identifier;
|
||||
@@ -99,7 +99,7 @@ class CableBuilder {
|
||||
throw new IllegalStateException("Cable type " + cableType + " does not support connections.");
|
||||
}
|
||||
|
||||
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
return new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, textureFolder + color.name().toLowerCase()));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package appeng.client.render.cablebus;
|
||||
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.ParticleTextureSheet;
|
||||
import net.minecraft.client.particle.SpriteBillboardParticle;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.world.World;
|
||||
@@ -19,7 +19,7 @@ public class CableBusBreakingParticle extends SpriteBillboardParticle {
|
||||
double speedZ, Sprite sprite) {
|
||||
super(world, x, y, z, speedX, speedY, speedZ);
|
||||
this.setSprite(sprite);
|
||||
this.particleGravity = 1.0F;
|
||||
this.gravityStrength = 1.0F;
|
||||
this.particleScale /= 2.0F;
|
||||
this.field_217571_C = this.rand.nextFloat() * 3.0F;
|
||||
this.field_217572_F = this.rand.nextFloat() * 3.0F;
|
||||
@@ -30,8 +30,8 @@ public class CableBusBreakingParticle extends SpriteBillboardParticle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParticleRenderType getRenderType() {
|
||||
return IParticleRenderType.TERRAIN_SHEET;
|
||||
public ParticleTextureSheet getRenderType() {
|
||||
return ParticleTextureSheet.TERRAIN_SHEET;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Map;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import appeng.api.util.AECableType;
|
||||
@@ -73,7 +73,7 @@ public enum CableCoreType {
|
||||
}
|
||||
|
||||
public Material getTexture(AEColor color) {
|
||||
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
return new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, this.textureFolder + "/" + color.name().toLowerCase()));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.render.block.BlockRenderManager;
|
||||
import net.minecraft.client.renderer.RenderTypeLookup;
|
||||
import net.minecraft.client.color.block.BlockColors;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
@@ -191,7 +191,7 @@ public class FacadeBuilder {
|
||||
List<Box> holeStrips = getBoxes(facadeBox, cutOutBox, side.getAxis());
|
||||
ILightReader facadeAccess = new FacadeBlockAccess(parentWorld, pos, side, blockState);
|
||||
|
||||
BlockRendererDispatcher dispatcher = MinecraftClient.getInstance().getBlockRendererDispatcher();
|
||||
BlockRenderManager dispatcher = MinecraftClient.getInstance().getBlockRenderManager();
|
||||
BakedModel model = dispatcher.getModelForState(blockState);
|
||||
IModelData modelData = model.getModelData(facadeAccess, pos, blockState, EmptyModelData.INSTANCE);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelLoader;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
@@ -22,7 +22,7 @@ import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
import appeng.core.AppEng;
|
||||
|
||||
public class P2PTunnelFrequencyModel implements IModelGeometry<P2PTunnelFrequencyModel> {
|
||||
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "parts/p2p_tunnel_frequency"));
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.client.render.cablebus;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.Arrays;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SmartCableTextures {
|
||||
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_12"), //
|
||||
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_13"), //
|
||||
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_14")//
|
||||
}).map(e -> new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, e)).toArray(Material[]::new);
|
||||
}).map(e -> new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX, e)).toArray(Material[]::new);
|
||||
|
||||
// Textures used to display channels on smart cables. There's two sets of 5
|
||||
// textures each, and
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelLoader;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
@@ -121,7 +121,7 @@ class CraftingCubeModel implements IModelGeometry<CraftingCubeModel> {
|
||||
}
|
||||
|
||||
private static Material texture(String name) {
|
||||
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
return new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/crafting/" + name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
package appeng.client.render.model;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import net.minecraftforge.client.model.data.ModelProperty;
|
||||
|
||||
/**
|
||||
* This implementation of IModelData allows us to know precisely which data is
|
||||
* part of the model data. This is relevant for {@link AutoRotatingBakedModel}
|
||||
* and {@link AutoRotatingCacheKey}.
|
||||
*/
|
||||
public class AEModelData implements IModelData {
|
||||
|
||||
private final Direction up;
|
||||
private final Direction forward;
|
||||
|
||||
public AEModelData(Direction up, Direction forward) {
|
||||
this.up = Preconditions.checkNotNull(up);
|
||||
this.forward = Preconditions.checkNotNull(forward);
|
||||
}
|
||||
|
||||
public Direction getUp() {
|
||||
return up;
|
||||
}
|
||||
|
||||
public Direction getForward() {
|
||||
return forward;
|
||||
}
|
||||
|
||||
public boolean isCacheable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AEModelData that = (AEModelData) o;
|
||||
return up == that.up && forward == that.forward;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(up, forward);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasProperty(ModelProperty<?> prop) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T> T getData(ModelProperty<T> prop) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T> T setData(ModelProperty<T> prop, T data) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelLoader;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
@@ -30,7 +30,7 @@ import appeng.core.AppEng;
|
||||
public class BiometricCardModel implements IModelGeometry<BiometricCardModel> {
|
||||
|
||||
public static final Identifier MODEL_BASE = new Identifier(AppEng.MOD_ID, "item/biometric_card_base");
|
||||
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "item/biometric_card_hash"));
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelLoader;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
@@ -30,11 +30,11 @@ public class ColorApplicatorModel implements IModelGeometry<ColorApplicatorModel
|
||||
private static final Identifier MODEL_BASE = new Identifier(AppEng.MOD_ID,
|
||||
"item/color_applicator_colored");
|
||||
|
||||
private static final Material TEXTURE_DARK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_DARK = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "item/color_applicator_tip_dark"));
|
||||
private static final Material TEXTURE_MEDIUM = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_MEDIUM = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "item/color_applicator_tip_medium"));
|
||||
private static final Material TEXTURE_BRIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE_BRIGHT = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "item/color_applicator_tip_bright"));
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
@@ -64,13 +64,13 @@ class GlassBakedModel implements IDynamicBakedModel {
|
||||
private static final byte[][][] OFFSETS = generateOffsets();
|
||||
|
||||
// Alternating textures based on position
|
||||
static final Material TEXTURE_A = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
static final Material TEXTURE_A = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier("appliedenergistics2:block/glass/quartz_glass_a"));
|
||||
static final Material TEXTURE_B = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
static final Material TEXTURE_B = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier("appliedenergistics2:block/glass/quartz_glass_b"));
|
||||
static final Material TEXTURE_C = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
static final Material TEXTURE_C = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier("appliedenergistics2:block/glass/quartz_glass_c"));
|
||||
static final Material TEXTURE_D = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
static final Material TEXTURE_D = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier("appliedenergistics2:block/glass/quartz_glass_d"));
|
||||
|
||||
// Frame texture
|
||||
@@ -80,7 +80,7 @@ class GlassBakedModel implements IDynamicBakedModel {
|
||||
private static Material[] generateTexturesFrame() {
|
||||
return IntStream.range(1, 16).mapToObj(Integer::toBinaryString).map(s -> Strings.padStart(s, 4, '0'))
|
||||
.map(s -> new Identifier("appliedenergistics2:block/glass/quartz_glass_frame" + s))
|
||||
.map(rl -> new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, rl)).toArray(Material[]::new);
|
||||
.map(rl -> new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX, rl)).toArray(Material[]::new);
|
||||
}
|
||||
|
||||
private final Sprite[] glassTextures;
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.client.renderer.Vector4f;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelLoader;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
@@ -30,7 +30,7 @@ import appeng.core.AppEng;
|
||||
public class MemoryCardModel implements IModelGeometry<MemoryCardModel> {
|
||||
|
||||
public static final Identifier MODEL_BASE = new Identifier(AppEng.MOD_ID, "item/memory_card_base");
|
||||
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final Material TEXTURE = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "item/memory_card_hash"));
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.client.renderer.Quaternion;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelLoader;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
@@ -65,7 +65,7 @@ public class SpatialPylonModel implements IModelGeometry<SpatialPylonModel> {
|
||||
}
|
||||
|
||||
private static Material getTexturePath(SpatialPylonTextureType type) {
|
||||
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
return new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
|
||||
new Identifier(AppEng.MOD_ID, "block/spatial_pylon/" + type.name().toLowerCase()));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.Atlases;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.render.block.BlockRenderManager;
|
||||
import net.minecraft.client.renderer.Quaternion;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||
@@ -56,13 +56,13 @@ public class CrankTESR extends BlockEntityRenderer<CrankBlockEntity> {
|
||||
ms.push();
|
||||
ms.translate(0.5, 0.5, 0.5);
|
||||
FacingToRotation.get(te.getForward(), te.getUp()).push(ms);
|
||||
ms.rotate(new Quaternion(0, te.getVisibleRotation(), 0, true));
|
||||
ms.multiply(new Quaternion(0, te.getVisibleRotation(), 0, true));
|
||||
ms.translate(-0.5, -0.5, -0.5);
|
||||
|
||||
BlockState blockState = te.getCachedState();
|
||||
BlockRendererDispatcher dispatcher = MinecraftClient.getInstance().getBlockRendererDispatcher();
|
||||
BlockRenderManager dispatcher = MinecraftClient.getInstance().getBlockRenderManager();
|
||||
BakedModel model = dispatcher.getModelForState(blockState);
|
||||
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
|
||||
VertexConsumer buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
|
||||
dispatcher.getBlockModelRenderer().renderModelBrightnessColor(ms.getLast(), buffer, null, model, 1, 1, 1,
|
||||
combinedLightIn, combinedOverlayIn);
|
||||
ms.pop();
|
||||
|
||||
@@ -3,10 +3,10 @@ package appeng.client.render.tesr;
|
||||
import java.util.EnumMap;
|
||||
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.renderer.RenderState;
|
||||
@@ -84,7 +84,7 @@ public class DriveLedTileEntityRenderer extends BlockEntityRenderer<DriveBlockEn
|
||||
.getPrivateValue(RenderState.class, null, "field_228515_g_");
|
||||
RenderLayer rt = RenderLayer.makeType("ae_drive_leds", DefaultVertexFormats.POSITION_COLOR, 7, 32565, false, true,
|
||||
RenderLayer.State.getBuilder().transparency(TRANSLUCENT_TRANSPARENCY).build(false));
|
||||
IVertexBuilder buffer = buffers.getBuffer(STATE);
|
||||
VertexConsumer buffer = buffers.getBuffer(STATE);
|
||||
|
||||
for (int row = 0; row < 5; row++) {
|
||||
for (int col = 0; col < 2; col++) {
|
||||
|
||||
@@ -3,11 +3,11 @@ package appeng.client.render.tesr;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Quaternion;
|
||||
@@ -84,7 +84,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
|
||||
|
||||
final Sprite tas = TEXTURE_INSIDE.getSprite();
|
||||
|
||||
IVertexBuilder buffer = buffers.getBuffer(RenderLayer.getSolid());
|
||||
VertexConsumer buffer = buffers.getBuffer(RenderLayer.getSolid());
|
||||
|
||||
// Bottom of Top Stamp
|
||||
addVertex(buffer, ms, tas, TwoPx, middle + press, TwoPx, 2, 13, combinedOverlay, combinedLight, Direction.DOWN);
|
||||
@@ -171,7 +171,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
|
||||
ms.pop();
|
||||
}
|
||||
|
||||
private static void addVertex(IVertexBuilder vb, MatrixStack ms, Sprite sprite, float x, float y,
|
||||
private static void addVertex(VertexConsumer vb, MatrixStack ms, Sprite sprite, float x, float y,
|
||||
float z, double texU, double texV, int overlayUV, int lightmapUV, Direction front) {
|
||||
vb.pos(ms.getLast().getMatrix(), x, y, z);
|
||||
vb.color(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
@@ -190,7 +190,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
|
||||
ms.push();
|
||||
// move to center
|
||||
ms.translate(0.5f, 0.5f + o, 0.5f);
|
||||
ms.rotate(new Quaternion(90, 0, 0, true));
|
||||
ms.multiply(new Quaternion(90, 0, 0, true));
|
||||
// set scale
|
||||
ms.scale(ITEM_RENDER_SCALE, ITEM_RENDER_SCALE, ITEM_RENDER_SCALE);
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ package appeng.client.render.tesr;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.Atlases;
|
||||
@@ -73,23 +73,23 @@ public class SkyChestTESR extends BlockEntityRenderer<SkyChestBlockEntity> {
|
||||
matrixStackIn.push();
|
||||
float f = tileEntityIn.getForward().getHorizontalAngle();
|
||||
matrixStackIn.translate(0.5D, 0.5D, 0.5D);
|
||||
matrixStackIn.rotate(Vector3f.YP.rotationDegrees(-f));
|
||||
matrixStackIn.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-f));
|
||||
matrixStackIn.translate(-0.5D, -0.5D, -0.5D);
|
||||
|
||||
float f1 = tileEntityIn.getLidAngle(partialTicks);
|
||||
f1 = 1.0F - f1;
|
||||
f1 = 1.0F - f1 * f1 * f1;
|
||||
Material material = this.getMaterial(tileEntityIn);
|
||||
IVertexBuilder ivertexbuilder = material.getBuffer(bufferIn, RenderLayer::getEntityCutout);
|
||||
VertexConsumer ivertexbuilder = material.getBuffer(bufferIn, RenderLayer::getEntityCutout);
|
||||
this.renderModels(matrixStackIn, ivertexbuilder, this.singleLid, this.singleLatch, this.singleBottom, f1,
|
||||
combinedLightIn, combinedOverlayIn);
|
||||
|
||||
matrixStackIn.pop();
|
||||
}
|
||||
|
||||
private void renderModels(MatrixStack matrixStackIn, IVertexBuilder bufferIn, ModelRenderer chestLid,
|
||||
ModelRenderer chestLatch, ModelRenderer chestBottom, float lidAngle, int combinedLightIn,
|
||||
int combinedOverlayIn) {
|
||||
private void renderModels(MatrixStack matrixStackIn, VertexConsumer bufferIn, ModelRenderer chestLid,
|
||||
ModelRenderer chestLatch, ModelRenderer chestBottom, float lidAngle, int combinedLightIn,
|
||||
int combinedOverlayIn) {
|
||||
chestLid.rotateAngleX = -(lidAngle * 1.5707964F);
|
||||
chestLatch.rotateAngleX = chestLid.rotateAngleX;
|
||||
chestLid.render(matrixStackIn, bufferIn, combinedLightIn, combinedOverlayIn);
|
||||
|
||||
@@ -19,15 +19,15 @@
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.renderer.Atlases;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.render.block.BlockRenderManager;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.util.math.Direction;
|
||||
@@ -41,7 +41,7 @@ import appeng.tile.misc.SkyCompassBlockEntity;
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class SkyCompassTESR extends BlockEntityRenderer<SkyCompassBlockEntity> {
|
||||
|
||||
private static BlockRendererDispatcher blockRenderer;
|
||||
private static BlockRenderManager blockRenderer;
|
||||
|
||||
public SkyCompassTESR(BlockEntityRenderDispatcher rendererDispatcherIn) {
|
||||
super(rendererDispatcherIn);
|
||||
@@ -52,10 +52,10 @@ public class SkyCompassTESR extends BlockEntityRenderer<SkyCompassBlockEntity> {
|
||||
int combinedLightIn, int combinedOverlayIn) {
|
||||
|
||||
if (blockRenderer == null) {
|
||||
blockRenderer = MinecraftClient.getInstance().getBlockRendererDispatcher();
|
||||
blockRenderer = MinecraftClient.getInstance().getBlockRenderManager();
|
||||
}
|
||||
|
||||
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
|
||||
VertexConsumer buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
|
||||
|
||||
BlockState blockState = te.getCachedState();
|
||||
BakedModel model = blockRenderer.getBlockModelShapes().getModel(blockState);
|
||||
|
||||
@@ -28,10 +28,10 @@ import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -96,13 +96,13 @@ public abstract class AEBaseContainer extends Container {
|
||||
// Slots that were created to represent the player inventory
|
||||
private List<Slot> playerInventorySlots = null;
|
||||
|
||||
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final BlockEntity myTile,
|
||||
final IPart myPart) {
|
||||
public AEBaseContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip, final BlockEntity myTile,
|
||||
final IPart myPart) {
|
||||
this(containerType, id, ip, myTile, myPart, null);
|
||||
}
|
||||
|
||||
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final BlockEntity myTile,
|
||||
final IPart myPart, final IGuiItemObject gio) {
|
||||
public AEBaseContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip, final BlockEntity myTile,
|
||||
final IPart myPart, final IGuiItemObject gio) {
|
||||
super(containerType, id);
|
||||
this.invPlayer = ip;
|
||||
this.tileEntity = myTile;
|
||||
@@ -112,7 +112,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
this.prepareSync();
|
||||
}
|
||||
|
||||
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final Object anchor) {
|
||||
public AEBaseContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip, final Object anchor) {
|
||||
super(containerType, id);
|
||||
this.invPlayer = ip;
|
||||
this.tileEntity = anchor instanceof BlockEntity ? (BlockEntity) anchor : null;
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.core.AELog;
|
||||
|
||||
@@ -16,13 +16,13 @@ public final class ContainerOpener {
|
||||
private ContainerOpener() {
|
||||
}
|
||||
|
||||
private static final Map<ContainerType<? extends AEBaseContainer>, Opener<?>> registry = new HashMap<>();
|
||||
private static final Map<ScreenHandlerType<? extends AEBaseContainer>, Opener<?>> registry = new HashMap<>();
|
||||
|
||||
public static <T extends AEBaseContainer> void addOpener(ContainerType<T> type, Opener<T> opener) {
|
||||
public static <T extends AEBaseContainer> void addOpener(ScreenHandlerType<T> type, Opener<T> opener) {
|
||||
registry.put(type, opener);
|
||||
}
|
||||
|
||||
public static boolean openContainer(ContainerType<?> type, PlayerEntity player, ContainerLocator locator) {
|
||||
public static boolean openContainer(ScreenHandlerType<?> type, PlayerEntity player, ContainerLocator locator) {
|
||||
Opener<?> opener = registry.get(type);
|
||||
if (opener == null) {
|
||||
AELog.warn("Trying to open container for unknown container type {}", type);
|
||||
|
||||
@@ -23,8 +23,8 @@ import java.util.Iterator;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -56,7 +56,7 @@ import appeng.util.iterators.NullIterator;
|
||||
|
||||
public class CellWorkbenchContainer extends UpgradeableContainer {
|
||||
|
||||
public static ContainerType<CellWorkbenchContainer> TYPE;
|
||||
public static ScreenHandlerType<CellWorkbenchContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<CellWorkbenchContainer, CellWorkbenchBlockEntity> helper = new ContainerHelper<>(
|
||||
CellWorkbenchContainer::new, CellWorkbenchBlockEntity.class);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -31,7 +31,7 @@ import appeng.tile.storage.ChestBlockEntity;
|
||||
|
||||
public class ChestContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<ChestContainer> TYPE;
|
||||
public static ScreenHandlerType<ChestContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<ChestContainer, ChestBlockEntity> helper = new ContainerHelper<>(
|
||||
ChestContainer::new, ChestBlockEntity.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
@@ -37,7 +37,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class CondenserContainer extends AEBaseContainer implements IProgressProvider {
|
||||
|
||||
public static ContainerType<CondenserContainer> TYPE;
|
||||
public static ScreenHandlerType<CondenserContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<CondenserContainer, CondenserBlockEntity> helper = new ContainerHelper<>(
|
||||
CondenserContainer::new, CondenserBlockEntity.class);
|
||||
|
||||
@@ -22,7 +22,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.world.World;
|
||||
@@ -41,7 +41,7 @@ import appeng.tile.inventory.AppEngInternalInventory;
|
||||
|
||||
public class CraftAmountContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<CraftAmountContainer> TYPE;
|
||||
public static ScreenHandlerType<CraftAmountContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<CraftAmountContainer, ITerminalHost> helper = new ContainerHelper<>(
|
||||
CraftAmountContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
|
||||
|
||||
@@ -29,8 +29,8 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.Text;
|
||||
@@ -69,7 +69,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class CraftConfirmContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<CraftConfirmContainer> TYPE;
|
||||
public static ScreenHandlerType<CraftConfirmContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<CraftConfirmContainer, ITerminalHost> helper = new ContainerHelper<>(
|
||||
CraftConfirmContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
|
||||
@@ -293,7 +293,7 @@ public class CraftConfirmContainer extends AEBaseContainer {
|
||||
}
|
||||
|
||||
public void startJob() {
|
||||
ContainerType<?> originalGui = null;
|
||||
ScreenHandlerType<?> originalGui = null;
|
||||
|
||||
final IActionHost ah = this.getActionHost();
|
||||
if (ah instanceof WirelessTerminalGuiObject) {
|
||||
|
||||
@@ -22,8 +22,8 @@ import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.Text;
|
||||
@@ -55,7 +55,7 @@ import appeng.util.Platform;
|
||||
public class CraftingCPUContainer extends AEBaseContainer
|
||||
implements IMEMonitorHandlerReceiver<IAEItemStack>, ICustomNameObject {
|
||||
|
||||
public static ContainerType<CraftingCPUContainer> TYPE;
|
||||
public static ScreenHandlerType<CraftingCPUContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<CraftingCPUContainer, CraftingBlockEntity> helper = new ContainerHelper<>(
|
||||
CraftingCPUContainer::new, CraftingBlockEntity.class, SecurityPermissions.CRAFT);
|
||||
@@ -73,7 +73,7 @@ public class CraftingCPUContainer extends AEBaseContainer
|
||||
this(TYPE, id, ip, te);
|
||||
}
|
||||
|
||||
public CraftingCPUContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final Object te) {
|
||||
public CraftingCPUContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip, final Object te) {
|
||||
super(containerType, id, ip, te);
|
||||
final IActionHost host = (IActionHost) (te instanceof IActionHost ? te : null);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
@@ -40,7 +40,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class CraftingStatusContainer extends CraftingCPUContainer {
|
||||
|
||||
public static ContainerType<CraftingStatusContainer> TYPE;
|
||||
public static ScreenHandlerType<CraftingStatusContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<CraftingStatusContainer, ITerminalHost> helper = new ContainerHelper<>(
|
||||
CraftingStatusContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
@@ -47,7 +47,7 @@ import appeng.util.inv.WrapperInvItemHandler;
|
||||
public class CraftingTermContainer extends MEMonitorableContainer
|
||||
implements IAEAppEngInventory, IContainerCraftingPacket {
|
||||
|
||||
public static ContainerType<CraftingTermContainer> TYPE;
|
||||
public static ScreenHandlerType<CraftingTermContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<CraftingTermContainer, ITerminalHost> helper = new ContainerHelper<>(
|
||||
CraftingTermContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -30,7 +30,7 @@ import appeng.tile.storage.DriveBlockEntity;
|
||||
|
||||
public class DriveContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<DriveContainer> TYPE;
|
||||
public static ScreenHandlerType<DriveContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<DriveContainer, DriveBlockEntity> helper = new ContainerHelper<>(
|
||||
DriveContainer::new, DriveBlockEntity.class);
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.container.implementations;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -39,7 +39,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class FormationPlaneContainer extends UpgradeableContainer {
|
||||
|
||||
public static ContainerType<FormationPlaneContainer> TYPE;
|
||||
public static ScreenHandlerType<FormationPlaneContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<FormationPlaneContainer, FormationPlanePart> helper = new ContainerHelper<>(
|
||||
FormationPlaneContainer::new, FormationPlanePart.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
@@ -33,7 +33,7 @@ import appeng.tile.grindstone.GrinderBlockEntity;
|
||||
|
||||
public class GrinderContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<GrinderContainer> TYPE;
|
||||
public static ScreenHandlerType<GrinderContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<GrinderContainer, GrinderBlockEntity> helper = new ContainerHelper<>(
|
||||
GrinderContainer::new, GrinderBlockEntity.class);
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.container.implementations;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.FullnessMode;
|
||||
@@ -38,7 +38,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class IOPortContainer extends UpgradeableContainer {
|
||||
|
||||
public static ContainerType<IOPortContainer> TYPE;
|
||||
public static ScreenHandlerType<IOPortContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<IOPortContainer, IOPortBlockEntity> helper = new ContainerHelper<>(
|
||||
IOPortContainer::new, IOPortBlockEntity.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
@@ -45,7 +45,7 @@ import appeng.util.Platform;
|
||||
*/
|
||||
public class InscriberContainer extends UpgradeableContainer implements IProgressProvider {
|
||||
|
||||
public static ContainerType<InscriberContainer> TYPE;
|
||||
public static ScreenHandlerType<InscriberContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<InscriberContainer, InscriberBlockEntity> helper = new ContainerHelper<>(
|
||||
InscriberContainer::new, InscriberBlockEntity.class);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -37,7 +37,7 @@ import appeng.helpers.IInterfaceHost;
|
||||
|
||||
public class InterfaceContainer extends UpgradeableContainer {
|
||||
|
||||
public static ContainerType<InterfaceContainer> TYPE;
|
||||
public static ScreenHandlerType<InterfaceContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<InterfaceContainer, IInterfaceHost> helper = new ContainerHelper<>(
|
||||
InterfaceContainer::new, IInterfaceHost.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -25,8 +25,8 @@ import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
@@ -61,7 +61,7 @@ import appeng.util.inv.filter.IAEItemFilter;
|
||||
|
||||
public final class InterfaceTerminalContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<InterfaceTerminalContainer> TYPE;
|
||||
public static ScreenHandlerType<InterfaceTerminalContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<InterfaceTerminalContainer, InterfaceTerminalPart> helper = new ContainerHelper<>(
|
||||
InterfaceTerminalContainer::new, InterfaceTerminalPart.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -42,7 +42,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class LevelEmitterContainer extends UpgradeableContainer {
|
||||
|
||||
public static ContainerType<LevelEmitterContainer> TYPE;
|
||||
public static ScreenHandlerType<LevelEmitterContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<LevelEmitterContainer, LevelEmitterPart> helper = new ContainerHelper<>(
|
||||
LevelEmitterContainer::new, LevelEmitterPart.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -25,8 +25,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
@@ -78,7 +78,7 @@ import appeng.util.Platform;
|
||||
public class MEMonitorableContainer extends AEBaseContainer
|
||||
implements IConfigManagerHost, IConfigurableObject, IMEMonitorHandlerReceiver<IAEItemStack> {
|
||||
|
||||
public static ContainerType<MEMonitorableContainer> TYPE;
|
||||
public static ScreenHandlerType<MEMonitorableContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<MEMonitorableContainer, ITerminalHost> helper = new ContainerHelper<>(
|
||||
MEMonitorableContainer::new, ITerminalHost.class);
|
||||
@@ -109,8 +109,8 @@ public class MEMonitorableContainer extends AEBaseContainer
|
||||
this(TYPE, id, ip, monitorable, true);
|
||||
}
|
||||
|
||||
public MEMonitorableContainer(ContainerType<?> containerType, int id, PlayerInventory ip,
|
||||
final ITerminalHost monitorable, final boolean bindInventory) {
|
||||
public MEMonitorableContainer(ScreenHandlerType<?> containerType, int id, PlayerInventory ip,
|
||||
final ITerminalHost monitorable, final boolean bindInventory) {
|
||||
super(containerType, id, ip, monitorable instanceof BlockEntity ? (BlockEntity) monitorable : null,
|
||||
monitorable instanceof IPart ? (IPart) monitorable : null,
|
||||
monitorable instanceof IGuiItemObject ? (IGuiItemObject) monitorable : null);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
@@ -32,7 +32,7 @@ import appeng.container.interfaces.IInventorySlotAware;
|
||||
|
||||
public class MEPortableCellContainer extends MEMonitorableContainer {
|
||||
|
||||
public static ContainerType<MEPortableCellContainer> TYPE;
|
||||
public static ScreenHandlerType<MEPortableCellContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<MEPortableCellContainer, IPortableCell> helper = new ContainerHelper<>(
|
||||
MEPortableCellContainer::new, IPortableCell.class);
|
||||
@@ -55,8 +55,8 @@ public class MEPortableCellContainer extends MEMonitorableContainer {
|
||||
this(TYPE, id, ip, monitorable);
|
||||
}
|
||||
|
||||
protected MEPortableCellContainer(ContainerType<? extends MEPortableCellContainer> type, int id,
|
||||
final PlayerInventory ip, final IPortableCell monitorable) {
|
||||
protected MEPortableCellContainer(ScreenHandlerType<? extends MEPortableCellContainer> type, int id,
|
||||
final PlayerInventory ip, final IPortableCell monitorable) {
|
||||
super(type, id, ip, monitorable, false);
|
||||
if (monitorable instanceof IInventorySlotAware) {
|
||||
final int slotIndex = ((IInventorySlotAware) monitorable).getInventorySlot();
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.container.implementations;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
@@ -44,7 +44,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class MolecularAssemblerContainer extends UpgradeableContainer implements IProgressProvider {
|
||||
|
||||
public static ContainerType<MolecularAssemblerContainer> TYPE;
|
||||
public static ScreenHandlerType<MolecularAssemblerContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<MolecularAssemblerContainer, MolecularAssemblerBlockEntity> helper = new ContainerHelper<>(
|
||||
MolecularAssemblerContainer::new, MolecularAssemblerBlockEntity.class);
|
||||
|
||||
@@ -22,8 +22,8 @@ import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
@@ -48,7 +48,7 @@ import appeng.util.item.AEItemStack;
|
||||
|
||||
public class NetworkStatusContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<NetworkStatusContainer> TYPE;
|
||||
public static ScreenHandlerType<NetworkStatusContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<NetworkStatusContainer, INetworkTool> helper = new ContainerHelper<>(
|
||||
NetworkStatusContainer::new, INetworkTool.class);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
@@ -33,7 +33,7 @@ import appeng.container.slot.RestrictedInputSlot;
|
||||
|
||||
public class NetworkToolContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<NetworkToolContainer> TYPE;
|
||||
public static ScreenHandlerType<NetworkToolContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<NetworkToolContainer, INetworkTool> helper = new ContainerHelper<>(
|
||||
NetworkToolContainer::new, INetworkTool.class);
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.CraftResultInventory;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.inventory.container.CraftingResultSlot;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
@@ -77,7 +77,7 @@ import appeng.util.item.AEItemStack;
|
||||
public class PatternTermContainer extends MEMonitorableContainer
|
||||
implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket {
|
||||
|
||||
public static ContainerType<PatternTermContainer> TYPE;
|
||||
public static ScreenHandlerType<PatternTermContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<PatternTermContainer, ITerminalHost> helper = new ContainerHelper<>(
|
||||
PatternTermContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
|
||||
@@ -184,7 +184,7 @@ public class PatternTermContainer extends MEMonitorableContainer
|
||||
is = this.currentRecipe.craft(ic);
|
||||
}
|
||||
|
||||
this.cOut.setStackInSlot(0, is);
|
||||
this.cOut.setInvStack(0, is);
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
@@ -37,7 +37,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class PriorityContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<PriorityContainer> TYPE;
|
||||
public static ScreenHandlerType<PriorityContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<PriorityContainer, IPriorityHost> helper = new ContainerHelper<>(
|
||||
PriorityContainer::new, IPriorityHost.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -31,7 +31,7 @@ import appeng.tile.qnb.QuantumBridgeBlockEntity;
|
||||
|
||||
public class QNBContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<QNBContainer> TYPE;
|
||||
public static ScreenHandlerType<QNBContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<QNBContainer, QuantumBridgeBlockEntity> helper = new ContainerHelper<>(
|
||||
QNBContainer::new, QuantumBridgeBlockEntity.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -23,7 +23,7 @@ import javax.annotation.Nonnull;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
@@ -42,7 +42,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class QuartzKnifeContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<QuartzKnifeContainer> TYPE;
|
||||
public static ScreenHandlerType<QuartzKnifeContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<QuartzKnifeContainer, QuartzKnifeObj> helper = new ContainerHelper<>(
|
||||
QuartzKnifeContainer::new, QuartzKnifeObj.class);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
@@ -43,7 +43,7 @@ import appeng.util.inv.InvOperation;
|
||||
|
||||
public class SecurityStationContainer extends MEMonitorableContainer implements IAEAppEngInventory {
|
||||
|
||||
public static ContainerType<SecurityStationContainer> TYPE;
|
||||
public static ScreenHandlerType<SecurityStationContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<SecurityStationContainer, ITerminalHost> helper = new ContainerHelper<>(
|
||||
SecurityStationContainer::new, ITerminalHost.class, SecurityPermissions.SECURITY);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -30,7 +30,7 @@ import appeng.tile.storage.SkyChestBlockEntity;
|
||||
|
||||
public class SkyChestContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<SkyChestContainer> TYPE;
|
||||
public static ScreenHandlerType<SkyChestContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<SkyChestContainer, SkyChestBlockEntity> helper = new ContainerHelper<>(
|
||||
SkyChestContainer::new, SkyChestBlockEntity.class);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -39,7 +39,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class SpatialIOPortContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<SpatialIOPortContainer> TYPE;
|
||||
public static ScreenHandlerType<SpatialIOPortContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<SpatialIOPortContainer, SpatialIOPortBlockEntity> helper = new ContainerHelper<>(
|
||||
SpatialIOPortContainer::new, SpatialIOPortBlockEntity.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Iterator;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
@@ -50,7 +50,7 @@ import appeng.util.iterators.NullIterator;
|
||||
|
||||
public class StorageBusContainer extends UpgradeableContainer {
|
||||
|
||||
public static ContainerType<StorageBusContainer> TYPE;
|
||||
public static ScreenHandlerType<StorageBusContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<StorageBusContainer, StorageBusPart> helper = new ContainerHelper<>(
|
||||
StorageBusContainer::new, StorageBusPart.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -55,7 +55,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class UpgradeableContainer extends AEBaseContainer implements IOptionalSlotHost {
|
||||
|
||||
public static ContainerType<UpgradeableContainer> TYPE;
|
||||
public static ScreenHandlerType<UpgradeableContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<UpgradeableContainer, IUpgradeableHost> helper = new ContainerHelper<>(
|
||||
UpgradeableContainer::new, IUpgradeableHost.class, SecurityPermissions.BUILD);
|
||||
@@ -84,8 +84,8 @@ public class UpgradeableContainer extends AEBaseContainer implements IOptionalSl
|
||||
this(TYPE, id, ip, te);
|
||||
}
|
||||
|
||||
public UpgradeableContainer(ContainerType<?> containerType, int id, final PlayerInventory ip,
|
||||
final IUpgradeableHost te) {
|
||||
public UpgradeableContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip,
|
||||
final IUpgradeableHost te) {
|
||||
super(containerType, id, ip, (BlockEntity) (te instanceof BlockEntity ? te : null),
|
||||
(IPart) (te instanceof IPart ? te : null));
|
||||
this.upgradeable = te;
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -33,7 +33,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class VibrationChamberContainer extends AEBaseContainer implements IProgressProvider {
|
||||
|
||||
public static ContainerType<VibrationChamberContainer> TYPE;
|
||||
public static ScreenHandlerType<VibrationChamberContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<VibrationChamberContainer, VibrationChamberBlockEntity> helper = new ContainerHelper<>(
|
||||
VibrationChamberContainer::new, VibrationChamberBlockEntity.class);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -33,7 +33,7 @@ import appeng.tile.networking.WirelessBlockEntity;
|
||||
|
||||
public class WirelessContainer extends AEBaseContainer {
|
||||
|
||||
public static ContainerType<WirelessContainer> TYPE;
|
||||
public static ScreenHandlerType<WirelessContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<WirelessContainer, WirelessBlockEntity> helper = new ContainerHelper<>(
|
||||
WirelessContainer::new, WirelessBlockEntity.class, SecurityPermissions.BUILD);
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
@@ -31,7 +31,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class WirelessTermContainer extends MEPortableCellContainer {
|
||||
|
||||
public static ContainerType<WirelessTermContainer> TYPE;
|
||||
public static ScreenHandlerType<WirelessTermContainer> TYPE;
|
||||
|
||||
private static final ContainerHelper<WirelessTermContainer, WirelessTerminalGuiObject> helper = new ContainerHelper<>(
|
||||
WirelessTermContainer::new, WirelessTerminalGuiObject.class);
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.hooks.BasicEventHooks;
|
||||
|
||||
@@ -96,7 +96,7 @@ public class AppEngCraftingSlot extends AppEngSlot {
|
||||
ic.setStack(x, this.craftMatrix.getInvStack(x));
|
||||
}
|
||||
|
||||
final NonNullList<ItemStack> aitemstack = this.getRemainingItems(ic, playerIn.world);
|
||||
final DefaultedList<ItemStack> aitemstack = this.getRemainingItems(ic, playerIn.world);
|
||||
|
||||
ItemHandlerUtil.copy(ic, this.craftMatrix, false);
|
||||
|
||||
@@ -137,9 +137,9 @@ public class AppEngCraftingSlot extends AppEngSlot {
|
||||
|
||||
// TODO: This is really hacky and NEEDS to be solved with a full container/gui
|
||||
// refactoring.
|
||||
protected NonNullList<ItemStack> getRemainingItems(CraftingInventory ic, World world) {
|
||||
protected DefaultedList<ItemStack> getRemainingItems(CraftingInventory ic, World world) {
|
||||
return world.getRecipeManager().getRecipe(RecipeType.CRAFTING, ic, world)
|
||||
.map(iCraftingRecipe -> iCraftingRecipe.getRemainingItems(ic))
|
||||
.orElse(NonNullList.withSize(9, ItemStack.EMPTY));
|
||||
.orElse(DefaultedList.withSize(9, ItemStack.EMPTY));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -139,7 +139,7 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
|
||||
final List<ItemStack> drops = new ArrayList<>();
|
||||
drops.add(extra);
|
||||
Platform.spawnDrops(who.world,
|
||||
new BlockPos((int) who.getX(), (int) who.getY(), (int) who.getPosZ()), drops);
|
||||
new BlockPos((int) who.getX(), (int) who.getY(), (int) who.getZ()), drops);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
|
||||
// TODO: This is really hacky and NEEDS to be solved with a full container/gui
|
||||
// refactoring.
|
||||
@Override
|
||||
protected NonNullList<ItemStack> getRemainingItems(CraftingInventory ic, World world) {
|
||||
protected DefaultedList<ItemStack> getRemainingItems(CraftingInventory ic, World world) {
|
||||
if (this.container instanceof CraftingTermContainer) {
|
||||
final CraftingTermContainer containerTerminal = (CraftingTermContainer) this.container;
|
||||
final Recipe<CraftingInventory> recipe = containerTerminal.getCurrentRecipe();
|
||||
@@ -282,7 +282,7 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
|
||||
}
|
||||
|
||||
if (drops.size() > 0) {
|
||||
Platform.spawnDrops(p.world, new BlockPos((int) p.getX(), (int) p.getY(), (int) p.getPosZ()), drops);
|
||||
Platform.spawnDrops(p.world, new BlockPos((int) p.getX(), (int) p.getY(), (int) p.getZ()), drops);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package appeng.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
|
||||
public class AEItemGroup extends ItemGroup {
|
||||
|
||||
private final List<IItemDefinition> itemDefs = new ArrayList<>();
|
||||
|
||||
public AEItemGroup(String label) {
|
||||
super(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack createIcon() {
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
final IBlocks blocks = definitions.blocks();
|
||||
return blocks.controller().stack(1);
|
||||
}
|
||||
|
||||
public void add(IItemDefinition itemDef) {
|
||||
this.itemDefs.add(itemDef);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fill(NonNullList<ItemStack> items) {
|
||||
for (IItemDefinition itemDef : this.itemDefs) {
|
||||
itemDef.item().fillItemGroup(this, items);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import java.util.Random;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
@@ -42,10 +43,10 @@ public abstract class CommonHelper {
|
||||
public abstract List<? extends PlayerEntity> getPlayers();
|
||||
|
||||
public abstract void sendToAllNearExcept(PlayerEntity p, double x, double y, double z, double dist, World w,
|
||||
BasePacket packet);
|
||||
BasePacket packet);
|
||||
|
||||
public abstract void spawnEffect(EffectType effect, World world, double posX, double posY, double posZ,
|
||||
Object extra);
|
||||
Object extra);
|
||||
|
||||
public abstract boolean shouldAddParticles(Random r);
|
||||
|
||||
@@ -59,6 +60,6 @@ public abstract class CommonHelper {
|
||||
|
||||
public abstract void updateRenderMode(PlayerEntity player);
|
||||
|
||||
public abstract boolean isActionKey(@Nonnull final ActionKey key, InputMappings.Input input);
|
||||
public abstract boolean isActionKey(@Nonnull final ActionKey key, InputUtil.Key input);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,29 +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.core;
|
||||
|
||||
public final class CreativeTab {
|
||||
|
||||
public static AEItemGroup INSTANCE;
|
||||
|
||||
public static void init() {
|
||||
INSTANCE = new AEItemGroup("appliedenergistics2");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import appeng.items.parts.FacadeItem;
|
||||
@@ -53,7 +53,7 @@ public final class FacadeItemGroup extends ItemGroup {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fill(NonNullList<ItemStack> items) {
|
||||
public void fill(DefaultedList<ItemStack> items) {
|
||||
this.calculateSubTypes();
|
||||
items.addAll(subTypes);
|
||||
}
|
||||
@@ -73,8 +73,8 @@ public final class FacadeItemGroup extends ItemGroup {
|
||||
|
||||
Item blockItem = b.asItem();
|
||||
if (blockItem != Items.AIR && blockItem.getGroup() != null) {
|
||||
final NonNullList<ItemStack> tmpList = NonNullList.create();
|
||||
b.fillItemGroup(blockItem.getGroup(), tmpList);
|
||||
final DefaultedList<ItemStack> tmpList = DefaultedList.create();
|
||||
b.appendStacks(blockItem.getGroup(), tmpList);
|
||||
for (final ItemStack l : tmpList) {
|
||||
final ItemStack facade = itemFacade.createFacadeForItem(l, false);
|
||||
if (!facade.isEmpty()) {
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.ScreenManager;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.particle.ParticleType;
|
||||
import net.minecraft.recipe.RecipeSerializer;
|
||||
import net.minecraft.util.Identifier;
|
||||
@@ -174,8 +174,8 @@ final class Registration {
|
||||
.forEachRemaining(b -> b.register(registry));
|
||||
}
|
||||
|
||||
public void registerContainerTypes(RegistryEvent.Register<ContainerType<?>> event) {
|
||||
final IForgeRegistry<ContainerType<?>> registry = event.getRegistry();
|
||||
public void registerContainerTypes(RegistryEvent.Register<ScreenHandlerType<?>> event) {
|
||||
final IForgeRegistry<ScreenHandlerType<?>> registry = event.getRegistry();
|
||||
|
||||
CellWorkbenchContainer.TYPE = registerContainer(registry, "cellworkbench", CellWorkbenchContainer::fromNetwork,
|
||||
CellWorkbenchContainer::open);
|
||||
@@ -300,9 +300,9 @@ final class Registration {
|
||||
});
|
||||
}
|
||||
|
||||
private <T extends AEBaseContainer> ContainerType<T> registerContainer(IForgeRegistry<ContainerType<?>> registry,
|
||||
String id, IContainerFactory<T> factory, ContainerOpener.Opener<T> opener) {
|
||||
ContainerType<T> type = IForgeContainerType.create(factory);
|
||||
private <T extends AEBaseContainer> ScreenHandlerType<T> registerContainer(IForgeRegistry<ScreenHandlerType<?>> registry,
|
||||
String id, IContainerFactory<T> factory, ContainerOpener.Opener<T> opener) {
|
||||
ScreenHandlerType<T> type = IForgeContainerType.create(factory);
|
||||
type.setRegistryName(AppEng.MOD_ID, id);
|
||||
registry.register(type);
|
||||
ContainerOpener.addOpener(type, opener);
|
||||
|
||||
@@ -376,7 +376,7 @@ public final class ApiBlocks implements IBlocks {
|
||||
|
||||
TinyTNTPrimedEntity.TYPE = registry
|
||||
.<TinyTNTPrimedEntity>entity("tiny_tnt_primed", TinyTNTPrimedEntity::new, SpawnGroup.MISC)
|
||||
.customize(p -> p.setTrackingRange(16).setUpdateInterval(4).setShouldReceiveVelocityUpdates(true))
|
||||
.customize(p -> p.trackable(16, 4, true))
|
||||
.build();
|
||||
|
||||
this.tinyTNT = registry
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.core.api.definitions;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.entity.EntityDimensions;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
@@ -27,7 +28,6 @@ import appeng.api.definitions.IMaterials;
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.bootstrap.FeatureFactory;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.MaterialStackSrc;
|
||||
import appeng.entity.ChargedQuartzEntity;
|
||||
import appeng.entity.SingularityEntity;
|
||||
import appeng.items.materials.MaterialItem;
|
||||
@@ -120,14 +120,12 @@ public final class ApiMaterials implements IMaterials {
|
||||
|
||||
SingularityEntity.TYPE = registry
|
||||
.<SingularityEntity>entity("singularity", SingularityEntity::new, SpawnGroup.MISC)
|
||||
.customize(builder -> builder.size(0.2f, 0.2f).setTrackingRange(16).setUpdateInterval(4)
|
||||
.setShouldReceiveVelocityUpdates(true))
|
||||
.customize(b -> b.trackable(16, 4, true).dimensions(EntityDimensions.fixed(0.2f, 0.2f)))
|
||||
.build();
|
||||
|
||||
ChargedQuartzEntity.TYPE = registry
|
||||
.<ChargedQuartzEntity>entity("charged_quartz", ChargedQuartzEntity::new, SpawnGroup.MISC)
|
||||
.customize(builder -> builder.size(0.2f, 0.2f).setTrackingRange(16).setUpdateInterval(4)
|
||||
.setShouldReceiveVelocityUpdates(true))
|
||||
.customize(b -> b.trackable(16, 4, true).dimensions(EntityDimensions.fixed(0.2f, 0.2f)))
|
||||
.build();
|
||||
|
||||
this.cell2SpatialPart = createMaterial(MaterialType.SPATIAL_2_CELL_COMPONENT);
|
||||
@@ -201,7 +199,6 @@ public final class ApiMaterials implements IMaterials {
|
||||
enabled = enabled && AEConfig.instance().isFeatureEnabled(f);
|
||||
}
|
||||
|
||||
mat.setStackSrc(new MaterialStackSrc(mat, enabled));
|
||||
mat.setItemInstance(def.item());
|
||||
mat.markReady();
|
||||
return def;
|
||||
|
||||
@@ -1,69 +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.core.sync;
|
||||
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraftforge.fml.network.NetworkDirection;
|
||||
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
|
||||
public abstract class BasePacket {
|
||||
private PacketByteBuf p;
|
||||
|
||||
public void serverPacketData(final INetworkInfo manager, final PlayerEntity player) {
|
||||
throw new UnsupportedOperationException(
|
||||
"This packet ( " + this.getPacketID() + " does not implement a server side handler.");
|
||||
}
|
||||
|
||||
public final int getPacketID() {
|
||||
return BasePacketHandler.PacketTypes.getID(this.getClass()).ordinal();
|
||||
}
|
||||
|
||||
public void clientPacketData(final INetworkInfo network, final PlayerEntity player) {
|
||||
throw new UnsupportedOperationException(
|
||||
"This packet ( " + this.getPacketID() + " does not implement a client side handler.");
|
||||
}
|
||||
|
||||
protected void configureWrite(final PacketByteBuf data) {
|
||||
data.capacity(data.readableBytes());
|
||||
this.p = data;
|
||||
}
|
||||
|
||||
public IPacket<?> toPacket(NetworkDirection direction) {
|
||||
if (this.p.array().length > 2 * 1024 * 1024) // 2k walking room :)
|
||||
{
|
||||
throw new IllegalArgumentException(
|
||||
"Sorry AE2 made a " + this.p.array().length + " byte packet by accident!");
|
||||
}
|
||||
|
||||
if (AEConfig.instance().isFeatureEnabled(AEFeature.PACKET_LOGGING)) {
|
||||
AELog.info(this.getClass().getName() + " : " + p.readableBytes());
|
||||
}
|
||||
|
||||
return direction.buildPacket(Pair.of(p, 0), NetworkHandler.instance().getChannel()).getThis();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +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.core.sync.network;
|
||||
|
||||
public interface INetworkInfo {
|
||||
|
||||
}
|
||||
@@ -19,9 +19,10 @@
|
||||
package appeng.core.sync.network;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.network.NetworkSide;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.network.INetHandler;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.ThreadQuickExitException;
|
||||
import net.minecraft.network.play.ServerPlayNetHandler;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -31,7 +32,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import net.minecraftforge.fml.LogicalSidedProvider;
|
||||
import net.minecraftforge.fml.network.NetworkDirection;
|
||||
import net.minecraftforge.fml.network.NetworkEvent;
|
||||
import net.minecraftforge.fml.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.network.event.EventNetworkChannel;
|
||||
@@ -110,26 +110,26 @@ public class NetworkHandler {
|
||||
}
|
||||
|
||||
public void sendToAll(final BasePacket message) {
|
||||
getServer().getPlayerList().sendPacketToAllPlayers(message.toPacket(NetworkDirection.PLAY_TO_CLIENT));
|
||||
getServer().getPlayerList().sendPacketToAllPlayers(message.toPacket(NetworkSide.PLAY_TO_CLIENT));
|
||||
}
|
||||
|
||||
public void sendTo(final BasePacket message, final ServerPlayerEntity player) {
|
||||
player.connection.sendPacket(message.toPacket(NetworkDirection.PLAY_TO_CLIENT));
|
||||
player.connection.sendPacket(message.toPacket(NetworkSide.PLAY_TO_CLIENT));
|
||||
}
|
||||
|
||||
public void sendToAllAround(final BasePacket message, final TargetPoint point) {
|
||||
IPacket<?> pkt = message.toPacket(NetworkDirection.PLAY_TO_CLIENT);
|
||||
Packet<?> pkt = message.toPacket(NetworkSide.PLAY_TO_CLIENT);
|
||||
getServer().getPlayerList().sendToAllNearExcept(point.excluded, point.x, point.y, point.z, point.r2, point.dim,
|
||||
pkt);
|
||||
}
|
||||
|
||||
public void sendToDimension(final BasePacket message, final DimensionType dim) {
|
||||
getServer().getPlayerList().sendPacketToAllPlayersInDimension(message.toPacket(NetworkDirection.PLAY_TO_CLIENT),
|
||||
getServer().getPlayerList().sendPacketToAllPlayersInDimension(message.toPacket(NetworkSide.PLAY_TO_CLIENT),
|
||||
dim);
|
||||
}
|
||||
|
||||
public void sendToServer(final BasePacket message) {
|
||||
MinecraftClient.getInstance().getConnection().sendPacket(message.toPacket(NetworkDirection.PLAY_TO_SERVER));
|
||||
MinecraftClient.getInstance().getConnection().sendPacket(message.toPacket(NetworkSide.PLAY_TO_SERVER));
|
||||
}
|
||||
|
||||
private MinecraftServer getServer() {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class FluidSlotPacket extends BasePacket {
|
||||
this.list = new HashMap<>();
|
||||
CompoundTag tag = stream.readCompoundTag();
|
||||
|
||||
for (final String key : tag.keySet()) {
|
||||
for (final String key : tag.getKeys()) {
|
||||
this.list.put(Integer.parseInt(key), AEFluidStack.fromNBT(tag.getCompound(key)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraftforge.fml.network.NetworkDirection;
|
||||
import net.minecraft.network.NetworkSide;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.core.AELog;
|
||||
@@ -144,7 +144,7 @@ public class MEFluidInventoryUpdatePacket extends BasePacket {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IPacket<?> toPacket(NetworkDirection direction) {
|
||||
public Packet<?> toPacket(NetworkSide direction) {
|
||||
try {
|
||||
this.compressFrame.close();
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.NetworkSide;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraftforge.fml.network.NetworkDirection;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.implementations.CraftConfirmScreen;
|
||||
@@ -155,7 +155,7 @@ public class MEInventoryUpdatePacket extends BasePacket {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IPacket<?> toPacket(NetworkDirection direction) {
|
||||
public Packet<?> toPacket(NetworkSide direction) {
|
||||
try {
|
||||
this.compressFrame.close();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
@@ -34,14 +34,14 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
public class SwitchGuisPacket extends BasePacket {
|
||||
|
||||
private final ContainerType<?> newGui;
|
||||
private final ScreenHandlerType<?> newGui;
|
||||
|
||||
public SwitchGuisPacket(final PacketByteBuf stream) {
|
||||
this.newGui = ForgeRegistries.CONTAINERS.getValue(stream.readResourceLocation());
|
||||
}
|
||||
|
||||
// api
|
||||
public SwitchGuisPacket(final ContainerType<?> newGui) {
|
||||
public SwitchGuisPacket(final ScreenHandlerType<?> newGui) {
|
||||
this.newGui = newGui;
|
||||
|
||||
final PacketByteBuf data = new PacketByteBuf(Unpooled.buffer());
|
||||
|
||||
@@ -1,47 +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.Nonnull;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import appeng.services.CompassService;
|
||||
|
||||
/**
|
||||
* @author thatsIch
|
||||
* @version rv3 - 30.05.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
final class CompassData implements IWorldCompassData {
|
||||
@Nonnull
|
||||
private final CompassService service;
|
||||
|
||||
public CompassData(@Nonnull final CompassService service) {
|
||||
Preconditions.checkNotNull(service);
|
||||
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompassService service() {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +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 appeng.services.CompassService;
|
||||
|
||||
/**
|
||||
* @author thatsIch
|
||||
* @version rv3 - 30.05.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
public interface IWorldCompassData {
|
||||
CompassService service();
|
||||
}
|
||||
@@ -1,41 +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.Nonnull;
|
||||
|
||||
/**
|
||||
* @author thatsIch
|
||||
* @version rv3 - 02.11.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
public interface IWorldData {
|
||||
void onServerStopping();
|
||||
|
||||
void onServerStoppped();
|
||||
|
||||
@Nonnull
|
||||
IWorldGridStorageData storageData();
|
||||
|
||||
@Nonnull
|
||||
IWorldPlayerData playerData();
|
||||
|
||||
@Nonnull
|
||||
IWorldCompassData compassData();
|
||||
}
|
||||
@@ -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 javax.annotation.Nonnull;
|
||||
|
||||
import appeng.me.GridStorage;
|
||||
|
||||
/**
|
||||
* @author thatsIch
|
||||
* @version rv3 - 30.05.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
public interface IWorldGridStorageData {
|
||||
GridStorage getGridStorage(long storageID);
|
||||
|
||||
@Nonnull
|
||||
GridStorage getNewGridStorage();
|
||||
|
||||
void destroyGridStorage(long id);
|
||||
|
||||
int getNextOrderedValue(String name, int firstValue);
|
||||
}
|
||||
@@ -1,45 +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.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
/**
|
||||
* @author thatsIch
|
||||
* @version rv3 - 30.05.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
public interface IWorldPlayerData {
|
||||
/**
|
||||
* Gets the UUID of the Minecraft profile associated with the given ME player
|
||||
* id.
|
||||
*
|
||||
* @param playerID An ME player id.
|
||||
* @return Null if the ME player id is unknown, otherwise the unique id of the
|
||||
* Minecraft profile it originates from.
|
||||
*/
|
||||
@Nullable
|
||||
UUID getProfileId(int playerID);
|
||||
|
||||
int getMePlayerId(GameProfile profile);
|
||||
}
|
||||
@@ -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.CompoundTag;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
/**
|
||||
* @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, CompoundTag newData);
|
||||
|
||||
Collection<CompoundTag> getNearByMeteorites(Dimension dim, int chunkX, int chunkZ);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user