API compiles
This commit is contained in:
@@ -23,26 +23,15 @@
|
||||
|
||||
package appeng.api.config;
|
||||
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
||||
|
||||
public enum Actionable {
|
||||
/**
|
||||
* Perform the intended action.
|
||||
*/
|
||||
MODULATE(FluidAction.EXECUTE),
|
||||
MODULATE,
|
||||
|
||||
/**
|
||||
* Pretend to perform the action.
|
||||
*/
|
||||
SIMULATE(FluidAction.SIMULATE);
|
||||
SIMULATE
|
||||
|
||||
private final FluidAction fluidAction;
|
||||
|
||||
Actionable(FluidAction fluidAction) {
|
||||
this.fluidAction = fluidAction;
|
||||
}
|
||||
|
||||
public FluidAction getFluidAction() {
|
||||
return fluidAction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
package appeng.api.config;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
public enum PowerUnits {
|
||||
AE("gui.appliedenergistics2.units.appliedenergstics"), // Native Units - AE Energy
|
||||
@@ -61,8 +61,8 @@ public enum PowerUnits {
|
||||
return (value * this.conversionRatio) / target.conversionRatio;
|
||||
}
|
||||
|
||||
public ITextComponent textComponent() {
|
||||
return new TranslationTextComponent(unlocalizedName);
|
||||
public Text textComponent() {
|
||||
return new TranslatableText(unlocalizedName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,11 +20,11 @@ package appeng.api.definitions;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
||||
public interface ITileDefinition extends IBlockDefinition {
|
||||
/**
|
||||
* @return the {@link TileEntity} Class if applicable.
|
||||
* @return the {@link BlockEntity} Class if applicable.
|
||||
*/
|
||||
Optional<? extends Class<? extends TileEntity>> maybeEntity();
|
||||
Optional<? extends Class<? extends BlockEntity>> maybeEntity();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package appeng.api.definitions;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
// Private helper class to create AE2 resource locations
|
||||
final class IdHelper {
|
||||
@@ -11,8 +11,8 @@ final class IdHelper {
|
||||
/**
|
||||
* Creates a ResourceLocation namespaced to AE2.
|
||||
*/
|
||||
static ResourceLocation id(String id) {
|
||||
return new ResourceLocation("appliedenergistics2", id);
|
||||
static Identifier id(String id) {
|
||||
return new Identifier("appliedenergistics2", id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,24 +23,24 @@
|
||||
|
||||
package appeng.api.events;
|
||||
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
||||
import appeng.api.features.ILocatable;
|
||||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.fabricmc.fabric.api.event.EventFactory;
|
||||
|
||||
/**
|
||||
* Input Event:
|
||||
*
|
||||
* <p>
|
||||
* Used to Notify the Location Registry of objects, and their availability.
|
||||
*/
|
||||
public class LocatableEventAnnounce extends Event {
|
||||
public interface LocatableEventAnnounce {
|
||||
|
||||
public final ILocatable target;
|
||||
public final LocatableEvent change;
|
||||
Event<LocatableEventAnnounce> EVENT = EventFactory.createArrayBacked(LocatableEventAnnounce.class, listeners -> (ILocatable o, LocatableEvent evt) -> {
|
||||
for (LocatableEventAnnounce listener : listeners) {
|
||||
listener.onLocatableAnnounce(o, evt);
|
||||
}
|
||||
});
|
||||
|
||||
public LocatableEventAnnounce(final ILocatable o, final LocatableEvent ev) {
|
||||
this.target = o;
|
||||
this.change = ev;
|
||||
}
|
||||
void onLocatableAnnounce(final ILocatable o, final LocatableEvent ev);
|
||||
|
||||
public enum LocatableEvent {
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package appeng.api.events;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface LocatableEventCallback {
|
||||
|
||||
void onLocatable(LocatableEventAnnounce.LocatableEvent evt);
|
||||
|
||||
}
|
||||
@@ -25,7 +25,7 @@ package appeng.api.features;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public interface IMatterCannonAmmoRegistry {
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface IMatterCannonAmmoRegistry {
|
||||
* @param ammoTag item tag id
|
||||
* @param weight atomic weight
|
||||
*/
|
||||
void registerAmmoTag(ResourceLocation ammoTag, double weight);
|
||||
void registerAmmoTag(Identifier ammoTag, double weight);
|
||||
|
||||
/**
|
||||
* get the penetration value for a particular ammo, 0 indicates a non-ammo.
|
||||
|
||||
@@ -27,7 +27,6 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
import appeng.api.config.TunnelType;
|
||||
|
||||
@@ -48,8 +47,6 @@ public interface IP2PTunnelRegistry {
|
||||
|
||||
void addNewAttunement(@Nonnull String ModId, @Nullable TunnelType type);
|
||||
|
||||
void addNewAttunement(@Nonnull Capability<?> cap, @Nullable TunnelType type);
|
||||
|
||||
/**
|
||||
* returns null if no attunement can be found.
|
||||
*
|
||||
|
||||
@@ -23,19 +23,16 @@
|
||||
|
||||
package appeng.api.features;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.dimension.Dimension;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.ServerWorldAccess;
|
||||
|
||||
public interface IWorldGen {
|
||||
|
||||
void disableWorldGenForProviderID(WorldGenType type, Class<? extends Dimension> provider);
|
||||
void enableWorldGenForDimension(WorldGenType type, Identifier dimID);
|
||||
|
||||
void enableWorldGenForDimension(WorldGenType type, ResourceLocation dimID);
|
||||
void disableWorldGenForDimension(WorldGenType type, Identifier dimID);
|
||||
|
||||
void disableWorldGenForDimension(WorldGenType type, ResourceLocation dimID);
|
||||
|
||||
boolean isWorldGenEnabled(WorldGenType type, IWorld w);
|
||||
boolean isWorldGenEnabled(WorldGenType type, ServerWorldAccess w);
|
||||
|
||||
enum WorldGenType {
|
||||
CERTUS_QUARTZ, CHARGED_CERTUS_QUARTZ, METEORITES
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.implementations;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.tiles.ISegmentedInventory;
|
||||
@@ -41,5 +41,5 @@ public interface IUpgradeableHost extends IConfigurableObject, ISegmentedInvento
|
||||
*
|
||||
* @return tile entity
|
||||
*/
|
||||
TileEntity getTile();
|
||||
BlockEntity getTile();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.implementations.guiobjects;
|
||||
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
|
||||
@@ -33,5 +33,5 @@ import appeng.api.networking.IGridHost;
|
||||
public interface INetworkTool extends IGuiItemObject {
|
||||
IGridHost getGridHost(); // null for most purposes.
|
||||
|
||||
IItemHandler getInventory();
|
||||
ItemTransferable getInventory();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
|
||||
public interface ISegmentedInventory {
|
||||
|
||||
@@ -36,5 +36,5 @@ public interface ISegmentedInventory {
|
||||
*
|
||||
* @return inventory with inventory name
|
||||
*/
|
||||
IItemHandler getInventoryByName(String name);
|
||||
ItemTransferable getInventoryByName(String name);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
|
||||
public interface IViewCellStorage {
|
||||
|
||||
@@ -32,5 +32,5 @@ public interface IViewCellStorage {
|
||||
*
|
||||
* @return inventory with at least 5 slot
|
||||
*/
|
||||
IItemHandler getViewCellStorage();
|
||||
ItemTransferable getViewCellStorage();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.movable;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -38,7 +38,7 @@ public interface IMovableHandler {
|
||||
*
|
||||
* @return true if it can handle moving
|
||||
*/
|
||||
boolean canHandle(Class<? extends TileEntity> myClass, TileEntity tile);
|
||||
boolean canHandle(Class<? extends BlockEntity> myClass, BlockEntity tile);
|
||||
|
||||
/**
|
||||
* request that the handler move the the tile from its current location to the
|
||||
@@ -64,5 +64,5 @@ public interface IMovableHandler {
|
||||
* @param world world of tile
|
||||
* @param newPosition the new location
|
||||
*/
|
||||
void moveTile(TileEntity tile, World world, BlockPos newPosition);
|
||||
void moveTile(BlockEntity tile, World world, BlockPos newPosition);
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
package appeng.api.movable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
||||
/**
|
||||
* Used to determine if a tile is marked as movable, a block will be considered
|
||||
@@ -36,7 +36,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
* 2. The Tile implements IMovableTile
|
||||
*
|
||||
* 3. A IMovableHandler is register that returns canHandle = true for the
|
||||
* {@link TileEntity} subclass
|
||||
* {@link BlockEntity} subclass
|
||||
*
|
||||
*
|
||||
* The movement process is as follows,
|
||||
@@ -72,21 +72,21 @@ public interface IMovableRegistry {
|
||||
* If you tile is handled with IMovableHandler or IMovableTile you do not need
|
||||
* to white list it.
|
||||
*/
|
||||
void whiteListTileEntity(Class<? extends TileEntity> c);
|
||||
void whiteListTileEntity(Class<? extends BlockEntity> c);
|
||||
|
||||
/**
|
||||
* @param te to be moved tile entity
|
||||
*
|
||||
* @return true if the tile has accepted your request to move it
|
||||
*/
|
||||
boolean askToMove(TileEntity te);
|
||||
boolean askToMove(BlockEntity te);
|
||||
|
||||
/**
|
||||
* tells the tile you are done moving it.
|
||||
*
|
||||
* @param te moved tile entity
|
||||
*/
|
||||
void doneMoving(TileEntity te);
|
||||
void doneMoving(BlockEntity te);
|
||||
|
||||
/**
|
||||
* add a new handler movable handler.
|
||||
@@ -105,7 +105,7 @@ public interface IMovableRegistry {
|
||||
*
|
||||
* @return moving handler of tile entity
|
||||
*/
|
||||
IMovableHandler getHandler(TileEntity te);
|
||||
IMovableHandler getHandler(BlockEntity te);
|
||||
|
||||
/**
|
||||
* @return a copy of the default handler
|
||||
|
||||
@@ -26,14 +26,14 @@ package appeng.api.networking;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
/**
|
||||
* Implement to create a networked {@link TileEntity} or {@link IPart} must be
|
||||
* Implement to create a networked {@link BlockEntity} or {@link IPart} must be
|
||||
* implemented for a part, or tile entity to become part of a grid.
|
||||
*/
|
||||
public interface IGridHost {
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.EnumSet;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
@@ -89,7 +89,7 @@ public interface IGridNode {
|
||||
* @return the world the node is located in
|
||||
*/
|
||||
@Nonnull
|
||||
IWorld getWorld();
|
||||
WorldAccess getWorld();
|
||||
|
||||
/**
|
||||
* @return a set of the connected sides, INTERNAL represents an invisible
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.networking.crafting;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.networking.storage.IBaseMonitor;
|
||||
@@ -54,5 +54,5 @@ public interface ICraftingCPU extends IBaseMonitor<IAEItemStack> {
|
||||
/**
|
||||
* @return a null or the name of the cpu.
|
||||
*/
|
||||
ITextComponent getName();
|
||||
Text getName();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ package appeng.api.parts;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
@@ -75,7 +75,7 @@ public interface IFacadeContainer {
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
boolean readFromStream(PacketBuffer data) throws IOException;
|
||||
boolean readFromStream(PacketByteBuf data) throws IOException;
|
||||
|
||||
/**
|
||||
* read from NBT
|
||||
@@ -91,7 +91,7 @@ public interface IFacadeContainer {
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
void writeToStream(PacketBuffer data) throws IOException;
|
||||
void writeToStream(PacketByteBuf data) throws IOException;
|
||||
|
||||
/**
|
||||
* @return true if there are no facades.
|
||||
|
||||
@@ -29,27 +29,24 @@ import java.util.Random;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import alexiil.mc.lib.attributes.AttributeList;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.model.data.EmptyModelData;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
@@ -80,8 +77,8 @@ public interface IPart extends ICustomCableConnection {
|
||||
* part has to return true for {@link #requireDynamicRender()} in order for this
|
||||
* method to be called.
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
default void renderDynamic(float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffers,
|
||||
@Environment(EnvType.CLIENT)
|
||||
default void renderDynamic(float partialTicks, MatrixStack matrixStack, VertexConsumerProvider buffers,
|
||||
int combinedLightIn, int combinedOverlayIn) {
|
||||
}
|
||||
|
||||
@@ -155,7 +152,7 @@ public interface IPart extends ICustomCableConnection {
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
void writeToStream(PacketBuffer data) throws IOException;
|
||||
void writeToStream(PacketByteBuf data) throws IOException;
|
||||
|
||||
/**
|
||||
* read data from bus packet.
|
||||
@@ -166,7 +163,7 @@ public interface IPart extends ICustomCableConnection {
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
boolean readFromStream(PacketBuffer data) throws IOException;
|
||||
boolean readFromStream(PacketByteBuf data) throws IOException;
|
||||
|
||||
/**
|
||||
* get the Grid Node for the Bus, be sure your IGridBlock is NOT
|
||||
@@ -209,7 +206,7 @@ public interface IPart extends ICustomCableConnection {
|
||||
* @param host part side
|
||||
* @param tile tile entity of part
|
||||
*/
|
||||
void setPartHostInfo(AEPartLocation side, IPartHost host, TileEntity tile);
|
||||
void setPartHostInfo(AEPartLocation side, IPartHost host, BlockEntity tile);
|
||||
|
||||
/**
|
||||
* Called when you right click the part, very similar to Block.onActivateBlock
|
||||
@@ -345,24 +342,11 @@ public interface IPart extends ICustomCableConnection {
|
||||
* capabilities on the cable bus will be forwarded to parts on the appropriate
|
||||
* side.
|
||||
*
|
||||
* @see TileEntity#getCapability(Capability, net.minecraft.util.math.Direction)
|
||||
* @see alexiil.mc.lib.attributes.AttributeProvider
|
||||
*
|
||||
* @return The capability or null.
|
||||
*/
|
||||
default <T> LazyOptional<T> getCapability(Capability<T> capabilityClass) {
|
||||
return LazyOptional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional model data to be passed to the models for rendering this part.
|
||||
*
|
||||
* @return The model data to pass to the model. Only useful if custom models are
|
||||
* used.
|
||||
*/
|
||||
@Nonnull
|
||||
default IModelData getModelData() {
|
||||
return EmptyModelData.INSTANCE;
|
||||
}
|
||||
default void addAllAttributes(AttributeList<?> to) {}
|
||||
|
||||
/**
|
||||
* add your collision information to the the list.
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -118,7 +118,7 @@ public interface IPartHost extends ICustomCableConnection {
|
||||
* @return the tile entity for the host, this can either be an FMP tile, or a AE
|
||||
* tile
|
||||
*/
|
||||
TileEntity getTile();
|
||||
BlockEntity getTile();
|
||||
|
||||
/**
|
||||
* @return the color of the host type ( this is determined by the middle cable.
|
||||
|
||||
@@ -28,10 +28,10 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
/**
|
||||
* A container to store a collection of {@link ResourceLocation} as models for a
|
||||
* A container to store a collection of {@link Identifier} as models for a
|
||||
* part as well as other properties.
|
||||
*/
|
||||
public interface IPartModel {
|
||||
@@ -49,12 +49,12 @@ public interface IPartModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of {@link ResourceLocation} used as models for a part.
|
||||
* A collection of {@link Identifier} used as models for a part.
|
||||
*
|
||||
* @return a collection of models, never null.
|
||||
*/
|
||||
@Nonnull
|
||||
default List<ResourceLocation> getModels() {
|
||||
default List<Identifier> getModels() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.api.parts;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import appeng.api.AEInjectable;
|
||||
|
||||
@@ -41,12 +41,12 @@ public interface IPartModels {
|
||||
* This method must be called during the pre-init phase (as part of your
|
||||
* plugin's constructor).
|
||||
*/
|
||||
void registerModels(Collection<ResourceLocation> partModels);
|
||||
void registerModels(Collection<Identifier> partModels);
|
||||
|
||||
/**
|
||||
* Convenience overload of {@link #registerModels(Collection)}
|
||||
*/
|
||||
default void registerModels(ResourceLocation... partModels) {
|
||||
default void registerModels(Identifier... partModels) {
|
||||
registerModels(Arrays.asList(partModels));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ package appeng.api.parts;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
@@ -38,10 +38,10 @@ import appeng.api.util.AEPartLocation;
|
||||
*
|
||||
* TODO: Consider removing and replacing with capabilities.
|
||||
*/
|
||||
public abstract class LayerBase extends TileEntity // implements IPartHost
|
||||
public abstract class LayerBase extends BlockEntity // implements IPartHost
|
||||
{
|
||||
|
||||
public LayerBase(TileEntityType<?> tileEntityTypeIn) {
|
||||
public LayerBase(BlockEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
|
||||
public interface ISpatialDimension {
|
||||
ServerWorld getWorld(DimensionType cellDim);
|
||||
@@ -45,6 +45,6 @@ public interface ISpatialDimension {
|
||||
* Adds a user-facing tooltip that describes this dimension so that a player can
|
||||
* keep storage cells apart.
|
||||
*/
|
||||
void addCellDimensionTooltip(DimensionType cellDim, List<ITextComponent> lines);
|
||||
void addCellDimensionTooltip(DimensionType cellDim, List<Text> lines);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
@@ -92,7 +91,7 @@ public interface IStorageChannel<T extends IAEStack<T>> {
|
||||
* @throws IOException
|
||||
*/
|
||||
@Nullable
|
||||
T readFromPacket(@Nonnull PacketBuffer input);
|
||||
T readFromPacket(@Nonnull PacketByteBuf input);
|
||||
|
||||
/**
|
||||
* create from nbt data
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
package appeng.api.storage.cells;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
@@ -50,12 +50,12 @@ public interface ICellInventory<T extends IAEStack<T>> extends IMEInventory<T> {
|
||||
/**
|
||||
* @return access configured list
|
||||
*/
|
||||
IItemHandler getConfigInventory();
|
||||
ItemTransferable getConfigInventory();
|
||||
|
||||
/**
|
||||
* @return access installed upgrades.
|
||||
*/
|
||||
IItemHandler getUpgradesInventory();
|
||||
ItemTransferable getUpgradesInventory();
|
||||
|
||||
/**
|
||||
* @return How many bytes are used for each type?
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
package appeng.api.storage.cells;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
|
||||
@@ -47,7 +47,7 @@ public interface ICellWorkbenchItem {
|
||||
*
|
||||
* onInventoryChange will be called when saving is needed.
|
||||
*/
|
||||
IItemHandler getUpgradesInventory(ItemStack is);
|
||||
ItemTransferable getUpgradesInventory(ItemStack is);
|
||||
|
||||
/**
|
||||
* Used to extract, or mirror the contents of the work bench onto the cell.
|
||||
@@ -56,7 +56,7 @@ public interface ICellWorkbenchItem {
|
||||
*
|
||||
* onInventoryChange will be called when saving is needed.
|
||||
*/
|
||||
IItemHandler getConfigInventory(ItemStack is);
|
||||
ItemTransferable getConfigInventory(ItemStack is);
|
||||
|
||||
/**
|
||||
* @return the current fuzzy status.
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
package appeng.api.storage.data;
|
||||
|
||||
import alexiil.mc.lib.attributes.fluid.volume.FluidVolume;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
/**
|
||||
* An alternate version of FluidStack for AE to keep tabs on things easier, and
|
||||
@@ -45,7 +45,7 @@ public interface IAEFluidStack extends IAEStack<IAEFluidStack> {
|
||||
*
|
||||
* @return new FluidStack
|
||||
*/
|
||||
FluidStack getFluidStack();
|
||||
FluidVolume getFluidStack();
|
||||
|
||||
/**
|
||||
* Combines two IAEItemStacks via addition.
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.io.IOException;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.IStorageChannel;
|
||||
@@ -162,7 +162,7 @@ public interface IAEStack<T extends IAEStack<T>> {
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
void writeToPacket(PacketBuffer data);
|
||||
void writeToPacket(PacketByteBuf data);
|
||||
|
||||
/**
|
||||
* Clone the Item / Fluid Stack
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package appeng.api.util;
|
||||
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
|
||||
/**
|
||||
* Mutable stand in for Axis Aligned BB, this was used to prevent GC Thrashing..
|
||||
@@ -35,8 +35,8 @@ public class AEAxisAlignedBB {
|
||||
public double maxY;
|
||||
public double maxZ;
|
||||
|
||||
public AxisAlignedBB getBoundingBox() {
|
||||
return new AxisAlignedBB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);
|
||||
public Box getBoundingBox() {
|
||||
return new Box(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);
|
||||
}
|
||||
|
||||
public AEAxisAlignedBB(final double a, final double b, final double c, final double d, final double e,
|
||||
@@ -54,7 +54,7 @@ public class AEAxisAlignedBB {
|
||||
return new AEAxisAlignedBB(a, b, c, d, e, f);
|
||||
}
|
||||
|
||||
public static AEAxisAlignedBB fromBounds(final AxisAlignedBB bb) {
|
||||
public static AEAxisAlignedBB fromBounds(final Box bb) {
|
||||
return new AEAxisAlignedBB(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ package appeng.api.util;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.util.DyeColor;
|
||||
|
||||
/**
|
||||
* List of all colors supported by AE, their names, and various colors for
|
||||
@@ -75,25 +75,25 @@ public enum AEColor {
|
||||
PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE, BLUE, BROWN, GREEN, RED, BLACK);
|
||||
|
||||
/**
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to
|
||||
* The {@link BakedQuad#getColorIndex() tint index} that can normally be used to
|
||||
* get the {@link #blackVariant dark variant} of the apprioriate AE color.
|
||||
*/
|
||||
public static final int TINTINDEX_DARK = 1;
|
||||
|
||||
/**
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to
|
||||
* The {@link BakedQuad#getColorIndex() tint index} that can normally be used to
|
||||
* get the {@link #mediumVariant medium variant} of the apprioriate AE color.
|
||||
*/
|
||||
public static final int TINTINDEX_MEDIUM = 2;
|
||||
|
||||
/**
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to
|
||||
* The {@link BakedQuad#getColorIndex() tint index} that can normally be used to
|
||||
* get the {@link #whiteVariant bright variant} of the apprioriate AE color.
|
||||
*/
|
||||
public static final int TINTINDEX_BRIGHT = 3;
|
||||
|
||||
/**
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to
|
||||
* The {@link BakedQuad#getColorIndex() tint index} that can normally be used to
|
||||
* get a color between the {@link #mediumVariant medium} and
|
||||
* {@link #whiteVariant bright variant} of the apprioriate AE color.
|
||||
*/
|
||||
@@ -145,7 +145,7 @@ public enum AEColor {
|
||||
* Will return a variant of this color based on the given tint index.
|
||||
*
|
||||
* @param tintIndex A tint index as it can be used for
|
||||
* {@link BakedQuad#getTintIndex()}.
|
||||
* {@link BakedQuad#getColorIndex()}.
|
||||
* @return The appropriate color variant, or -1.
|
||||
*/
|
||||
public int getVariantByTintIndex(int tintIndex) {
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
package appeng.api.util;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface AEColoredItemDefinition {
|
||||
|
||||
@@ -41,9 +41,9 @@ public interface AEColoredItemDefinition {
|
||||
Item item(AEColor color);
|
||||
|
||||
/**
|
||||
* @return the {@link TileEntity} Class if applicable.
|
||||
* @return the {@link BlockEntity} Class if applicable.
|
||||
*/
|
||||
Class<? extends TileEntity> entity(AEColor color);
|
||||
Class<? extends BlockEntity> entity(AEColor color);
|
||||
|
||||
/**
|
||||
* @return an {@link ItemStack} with specified quantity of this item.
|
||||
|
||||
@@ -23,18 +23,18 @@
|
||||
|
||||
package appeng.api.util;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.dimension.Dimension;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
/**
|
||||
* Represents a location in the Minecraft Universe
|
||||
*/
|
||||
public class DimensionalCoord extends WorldCoord {
|
||||
|
||||
private final IWorld world;
|
||||
private final Dimension dimension;
|
||||
private final WorldAccess world;
|
||||
private final DimensionType dimension;
|
||||
|
||||
public DimensionalCoord(final DimensionalCoord coordinate) {
|
||||
super(coordinate.x, coordinate.y, coordinate.z);
|
||||
@@ -42,19 +42,19 @@ public class DimensionalCoord extends WorldCoord {
|
||||
this.dimension = coordinate.dimension;
|
||||
}
|
||||
|
||||
public DimensionalCoord(final TileEntity tileEntity) {
|
||||
public DimensionalCoord(final BlockEntity tileEntity) {
|
||||
super(tileEntity);
|
||||
this.world = tileEntity.getWorld();
|
||||
this.dimension = this.world.getDimension();
|
||||
}
|
||||
|
||||
public DimensionalCoord(final IWorld world, final int x, final int y, final int z) {
|
||||
public DimensionalCoord(final WorldAccess world, final int x, final int y, final int z) {
|
||||
super(x, y, z);
|
||||
this.world = world;
|
||||
this.dimension = world.getDimension();
|
||||
}
|
||||
|
||||
public DimensionalCoord(final IWorld world, final BlockPos pos) {
|
||||
public DimensionalCoord(final WorldAccess world, final BlockPos pos) {
|
||||
super(pos);
|
||||
this.world = world;
|
||||
this.dimension = world.getDimension();
|
||||
@@ -80,11 +80,11 @@ public class DimensionalCoord extends WorldCoord {
|
||||
return "dimension=" + this.dimension + ", " + super.toString();
|
||||
}
|
||||
|
||||
public boolean isInWorld(final IWorld world) {
|
||||
public boolean isInWorld(final WorldAccess world) {
|
||||
return this.world == world;
|
||||
}
|
||||
|
||||
public IWorld getWorld() {
|
||||
public WorldAccess getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ package appeng.api.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import appeng.api.storage.cells.ICellInventoryHandler;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
@@ -37,6 +37,6 @@ public interface IClientHelper {
|
||||
* @param handler Cell handler.
|
||||
* @param lines List of lines to add to.
|
||||
*/
|
||||
<T extends IAEStack<T>> void addCellInformation(ICellInventoryHandler<T> handler, List<ITextComponent> lines);
|
||||
<T extends IAEStack<T>> void addCellInformation(ICellInventoryHandler<T> handler, List<Text> lines);
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.util;
|
||||
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
|
||||
/**
|
||||
* Implement on Tile or part to customize if the info gui opens, or an action is
|
||||
@@ -31,5 +31,5 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
*/
|
||||
public interface INetworkToolAgent {
|
||||
|
||||
boolean showNetworkInfo(RayTraceResult where);
|
||||
boolean showNetworkInfo(HitResult where);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.util;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,7 @@ public class WorldCoord {
|
||||
public int y;
|
||||
public int z;
|
||||
|
||||
public WorldCoord(final TileEntity s) {
|
||||
public WorldCoord(final BlockEntity s) {
|
||||
this(s.getPos());
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ allprojects {
|
||||
|
||||
repositories {
|
||||
maven { url = "http://maven.fabricmc.net/" }
|
||||
maven {
|
||||
name = "BuildCraft"
|
||||
url = "https://mod-buildcraft.com/maven"
|
||||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
@@ -66,6 +70,8 @@ allprojects {
|
||||
|
||||
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
|
||||
|
||||
modCompile "alexiil.mc.lib:libblockattributes-all:0.7.0"
|
||||
|
||||
compile 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
|
||||
@@ -105,7 +105,7 @@ public abstract class AEBaseBlock extends Block {
|
||||
/**
|
||||
* Rotates around the given Axis (usually the current up axis).
|
||||
*/
|
||||
public boolean rotateAroundFaceAxis(IWorld w, BlockPos pos, Direction face) {
|
||||
public boolean rotateAroundFaceAxis(WorldAccess w, BlockPos pos, Direction face) {
|
||||
final IOrientable rotatable = this.getOrientable(w, pos);
|
||||
|
||||
if (rotatable != null && rotatable.canBeRotated()) {
|
||||
@@ -216,7 +216,7 @@ public abstract class AEBaseBlock extends Block {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward,
|
||||
protected boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward,
|
||||
final Direction up) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -29,10 +30,9 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
@@ -52,14 +52,14 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public final void addInformation(final ItemStack itemStack, final World world, final List<ITextComponent> toolTip,
|
||||
@Environment(EnvType.CLIENT)
|
||||
public final void addInformation(final ItemStack itemStack, final World world, final List<Text> toolTip,
|
||||
final ITooltipFlag advancedTooltips) {
|
||||
this.addCheckedInformation(itemStack, world, toolTip, advancedTooltips);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void addCheckedInformation(final ItemStack itemStack, final World world, final List<ITextComponent> toolTip,
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void addCheckedInformation(final ItemStack itemStack, final World world, final List<Text> toolTip,
|
||||
final ITooltipFlag advancedTooltips) {
|
||||
this.blockType.addInformation(itemStack, world, toolTip, advancedTooltips);
|
||||
}
|
||||
|
||||
@@ -21,16 +21,16 @@ package appeng.block;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
@@ -45,7 +45,7 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
public AEBaseBlockItemChargeable(Block id, Properties props) {
|
||||
super(id, props);
|
||||
|
||||
addPropertyOverride(new ResourceLocation("appliedenergistics2:fill_level"), (is, world, entity) -> {
|
||||
addPropertyOverride(new Identifier("appliedenergistics2:fill_level"), (is, world, entity) -> {
|
||||
double curPower = getAECurrentPower(is);
|
||||
double maxPower = getAEMaxPower(is);
|
||||
|
||||
@@ -54,8 +54,8 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void addCheckedInformation(final ItemStack stack, final World world, final List<ITextComponent> lines,
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void addCheckedInformation(final ItemStack stack, final World world, final List<Text> lines,
|
||||
final ITooltipFlag advancedTooltips) {
|
||||
double internalCurrentPower = 0;
|
||||
final double internalMaxPower = this.getMaxEnergyCapacity();
|
||||
@@ -70,7 +70,7 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
|
||||
lines.add(GuiText.StoredEnergy.textComponent()
|
||||
.appendText(':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower))
|
||||
.appendSibling(new TranslationTextComponent(PowerUnits.AE.unlocalizedName))
|
||||
.appendSibling(new TranslatableText(PowerUnits.AE.unlocalizedName))
|
||||
.appendText(" - " + MessageFormat.format("{0,number,#.##%}", percent)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,21 +29,21 @@ import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
|
||||
@@ -102,7 +102,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
return null;
|
||||
}
|
||||
|
||||
final TileEntity te = w.getTileEntity(pos);
|
||||
final BlockEntity te = w.getTileEntity(pos);
|
||||
// FIXME: This gets called as part of building the block state cache
|
||||
if (this.tileEntityClass != null && this.tileEntityClass.isInstance(te)) {
|
||||
return this.tileEntityClass.cast(te);
|
||||
@@ -112,7 +112,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public final TileEntity createTileEntity(BlockState state, BlockView world) {
|
||||
public final BlockEntity createTileEntity(BlockState state, BlockView world) {
|
||||
return this.tileEntityFactory.get();
|
||||
}
|
||||
|
||||
@@ -145,9 +145,9 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolorBlock(BlockState state, final IWorld world, final BlockPos pos, final Direction side,
|
||||
public boolean recolorBlock(BlockState state, final WorldAccess world, final BlockPos pos, final Direction side,
|
||||
final DyeColor color) {
|
||||
final TileEntity te = this.getTileEntity(world, pos);
|
||||
final BlockEntity te = this.getTileEntity(world, pos);
|
||||
|
||||
if (te instanceof IColorableTile) {
|
||||
final IColorableTile ct = (IColorableTile) te;
|
||||
@@ -166,7 +166,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
|
||||
@Override
|
||||
public int getComparatorOutput(BlockState state, final World w, final BlockPos pos) {
|
||||
final TileEntity te = this.getTileEntity(w, pos);
|
||||
final BlockEntity te = this.getTileEntity(w, pos);
|
||||
if (te instanceof AEBaseInvTileEntity) {
|
||||
AEBaseInvTileEntity invTile = (AEBaseInvTileEntity) te;
|
||||
if (invTile.getInternalInventory().getSlots() > 0) {
|
||||
@@ -180,7 +180,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
public boolean eventReceived(final BlockState state, final World worldIn, final BlockPos pos, final int eventID,
|
||||
final int eventParam) {
|
||||
super.eventReceived(state, worldIn, pos, eventID, eventParam);
|
||||
final TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
final BlockEntity tileentity = worldIn.getTileEntity(pos);
|
||||
return tileentity != null ? tileentity.receiveClientEvent(eventID, eventParam) : false;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
// I18N strings and we would translate it using the server's locale :-(
|
||||
AEBaseTileEntity te = this.getTileEntity(w, pos);
|
||||
if (te != null && is.hasDisplayName()) {
|
||||
ITextComponent displayName = is.getDisplayName();
|
||||
Text displayName = is.getDisplayName();
|
||||
if (displayName instanceof StringTextComponent) {
|
||||
te.setName(((StringTextComponent) displayName).getText());
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
* returned unchanged, this is also the case if the given block state does not
|
||||
* belong to this block.
|
||||
*/
|
||||
public final BlockState getTileEntityBlockState(BlockState current, TileEntity te) {
|
||||
public final BlockState getTileEntityBlockState(BlockState current, BlockEntity te) {
|
||||
if (current.getBlock() != this || !tileEntityClass.isInstance(te)) {
|
||||
return current;
|
||||
}
|
||||
|
||||
@@ -23,21 +23,21 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
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.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
@@ -95,8 +95,8 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
final TileEntity te = w.getTileEntity(pos);
|
||||
public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
final BlockEntity te = w.getTileEntity(pos);
|
||||
return !(te instanceof CrankTileEntity) || this.isCrankable(w, pos, up.getOpposite());
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
|
||||
private boolean isCrankable(final BlockView world, final BlockPos pos, final Direction offset) {
|
||||
final BlockPos o = pos.offset(offset);
|
||||
final TileEntity te = world.getTileEntity(o);
|
||||
final BlockEntity te = world.getTileEntity(o);
|
||||
|
||||
return te instanceof ICrankable && ((ICrankable) te).canCrankAttach(offset.getOpposite());
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
final double yOff = -0.15 * up.getYOffset();
|
||||
final double zOff = -0.15 * up.getZOffset();
|
||||
return VoxelShapes.create(
|
||||
new AxisAlignedBB(xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85));
|
||||
new Box(xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.util.math.Box;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
@@ -38,7 +41,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -46,8 +48,6 @@ import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.AEAxisAlignedBB;
|
||||
@@ -91,7 +91,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
@@ -168,21 +168,21 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
|
||||
return VoxelShapes.create(bb.getBoundingBox());
|
||||
}
|
||||
return VoxelShapes.create(new AxisAlignedBB(0.0, 0, 0.0, 1.0, 1.0, 1.0));
|
||||
return VoxelShapes.create(new Box(0.0, 0, 0.0, 1.0, 1.0, 1.0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
|
||||
ShapeContext context) {
|
||||
return VoxelShapes.create(new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
|
||||
return VoxelShapes.create(new Box(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static Function<TileEntityRendererDispatcher, TileEntityRenderer<ChargerTileEntity>> createTesr() {
|
||||
return dispatcher -> new ModularTESR<>(dispatcher, new ItemRenderable<>(ChargerBlock::getRenderedItem));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private static Pair<ItemStack, TransformationMatrix> getRenderedItem(ChargerTileEntity tile) {
|
||||
TransformationMatrix transform = new TransformationMatrix(new Vector3f(0.5f, 0.375f, 0.5f), null, null, null);
|
||||
return new ImmutablePair<>(tile.getInternalInventory().getStackInSlot(0), transform);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.bootstrap.TileEntityRendering;
|
||||
import appeng.bootstrap.TileEntityRenderingCustomizer;
|
||||
@@ -11,7 +11,7 @@ import appeng.tile.misc.InscriberTileEntity;
|
||||
|
||||
public class InscriberRendering extends TileEntityRenderingCustomizer<InscriberTileEntity> {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void customize(TileEntityRendering<InscriberTileEntity> rendering) {
|
||||
rendering.tileEntityRenderer(InscriberTESR::new);
|
||||
|
||||
@@ -26,14 +26,14 @@ import net.minecraft.block.Material;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -87,7 +87,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
return this.canPlaceAt(w, pos, up.getOpposite());
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
|
||||
final double yOff = -0.3 * up.getYOffset();
|
||||
final double zOff = -0.3 * up.getZOffset();
|
||||
return VoxelShapes
|
||||
.create(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
.create(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,18 +34,18 @@ import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
@@ -68,7 +68,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
final double yOff = -0.3 * facing.getYOffset();
|
||||
final double zOff = -0.3 * facing.getZOffset();
|
||||
VoxelShape shape = VoxelShapes
|
||||
.create(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
.create(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
SHAPES.put(facing, shape);
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
// Break the fixture if the block it is attached to is changed so that it could
|
||||
// no longer be placed
|
||||
@Override
|
||||
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld worldIn,
|
||||
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, WorldAccess worldIn,
|
||||
BlockPos pos, BlockPos facingPos) {
|
||||
Direction fixtureFacing = state.get(FACING);
|
||||
if (facing.getOpposite() == fixtureFacing && !canPlaceAt(worldIn, pos, facing)) {
|
||||
@@ -127,7 +127,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
// FIXME: I think this entire method -> not required, but not sure... are quartz
|
||||
// fixtures rotateable???
|
||||
return this.canPlaceAt(w, pos, up.getOpposite());
|
||||
@@ -146,7 +146,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.block.misc;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
@@ -30,8 +31,7 @@ import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -62,7 +62,7 @@ public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAc
|
||||
builder.add(POWERED);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
@@ -32,7 +32,7 @@ import appeng.client.render.StaticItemColor;
|
||||
public class SecurityStationRendering extends BlockRenderingCustomizer {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
rendering.blockColor(ColorableTileBlockColor.INSTANCE);
|
||||
|
||||
@@ -22,13 +22,13 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
final SkyCompassTileEntity sc = this.getTileEntity(w, pos);
|
||||
if (sc != null) {
|
||||
return false;
|
||||
@@ -139,7 +139,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
break;
|
||||
}
|
||||
|
||||
return VoxelShapes.create(new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
}
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.bootstrap.TileEntityRendering;
|
||||
import appeng.bootstrap.TileEntityRenderingCustomizer;
|
||||
@@ -29,7 +29,7 @@ import appeng.tile.misc.SkyCompassTileEntity;
|
||||
public class SkyCompassRendering extends TileEntityRenderingCustomizer<SkyCompassTileEntity> {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(TileEntityRendering<SkyCompassTileEntity> rendering) {
|
||||
rendering.tileEntityRenderer(SkyCompassTESR::new);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -41,7 +41,7 @@ import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.entity.TinyTNTPrimedEntity;
|
||||
@@ -49,7 +49,7 @@ import appeng.entity.TinyTNTPrimedEntity;
|
||||
public class TinyTNTBlock extends AEBaseBlock {
|
||||
|
||||
private static final VoxelShape SHAPE = VoxelShapes
|
||||
.create(new AxisAlignedBB(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
|
||||
.create(new Box(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
|
||||
|
||||
public TinyTNTBlock(Settings props) {
|
||||
super(props);
|
||||
|
||||
@@ -24,37 +24,37 @@ import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.render.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
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.math.RayTraceResult.Type;
|
||||
import net.minecraft.util.hit.HitResult.Type;
|
||||
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.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.parts.IFacadeContainer;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
@@ -166,7 +166,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(BlockState state, RayTraceResult target, BlockView world, BlockPos pos,
|
||||
public ItemStack getPickBlock(BlockState state, HitResult target, BlockView world, BlockPos pos,
|
||||
PlayerEntity player) {
|
||||
final Vec3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ());
|
||||
final SelectedPart sp = this.cb(world, pos).selectPart(v3);
|
||||
@@ -181,8 +181,8 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public boolean addHitEffects(final BlockState state, final World world, final RayTraceResult target,
|
||||
@Environment(EnvType.CLIENT)
|
||||
public boolean addHitEffects(final BlockState state, final World world, final HitResult target,
|
||||
final ParticleManager effectRenderer) {
|
||||
|
||||
// Half the particle rate. Since we're spawning concentrated on a specific spot,
|
||||
@@ -226,7 +226,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
return true;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public boolean addDestroyEffects(BlockState state, World world, BlockPos pos, ParticleManager effectRenderer) {
|
||||
ICableBusContainer cb = this.cb(world, pos);
|
||||
@@ -281,7 +281,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
private ICableBusContainer cb(final BlockView w, final BlockPos pos) {
|
||||
final TileEntity te = w.getTileEntity(pos);
|
||||
final BlockEntity te = w.getTileEntity(pos);
|
||||
ICableBusContainer out = null;
|
||||
|
||||
if (te instanceof CableBusTileEntity) {
|
||||
@@ -293,7 +293,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
|
||||
@Nullable
|
||||
private IFacadeContainer fc(final BlockView w, final BlockPos pos) {
|
||||
final TileEntity te = w.getTileEntity(pos);
|
||||
final BlockEntity te = w.getTileEntity(pos);
|
||||
IFacadeContainer out = null;
|
||||
|
||||
if (te instanceof CableBusTileEntity) {
|
||||
@@ -306,7 +306,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
@Override
|
||||
public void onBlockClicked(BlockState state, World worldIn, BlockPos pos, PlayerEntity player) {
|
||||
if (worldIn.isRemote()) {
|
||||
final RayTraceResult rtr = Minecraft.getInstance().objectMouseOver;
|
||||
final HitResult rtr = Minecraft.getInstance().objectMouseOver;
|
||||
if (rtr instanceof BlockRayTraceResult) {
|
||||
BlockRayTraceResult brtr = (BlockRayTraceResult) rtr;
|
||||
if (brtr.getPos().equals(pos)) {
|
||||
@@ -335,7 +335,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolorBlock(BlockState state, IWorld world, BlockPos pos, Direction side, DyeColor color) {
|
||||
public boolean recolorBlock(BlockState state, WorldAccess world, BlockPos pos, Direction side, DyeColor color) {
|
||||
return recolorBlock(world, pos, side, color, null);
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -21,12 +21,12 @@ package appeng.block.networking;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ILightReader;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.parts.CableBusContainer;
|
||||
@@ -36,7 +36,7 @@ import appeng.tile.networking.CableBusTileEntity;
|
||||
* Exposes the cable bus color as tint indices 0 (dark variant), 1 (medium
|
||||
* variant) and 2 (bright variant).
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class CableBusColor implements IBlockColor {
|
||||
|
||||
@Override
|
||||
@@ -45,7 +45,7 @@ public class CableBusColor implements IBlockColor {
|
||||
AEColor busColor = AEColor.TRANSPARENT;
|
||||
|
||||
if (worldIn != null && pos != null) {
|
||||
TileEntity tileEntity = worldIn.getTileEntity(pos);
|
||||
BlockEntity tileEntity = worldIn.getTileEntity(pos);
|
||||
if (tileEntity instanceof CableBusTileEntity) {
|
||||
CableBusContainer container = ((CableBusTileEntity) tileEntity).getCableBus();
|
||||
busColor = container.getColor();
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package appeng.block.networking;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
import appeng.bootstrap.IBlockRendering;
|
||||
@@ -32,7 +32,7 @@ import appeng.bootstrap.IItemRendering;
|
||||
public class CableBusRendering extends BlockRenderingCustomizer {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(rt -> true);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -86,7 +86,7 @@ public class ControllerBlock extends AEBaseTileBlock<ControllerTileEntity> {
|
||||
* texture feel for the controller based on how it is placed.
|
||||
*/
|
||||
@Override
|
||||
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world,
|
||||
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, WorldAccess world,
|
||||
BlockPos pos, BlockPos facingPos) {
|
||||
|
||||
// FIXME: this might work, or might _NOT_ work, but needs to be investigated
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
package appeng.block.networking;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
@@ -26,8 +28,6 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.state.IntegerProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
@@ -42,7 +42,7 @@ public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
|
||||
super.fillItemGroup(group, itemStacks);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -153,7 +153,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
|
||||
break;
|
||||
}
|
||||
|
||||
return VoxelShapes.create(new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
}
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
@@ -213,7 +213,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
|
||||
break;
|
||||
}
|
||||
|
||||
return VoxelShapes.create(new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
} else {
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
package appeng.block.networking;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
@@ -13,7 +13,7 @@ import appeng.client.render.StaticBlockColor;
|
||||
|
||||
public class WirelessRendering extends BlockRenderingCustomizer {
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
rendering.blockColor(new StaticBlockColor(AEColor.TRANSPARENT));
|
||||
|
||||
@@ -13,13 +13,13 @@ import javax.annotation.Nullable;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.model.Material;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.ItemOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.data.IDynamicBakedModel;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
@@ -36,11 +36,11 @@ import appeng.tile.misc.PaintSplotchesTileEntity;
|
||||
class PaintSplotchesBakedModel implements IDynamicBakedModel {
|
||||
|
||||
private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "block/paint1"));
|
||||
new Identifier(AppEng.MOD_ID, "block/paint1"));
|
||||
private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "block/paint2"));
|
||||
new Identifier(AppEng.MOD_ID, "block/paint2"));
|
||||
private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "block/paint3"));
|
||||
new Identifier(AppEng.MOD_ID, "block/paint3"));
|
||||
|
||||
private final TextureAtlasSprite[] textures;
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.misc.PaintSplotchesTileEntity;
|
||||
@@ -48,7 +48,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntit
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ import java.util.function.Function;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.IModelTransform;
|
||||
import net.minecraft.client.renderer.model.IUnbakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.model.Material;
|
||||
import net.minecraft.client.renderer.model.ModelBakery;
|
||||
import net.minecraft.client.render.model.IBakedModel;
|
||||
import net.minecraft.client.render.model.IModelTransform;
|
||||
import net.minecraft.client.render.model.IUnbakedModel;
|
||||
import net.minecraft.client.render.model.ItemOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
|
||||
@@ -23,13 +23,13 @@ public class PaintSplotchesModel implements IModelGeometry<PaintSplotchesModel>
|
||||
@Override
|
||||
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
|
||||
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
|
||||
ItemOverrideList overrides, ResourceLocation modelLocation) {
|
||||
ItemOverrideList overrides, Identifier modelLocation) {
|
||||
return new PaintSplotchesBakedModel(spriteGetter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Material> getTextures(IModelConfiguration owner,
|
||||
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
|
||||
Function<Identifier, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
|
||||
return PaintSplotchesBakedModel.getRequiredTextures();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
package appeng.block.paint;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
import appeng.bootstrap.IBlockRendering;
|
||||
@@ -12,7 +12,7 @@ import appeng.bootstrap.IItemRendering;
|
||||
public class PaintSplotchesRendering extends BlockRenderingCustomizer {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
// Disable auto rotation
|
||||
|
||||
@@ -14,14 +14,14 @@ import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.model.Material;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.IBakedModel;
|
||||
import net.minecraft.client.render.model.ItemOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.data.IDynamicBakedModel;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
@@ -33,17 +33,17 @@ import appeng.tile.qnb.QuantumBridgeTileEntity;
|
||||
class QnbFormedBakedModel implements IDynamicBakedModel {
|
||||
|
||||
private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "block/quantum_link"));
|
||||
new Identifier(AppEng.MOD_ID, "block/quantum_link"));
|
||||
private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring"));
|
||||
new Identifier(AppEng.MOD_ID, "block/quantum_ring"));
|
||||
private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring_light"));
|
||||
new Identifier(AppEng.MOD_ID, "block/quantum_ring_light"));
|
||||
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring_light_corner"));
|
||||
new Identifier(AppEng.MOD_ID, "block/quantum_ring_light_corner"));
|
||||
private static final Material TEXTURE_CABLE_GLASS = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/glass/transparent"));
|
||||
new Identifier(AppEng.MOD_ID, "parts/cable/glass/transparent"));
|
||||
private static final Material TEXTURE_COVERED_CABLE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/covered/transparent"));
|
||||
new Identifier(AppEng.MOD_ID, "parts/cable/covered/transparent"));
|
||||
|
||||
private static final float DEFAULT_RENDER_MIN = 2.0f;
|
||||
private static final float DEFAULT_RENDER_MAX = 14.0f;
|
||||
|
||||
@@ -7,14 +7,14 @@ import java.util.function.Function;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.IModelTransform;
|
||||
import net.minecraft.client.renderer.model.IUnbakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.model.Material;
|
||||
import net.minecraft.client.renderer.model.ModelBakery;
|
||||
import net.minecraft.client.render.model.IBakedModel;
|
||||
import net.minecraft.client.render.model.IModelTransform;
|
||||
import net.minecraft.client.render.model.IUnbakedModel;
|
||||
import net.minecraft.client.render.model.ItemOverrideList;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
|
||||
@@ -22,19 +22,19 @@ import appeng.core.AppEng;
|
||||
|
||||
public class QnbFormedModel implements IModelGeometry<QnbFormedModel> {
|
||||
|
||||
private static final ResourceLocation MODEL_RING = new ResourceLocation(AppEng.MOD_ID, "block/qnb/ring");
|
||||
private static final Identifier MODEL_RING = new Identifier(AppEng.MOD_ID, "block/qnb/ring");
|
||||
|
||||
@Override
|
||||
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
|
||||
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
|
||||
ItemOverrideList overrides, ResourceLocation modelLocation) {
|
||||
ItemOverrideList overrides, Identifier modelLocation) {
|
||||
IBakedModel ringModel = bakery.getBakedModel(MODEL_RING, modelTransform, spriteGetter);
|
||||
return new QnbFormedBakedModel(ringModel, spriteGetter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Material> getTextures(IModelConfiguration owner,
|
||||
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
|
||||
Function<Identifier, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
|
||||
return QnbFormedBakedModel.getRequiredTextures();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
@@ -41,7 +41,7 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeTile
|
||||
|
||||
static {
|
||||
final float shave = 2.0f / 16.0f;
|
||||
SHAPE = VoxelShapes.create(new AxisAlignedBB(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
|
||||
SHAPE = VoxelShapes.create(new Box(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
|
||||
}
|
||||
|
||||
public QuantumBaseBlock(Settings props) {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
package appeng.block.qnb;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
import appeng.bootstrap.IBlockRendering;
|
||||
@@ -12,7 +12,7 @@ import appeng.bootstrap.IItemRendering;
|
||||
public class QuantumBridgeRendering extends BlockRenderingCustomizer {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
// Disable auto rotation
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -52,7 +52,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
static {
|
||||
final double onePixel = 2.0 / 16.0;
|
||||
SHAPE = VoxelShapes.create(
|
||||
new AxisAlignedBB(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
new Box(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
}
|
||||
|
||||
public QuantumLinkChamberBlock() {
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.block.qnb;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
@@ -52,6 +52,6 @@ public class QuantumRingBlock extends QuantumBaseBlock {
|
||||
|
||||
private static VoxelShape createShape(double onePixel) {
|
||||
return VoxelShapes.create(
|
||||
new AxisAlignedBB(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
new Box(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.block.spatial;
|
||||
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
@@ -35,8 +36,7 @@ import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class MatrixFrameBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package appeng.block.storage;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
@@ -32,7 +32,7 @@ import appeng.client.render.StaticItemColor;
|
||||
public class ChestRendering extends BlockRenderingCustomizer {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ 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.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -88,11 +88,11 @@ public class SkyChestBlock extends AEBaseTileBlock<SkyChestTileEntity> {
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
// TODO Cache this! It can't be that hard!
|
||||
AxisAlignedBB aabb = computeAABB(worldIn, pos);
|
||||
Box aabb = computeAABB(worldIn, pos);
|
||||
return VoxelShapes.create(aabb);
|
||||
}
|
||||
|
||||
private AxisAlignedBB computeAABB(final BlockView w, final BlockPos pos) {
|
||||
private Box computeAABB(final BlockView w, final BlockPos pos) {
|
||||
final SkyChestTileEntity sk = this.getTileEntity(w, pos);
|
||||
Direction o = Direction.UP;
|
||||
|
||||
@@ -119,6 +119,6 @@ public class SkyChestBlock extends AEBaseTileBlock<SkyChestTileEntity> {
|
||||
final double maxZ = Math.min(1.0,
|
||||
1.0 - offsetZ - (o.getZOffset() < 0 ? AABB_OFFSET_TOP : (o.getZOffset() * AABB_OFFSET_BOTTOM)));
|
||||
|
||||
return new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
return new Box(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@ import java.util.function.Supplier;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.features.AEFeature;
|
||||
@@ -69,10 +69,10 @@ class BlockDefinitionBuilder implements IBlockBuilder {
|
||||
|
||||
private BiFunction<Block, Item.Properties, BlockItem> itemFactory;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private BlockRendering blockRendering;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private ItemRendering itemRendering;
|
||||
|
||||
BlockDefinitionBuilder(FeatureFactory factory, String id, Supplier<? extends Block> blockSupplier) {
|
||||
@@ -132,7 +132,7 @@ class BlockDefinitionBuilder implements IBlockBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private void customizeForClient(BlockRenderingCustomizer callback) {
|
||||
callback.customize(this.blockRendering, this.itemRendering);
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ package appeng.bootstrap;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.client.render.model.IBakedModel;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.bootstrap.components.BlockColorComponent;
|
||||
@@ -36,26 +36,26 @@ import appeng.client.render.model.AutoRotatingBakedModel;
|
||||
|
||||
class BlockRendering implements IBlockRendering {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private BiFunction<ResourceLocation, IBakedModel, IBakedModel> modelCustomizer;
|
||||
@Environment(EnvType.CLIENT)
|
||||
private BiFunction<Identifier, IBakedModel, IBakedModel> modelCustomizer;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private IBlockColor blockColor;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private RenderType renderType;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private Predicate<RenderType> renderTypes;
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public IBlockRendering modelCustomizer(BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer) {
|
||||
@Environment(EnvType.CLIENT)
|
||||
public IBlockRendering modelCustomizer(BiFunction<Identifier, IBakedModel, IBakedModel> customizer) {
|
||||
this.modelCustomizer = customizer;
|
||||
return this;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public IBlockRendering blockColor(IBlockColor blockColor) {
|
||||
this.blockColor = blockColor;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package appeng.bootstrap;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
/**
|
||||
* A callback that allows the rendering of a block to be customized. Sadly this
|
||||
@@ -28,7 +28,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
*/
|
||||
public abstract class BlockRenderingCustomizer {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public abstract void customize(IBlockRendering rendering, IItemRendering itemRendering);
|
||||
|
||||
}
|
||||
|
||||
@@ -29,16 +29,16 @@ import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.render.model.IBakedModel;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityClassification;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.bootstrap.components.ModelOverrideComponent;
|
||||
@@ -51,7 +51,7 @@ public class FeatureFactory {
|
||||
|
||||
private final Map<Class<? extends IBootstrapComponent>, List<IBootstrapComponent>> bootstrapComponents;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private ModelOverrideComponent modelOverrideComponent;
|
||||
|
||||
public FeatureFactory() {
|
||||
@@ -86,7 +86,7 @@ public class FeatureFactory {
|
||||
}
|
||||
|
||||
public <T extends AEBaseTileEntity> TileEntityBuilder<T> tileEntity(String id, Class<T> teClass,
|
||||
Function<TileEntityType<T>, T> factory) {
|
||||
Function<BlockEntityType<T>, T> factory) {
|
||||
return new TileEntityBuilder<>(this, id, teClass, factory).features(this.defaultFeatures);
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ public class FeatureFactory {
|
||||
this.bootstrapComponents.computeIfAbsent(eventType, c -> new ArrayList<IBootstrapComponent>()).add(component);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
void addModelOverride(String resourcePath, BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer) {
|
||||
@Environment(EnvType.CLIENT)
|
||||
void addModelOverride(String resourcePath, BiFunction<Identifier, IBakedModel, IBakedModel> customizer) {
|
||||
this.modelOverrideComponent.addOverride(resourcePath, customizer);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package appeng.bootstrap;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.client.render.model.IBakedModel;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
/**
|
||||
* Allows for client-side rendering to be customized in the context of
|
||||
@@ -34,16 +34,16 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
*/
|
||||
public interface IBlockRendering {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
IBlockRendering modelCustomizer(BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer);
|
||||
@Environment(EnvType.CLIENT)
|
||||
IBlockRendering modelCustomizer(BiFunction<Identifier, IBakedModel, IBakedModel> customizer);
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
IBlockRendering blockColor(IBlockColor blockColor);
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
IBlockRendering renderType(RenderType type);
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
IBlockRendering renderType(Predicate<RenderType> type);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package appeng.bootstrap;
|
||||
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
/**
|
||||
* Allows the rendering of an item to be customized.
|
||||
@@ -31,7 +31,7 @@ public interface IItemRendering {
|
||||
* Registers a custom item color definition that inspects an item stack and tint
|
||||
* and returns a color multiplier.
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
IItemRendering color(IItemColor itemColor);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ import net.minecraft.block.DispenserBlock;
|
||||
import net.minecraft.dispenser.IDispenseItemBehavior;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.bootstrap.components.IInitComponent;
|
||||
@@ -58,7 +58,7 @@ class ItemDefinitionBuilder implements IItemBuilder {
|
||||
|
||||
private Supplier<IDispenseItemBehavior> dispenserBehaviorSupplier;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private ItemRendering itemRendering;
|
||||
|
||||
private ItemGroup itemGroup = CreativeTab.INSTANCE;
|
||||
@@ -118,7 +118,7 @@ class ItemDefinitionBuilder implements IItemBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private void customizeForClient(ItemRenderingCustomizer callback) {
|
||||
callback.customize(this.itemRendering);
|
||||
}
|
||||
|
||||
@@ -18,20 +18,20 @@
|
||||
|
||||
package appeng.bootstrap;
|
||||
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
||||
import appeng.bootstrap.components.ItemColorComponent;
|
||||
|
||||
class ItemRendering implements IItemRendering {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private IItemColor itemColor;
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public IItemRendering color(IItemColor itemColor) {
|
||||
this.itemColor = itemColor;
|
||||
return this;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package appeng.bootstrap;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
||||
/**
|
||||
* A callback that allows the rendering of a item to be customized. Sadly this
|
||||
@@ -28,6 +28,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
*/
|
||||
public abstract class ItemRenderingCustomizer {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public abstract void customize(IItemRendering rendering);
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ import java.util.function.Supplier;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
|
||||
@@ -42,12 +42,12 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
|
||||
// The tile entity class
|
||||
private final Class<T> tileClass;
|
||||
|
||||
private TileEntityType<T> type;
|
||||
private BlockEntityType<T> type;
|
||||
|
||||
// The factory for creating tile entity objects
|
||||
private final Function<TileEntityType<T>, T> supplier;
|
||||
private final Function<BlockEntityType<T>, T> supplier;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private TileEntityRendering<T> tileEntityRendering;
|
||||
|
||||
private final List<Block> blocks = new ArrayList<>();
|
||||
@@ -55,7 +55,7 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
|
||||
private final EnumSet<AEFeature> features = EnumSet.noneOf(AEFeature.class);
|
||||
|
||||
public TileEntityBuilder(FeatureFactory factory, String registryName, Class<T> tileClass,
|
||||
Function<TileEntityType<T>, T> supplier) {
|
||||
Function<BlockEntityType<T>, T> supplier) {
|
||||
this.factory = factory;
|
||||
this.registryName = registryName;
|
||||
this.tileClass = tileClass;
|
||||
@@ -78,7 +78,7 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
|
||||
}
|
||||
|
||||
public TileEntityBuilder<T> rendering(TileEntityRenderingCustomizer<T> customizer) {
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> customizer.customize(tileEntityRendering));
|
||||
DistExecutor.runWhenOn(EnvType.CLIENT, () -> () -> customizer.customize(tileEntityRendering));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
|
||||
}
|
||||
|
||||
Supplier<T> factory = () -> supplier.apply(type);
|
||||
type = TileEntityType.Builder.create(factory, blocks.toArray(new Block[0])).build(null);
|
||||
type = BlockEntityType.Builder.create(factory, blocks.toArray(new Block[0])).build(null);
|
||||
type.setRegistryName(AppEng.MOD_ID, registryName);
|
||||
registry.register(type);
|
||||
|
||||
@@ -105,13 +105,13 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
|
||||
}
|
||||
|
||||
});
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> this::buildClient);
|
||||
DistExecutor.runWhenOn(EnvType.CLIENT, () -> this::buildClient);
|
||||
|
||||
return new TileEntityDefinition(this::addBlock);
|
||||
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private void buildClient() {
|
||||
this.factory.addBootstrapComponent((IClientSetupComponent) () -> {
|
||||
if (tileEntityRendering.tileEntityRenderer != null) {
|
||||
|
||||
@@ -22,17 +22,17 @@ import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
|
||||
public class TileEntityRendering<T extends AEBaseTileEntity> {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
Function<TileEntityRendererDispatcher, TileEntityRenderer<T>> tileEntityRenderer;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public TileEntityRendering<T> tileEntityRenderer(
|
||||
Function<TileEntityRendererDispatcher, TileEntityRenderer<T>> tileEntityRenderer) {
|
||||
this.tileEntityRenderer = tileEntityRenderer;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package appeng.bootstrap;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
|
||||
@@ -30,7 +30,7 @@ import appeng.tile.AEBaseTileEntity;
|
||||
*/
|
||||
public abstract class TileEntityRenderingCustomizer<T extends AEBaseTileEntity> {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public abstract void customize(TileEntityRendering<T> rendering);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import appeng.bootstrap.IBootstrapComponent;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface IBlockRegistrationComponent extends IBootstrapComponent {
|
||||
void blockRegistration(Dist dist, IForgeRegistry<Block> blockRegistry);
|
||||
void blockRegistration(EnvType dist, IForgeRegistry<Block> blockRegistry);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import appeng.bootstrap.IBootstrapComponent;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface IItemRegistrationComponent extends IBootstrapComponent {
|
||||
void itemRegistration(Dist dist, IForgeRegistry<Item> itemRegistry);
|
||||
void itemRegistration(EnvType dist, IForgeRegistry<Item> itemRegistry);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import appeng.bootstrap.IBootstrapComponent;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface IRecipeRegistrationComponent extends IBootstrapComponent {
|
||||
void recipeRegistration(Dist dist, IForgeRegistry<IRecipeSerializer<?>> recipeRegistry);
|
||||
void recipeRegistration(EnvType dist, IForgeRegistry<IRecipeSerializer<?>> recipeRegistry);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import appeng.bootstrap.IBootstrapComponent;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ITileEntityRegistrationComponent extends IBootstrapComponent {
|
||||
void register(IForgeRegistry<TileEntityType<?>> registry);
|
||||
void register(IForgeRegistry<BlockEntityType<?>> registry);
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ import java.util.function.BiFunction;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ModelBakery;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.client.render.model.IBakedModel;
|
||||
import net.minecraft.client.render.model.ModelBakery;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
@@ -35,19 +35,19 @@ import appeng.core.AppEng;
|
||||
public class ModelOverrideComponent implements IModelBakeComponent {
|
||||
|
||||
// Maps from resource path to customizer
|
||||
private final Map<String, BiFunction<ResourceLocation, IBakedModel, IBakedModel>> customizer = new HashMap<>();
|
||||
private final Map<String, BiFunction<Identifier, IBakedModel, IBakedModel>> customizer = new HashMap<>();
|
||||
|
||||
public void addOverride(String resourcePath, BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer) {
|
||||
public void addOverride(String resourcePath, BiFunction<Identifier, IBakedModel, IBakedModel> customizer) {
|
||||
this.customizer.put(resourcePath, customizer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onModelBakeEvent(final ModelBakeEvent event) {
|
||||
Map<ResourceLocation, IBakedModel> modelRegistry = event.getModelRegistry();
|
||||
Set<ResourceLocation> keys = Sets.newHashSet(modelRegistry.keySet());
|
||||
Map<Identifier, IBakedModel> modelRegistry = event.getModelRegistry();
|
||||
Set<Identifier> keys = Sets.newHashSet(modelRegistry.keySet());
|
||||
IBakedModel missingModel = modelRegistry.get(ModelBakery.MODEL_MISSING);
|
||||
|
||||
for (ResourceLocation location : keys) {
|
||||
for (Identifier location : keys) {
|
||||
if (!location.getNamespace().equals(AppEng.MOD_ID)) {
|
||||
continue;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class ModelOverrideComponent implements IModelBakeComponent {
|
||||
continue;
|
||||
}
|
||||
|
||||
BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer = this.customizer.get(location.getPath());
|
||||
BiFunction<Identifier, IBakedModel, IBakedModel> customizer = this.customizer.get(location.getPath());
|
||||
if (customizer != null) {
|
||||
IBakedModel newModel = customizer.apply(location, orgModel);
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ package appeng.capabilities;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
|
||||
import appeng.api.storage.ISpatialDimension;
|
||||
|
||||
@@ -48,7 +48,7 @@ class NullSpatialDimension implements ISpatialDimension {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCellDimensionTooltip(DimensionType cellDim, List<ITextComponent> tooltip) {
|
||||
public void addCellDimensionTooltip(DimensionType cellDim, List<Text> tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,9 +27,9 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.InputEvent;
|
||||
@@ -74,7 +74,7 @@ public class ClientHelper extends ServerHelper {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindTileEntitySpecialRenderer(final Class<? extends TileEntity> tile, final AEBaseBlock blk) {
|
||||
public void bindTileEntitySpecialRenderer(final Class<? extends BlockEntity> tile, final AEBaseBlock blk) {
|
||||
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ClientHelper extends ServerHelper {
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult getRTR() {
|
||||
public HitResult getRTR() {
|
||||
return Minecraft.getInstance().objectMouseOver;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Locale;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -36,7 +36,7 @@ import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseScreen<T> {
|
||||
|
||||
public AEBaseMEScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public AEBaseMEScreen(T container, PlayerInventory playerInventory, Text title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ import net.minecraft.inventory.container.ClickType;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
@@ -100,7 +100,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
private Slot bl_clicked;
|
||||
protected final List<CustomSlotWidget> guiSlots = new ArrayList<>();
|
||||
|
||||
public AEBaseScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public AEBaseScreen(T container, PlayerInventory playerInventory, Text title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
}
|
||||
|
||||
public void bindTexture(final String base, final String file) {
|
||||
final ResourceLocation loc = new ResourceLocation(base, "textures/" + file);
|
||||
final Identifier loc = new Identifier(base, "textures/" + file);
|
||||
getMinecraft().getTextureManager().bindTexture(loc);
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
final Fluid fluid = fs.getFluid();
|
||||
FluidAttributes fluidAttributes = fluid.getAttributes();
|
||||
bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
|
||||
ResourceLocation fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack());
|
||||
Identifier fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack());
|
||||
final TextureAtlasSprite sprite = getMinecraft()
|
||||
.getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStillTexture);
|
||||
|
||||
@@ -762,11 +762,11 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
}
|
||||
|
||||
public void bindTexture(final String file) {
|
||||
final ResourceLocation loc = new ResourceLocation(AppEng.MOD_ID, "textures/" + file);
|
||||
final Identifier loc = new Identifier(AppEng.MOD_ID, "textures/" + file);
|
||||
getMinecraft().getTextureManager().bindTexture(loc);
|
||||
}
|
||||
|
||||
public void bindTexture(final ResourceLocation loc) {
|
||||
public void bindTexture(final Identifier loc) {
|
||||
getMinecraft().getTextureManager().bindTexture(loc);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ class Size1Slot extends SlotItemHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public boolean isEnabled() {
|
||||
return this.delegate.isEnabled();
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.CopyMode;
|
||||
@@ -43,7 +43,7 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
|
||||
private ToggleButton copyMode;
|
||||
|
||||
public CellWorkbenchScreen(CellWorkbenchContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
Text title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
|
||||
this.copyMode.setState(this.container.getCopyMode() == CopyMode.CLEAR_ON_REMOVE);
|
||||
|
||||
boolean hasFuzzy = false;
|
||||
final IItemHandler inv = this.container.getCellUpgradeInventory();
|
||||
final ItemTransferable inv = this.container.getCellUpgradeInventory();
|
||||
for (int x = 0; x < inv.getSlots(); x++) {
|
||||
final ItemStack is = inv.getStackInSlot(x);
|
||||
if (!is.isEmpty() && is.getItem() instanceof IUpgradeModule) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
@@ -32,7 +32,7 @@ import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class ChestScreen extends AEBaseScreen<ChestContainer> {
|
||||
|
||||
public ChestScreen(ChestContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public ChestScreen(ChestContainer container, PlayerInventory playerInventory, Text title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.api.config.CondenserOutput;
|
||||
@@ -36,7 +36,7 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
|
||||
|
||||
private SettingToggleButton<CondenserOutput> mode;
|
||||
|
||||
public CondenserScreen(CondenserContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CondenserScreen(CondenserContainer container, PlayerInventory playerInventory, Text title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 197;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.client.gui.implementations;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
@@ -39,7 +39,7 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
|
||||
|
||||
private Button next;
|
||||
|
||||
public CraftAmountScreen(CraftAmountContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftAmountScreen(CraftAmountContainer container, PlayerInventory playerInventory, Text title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubScreen(this, container.getTarget());
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -64,7 +64,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
private Button selectCPU;
|
||||
private int tooltip = -1;
|
||||
|
||||
public CraftConfirmScreen(CraftConfirmContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftConfirmScreen(CraftConfirmContainer container, PlayerInventory playerInventory, Text title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubScreen(this, container.getTarget());
|
||||
this.xSize = 238;
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -90,7 +90,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
|
||||
private Button cancel;
|
||||
private int tooltip = -1;
|
||||
|
||||
public CraftingCPUScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftingCPUScreen(T container, PlayerInventory playerInventory, Text title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = GUI_HEIGHT;
|
||||
this.xSize = GUI_WIDTH;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user