From a5af359e7c1da0fc22fcb6482aa6b466c615f98a Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Fri, 17 May 2024 01:19:54 +0800 Subject: [PATCH 1/7] 1.16.5 --- api/buildcraft/api/BCBlocks.java | 18 +- api/buildcraft/api/BCItems.java | 33 +-- api/buildcraft/api/BCModules.java | 27 +- api/buildcraft/api/blocks/BlockConstants.java | 15 ++ .../api/blocks/CustomPaintHelper.java | 76 ++++-- .../api/blocks/CustomRotationHelper.java | 29 +-- .../api/blocks/ICustomPaintHandler.java | 18 +- .../api/blocks/ICustomRotationHandler.java | 8 +- api/buildcraft/api/blocks/ISpring.java | 7 + api/buildcraft/api/blocks/package-info.java | 4 +- .../api/boards/RedstoneBoardNBT.java | 25 +- .../api/boards/RedstoneBoardRegistry.java | 8 +- .../api/boards/RedstoneBoardRobotNBT.java | 7 +- api/buildcraft/api/boards/package-info.java | 4 +- api/buildcraft/api/core/AreaProviders.java | 6 +- api/buildcraft/api/core/BCDebugging.java | 14 +- api/buildcraft/api/core/BCLog.java | 3 +- api/buildcraft/api/core/BuildCraftAPI.java | 25 +- .../api/core/CapabilitiesHelper.java | 41 ++- api/buildcraft/api/core/EnumColor.java | 147 ----------- api/buildcraft/api/core/EnumPipePart.java | 62 ++--- api/buildcraft/api/core/EnumWireColour.java | 45 ++-- api/buildcraft/api/core/IBox.java | 2 +- api/buildcraft/api/core/IEngineType.java | 1 + .../api/core/IFakePlayerProvider.java | 20 +- api/buildcraft/api/core/IFakeWorld.java | 15 ++ api/buildcraft/api/core/IFluidFilter.java | 1 - api/buildcraft/api/core/IFluidHandlerAdv.java | 6 +- api/buildcraft/api/core/IPathProvider.java | 5 +- api/buildcraft/api/core/IStackFilter.java | 10 +- api/buildcraft/api/core/IZone.java | 12 +- .../api/core/InvalidInputDataException.java | 4 +- api/buildcraft/api/core/SafeTimeTracker.java | 4 +- api/buildcraft/api/core/StackKey.java | 43 ++-- api/buildcraft/api/core/package-info.java | 4 +- api/buildcraft/api/crops/CropManager.java | 19 +- api/buildcraft/api/crops/ICropHandler.java | 10 +- api/buildcraft/api/crops/package-info.java | 4 +- .../api/data/NbtSquishConstants.java | 15 +- .../api/enums/EnumDecoratedBlock.java | 6 +- api/buildcraft/api/enums/EnumEngineType.java | 23 +- .../api/enums/EnumLaserTableType.java | 2 +- .../api/enums/EnumMachineState.java | 9 +- .../api/enums/EnumOptionalSnapshotType.java | 6 +- api/buildcraft/api/enums/EnumPowerStage.java | 6 +- .../api/enums/EnumRedstoneChipset.java | 39 ++- api/buildcraft/api/enums/EnumSpring.java | 30 ++- api/buildcraft/api/enums/package-info.java | 4 +- .../api/events/BlockInteractionEvent.java | 15 +- .../api/events/BlockPlacedDownEvent.java | 15 +- .../api/events/PipePlacedEvent.java | 9 +- api/buildcraft/api/events/RobotEvent.java | 22 +- .../api/events/RobotPlacementEvent.java | 12 +- api/buildcraft/api/events/package-info.java | 4 +- api/buildcraft/api/facades/FacadeAPI.java | 32 ++- api/buildcraft/api/facades/IFacade.java | 4 + api/buildcraft/api/facades/IFacadeItem.java | 10 +- .../api/facades/IFacadePhasedState.java | 6 +- .../api/facades/IFacadeRegistry.java | 7 +- api/buildcraft/api/facades/IFacadeState.java | 4 +- api/buildcraft/api/facades/package-info.java | 4 +- .../api/filler/IFilledTemplate.java | 4 +- api/buildcraft/api/filler/IFillerPattern.java | 7 +- .../api/filler/IFillerPatternShape.java | 11 +- .../api/filler/IFillerRegistry.java | 8 +- api/buildcraft/api/filler/package-info.java | 6 +- .../api/fuels/BuildcraftFuelRegistry.java | 3 +- api/buildcraft/api/fuels/EnumCoolantType.java | 17 ++ api/buildcraft/api/fuels/ICoolant.java | 54 +++- api/buildcraft/api/fuels/ICoolantManager.java | 46 ++-- api/buildcraft/api/fuels/IFluidCoolant.java | 24 ++ api/buildcraft/api/fuels/IFuel.java | 50 +++- api/buildcraft/api/fuels/IFuelManager.java | 39 ++- api/buildcraft/api/fuels/ISolidCoolant.java | 11 +- api/buildcraft/api/fuels/package-info.java | 4 +- api/buildcraft/api/gates/IGate.java | 4 +- api/buildcraft/api/gates/package-info.java | 4 +- api/buildcraft/api/imc/BcImcMessage.java | 32 +++ .../api/inventory/IItemHandlerFiltered.java | 1 - .../api/inventory/IItemTransactor.java | 11 +- api/buildcraft/api/items/FluidItemDrops.java | 9 +- api/buildcraft/api/items/IChipset.java | 7 + .../api/items/IItemCustomPipeRender.java | 7 +- api/buildcraft/api/items/IItemFluidShard.java | 5 +- api/buildcraft/api/items/IList.java | 4 +- api/buildcraft/api/items/IMapLocation.java | 28 +- api/buildcraft/api/items/INamedItem.java | 7 +- api/buildcraft/api/items/package-info.java | 4 +- .../api/library/ILibraryTypeHandler.java | 18 -- api/buildcraft/api/library/LibraryAPI.java | 30 --- .../api/library/LibraryTypeHandler.java | 31 --- .../library/LibraryTypeHandlerByteArray.java | 13 - .../api/library/LibraryTypeHandlerNBT.java | 14 - api/buildcraft/api/library/package-info.java | 8 - .../api/lists/ListMatchHandler.java | 8 +- api/buildcraft/api/lists/ListRegistry.java | 4 +- api/buildcraft/api/lists/package-info.java | 4 +- api/buildcraft/api/mj/ILaserTarget.java | 1 + api/buildcraft/api/mj/IMjConnector.java | 4 +- api/buildcraft/api/mj/IMjEffectManager.java | 10 +- api/buildcraft/api/mj/IMjPassiveProvider.java | 2 +- api/buildcraft/api/mj/IMjReceiver.java | 6 +- .../api/mj/IMjRedstoneReceiver.java | 3 +- api/buildcraft/api/mj/MjAPI.java | 36 +-- api/buildcraft/api/mj/MjBattery.java | 28 +- api/buildcraft/api/mj/MjCapabilityHelper.java | 37 +-- api/buildcraft/api/net/IMessage.java | 21 ++ api/buildcraft/api/net/IMessageHandler.java | 7 + api/buildcraft/api/power/IEngine.java | 8 +- api/buildcraft/api/power/IRedstoneEngine.java | 3 +- api/buildcraft/api/power/package-info.java | 4 +- .../api/properties/BuildCraftProperties.java | 89 +++---- .../api/recipes/AssemblyRecipeBasic.java | 67 ----- .../api/recipes/BuildcraftRecipeRegistry.java | 3 +- .../api/recipes/EnumAssemblyRecipeType.java | 6 + ...semblyRecipe.java => IAssemblyRecipe.java} | 70 +++-- .../recipes/IIntegrationRecipeProvider.java | 8 +- .../api/recipes/IRefineryRecipeManager.java | 95 +++++-- .../api/recipes/IngredientStack.java | 32 ++- .../api/recipes/IntegrationRecipe.java | 11 +- api/buildcraft/api/recipes/package-info.java | 4 +- .../api/registry/EventBuildCraftReload.java | 17 +- .../api/registry/IReloadableRegistry.java | 4 +- .../registry/IReloadableRegistryManager.java | 8 +- .../api/registry/IScriptableRegistry.java | 20 +- api/buildcraft/api/robots/AIRobot.java | 39 ++- api/buildcraft/api/robots/DockingStation.java | 49 ++-- .../api/robots/EntityRobotBase.java | 23 +- .../api/robots/IRobotOverlayItem.java | 7 +- api/buildcraft/api/robots/IRobotRegistry.java | 14 +- api/buildcraft/api/robots/ResourceId.java | 16 +- .../api/robots/ResourceIdBlock.java | 20 +- .../api/robots/ResourceIdRequest.java | 14 +- api/buildcraft/api/robots/RobotManager.java | 4 +- api/buildcraft/api/robots/package-info.java | 4 +- .../api/schematics/ISchematicBlock.java | 23 +- .../api/schematics/ISchematicEntity.java | 21 +- .../api/schematics/SchematicBlockContext.java | 10 +- .../api/schematics/SchematicBlockFactory.java | 7 +- .../SchematicBlockFactoryRegistry.java | 75 +++--- .../schematics/SchematicEntityContext.java | 4 +- .../schematics/SchematicEntityFactory.java | 7 +- .../SchematicEntityFactoryRegistry.java | 47 ++-- api/buildcraft/api/statements/IAction.java | 3 +- .../api/statements/IActionExternal.java | 4 +- .../api/statements/IActionInternalSided.java | 4 +- .../api/statements/IActionProvider.java | 11 +- api/buildcraft/api/statements/IGuiSlot.java | 46 ++-- api/buildcraft/api/statements/IStatement.java | 2 +- .../api/statements/IStatementContainer.java | 8 +- .../api/statements/IStatementParameter.java | 23 +- api/buildcraft/api/statements/ITrigger.java | 3 +- .../api/statements/ITriggerExternal.java | 4 +- .../statements/ITriggerExternalOverride.java | 4 +- .../api/statements/ITriggerInternalSided.java | 4 +- .../api/statements/ITriggerProvider.java | 11 +- .../api/statements/StatementManager.java | 33 +-- .../StatementParameterItemStack.java | 79 +++--- .../api/statements/StatementSlot.java | 4 +- .../containers/IFillerStatementContainer.java | 9 +- .../IRedstoneStatementContainer.java | 10 +- .../containers/ISidedStatementContainer.java | 5 +- .../api/statements/package-info.java | 4 +- .../api/template/ITemplateHandler.java | 4 +- .../api/template/ITemplateRegistry.java | 7 +- .../api/tiles/IBCTileMenuProvider.java | 9 + api/buildcraft/api/tiles/IDebuggable.java | 25 +- api/buildcraft/api/tiles/IHasWork.java | 2 +- api/buildcraft/api/tiles/IHeatable.java | 2 +- api/buildcraft/api/tiles/ITickable.java | 46 ++++ .../api/tiles/ITileAreaProvider.java | 3 +- api/buildcraft/api/tiles/TilesAPI.java | 16 +- api/buildcraft/api/tiles/package-info.java | 4 +- api/buildcraft/api/tools/IToolWrench.java | 8 +- api/buildcraft/api/tools/package-info.java | 4 +- .../api/transport/EnumWirePart.java | 43 ++-- api/buildcraft/api/transport/IInjectable.java | 13 +- .../api/transport/IItemPluggable.java | 20 +- .../api/transport/IStripesActivator.java | 10 +- .../api/transport/IStripesHandlerBlock.java | 6 +- .../api/transport/IStripesHandlerItem.java | 14 +- .../api/transport/IStripesRegistry.java | 15 +- .../api/transport/IWireEmitter.java | 6 +- .../api/transport/IWireManager.java | 13 +- api/buildcraft/api/transport/WireNode.java | 26 +- .../api/transport/package-info.java | 4 +- .../transport/pipe/ICustomPipeConnection.java | 8 +- .../api/transport/pipe/IFlowFluid.java | 55 ++-- .../api/transport/pipe/IFlowItems.java | 25 +- .../api/transport/pipe/IFlowPower.java | 7 +- .../api/transport/pipe/IItemPipe.java | 7 + api/buildcraft/api/transport/pipe/IPipe.java | 17 +- .../transport/pipe/IPipeBehaviourBaker.java | 4 +- .../pipe/IPipeBehaviourRenderer.java | 14 +- .../api/transport/pipe/IPipeConnection.java | 4 +- .../transport/pipe/IPipeExtensionManager.java | 7 +- .../api/transport/pipe/IPipeFlowBaker.java | 4 +- .../api/transport/pipe/IPipeFlowRenderer.java | 9 +- .../api/transport/pipe/IPipeHolder.java | 58 +++-- .../api/transport/pipe/IPipeRegistry.java | 36 +-- .../api/transport/pipe/PipeApi.java | 27 +- .../api/transport/pipe/PipeApiClient.java | 13 +- .../api/transport/pipe/PipeBehaviour.java | 72 +++--- .../api/transport/pipe/PipeConnectionAPI.java | 7 +- .../api/transport/pipe/PipeDefinition.java | 36 ++- .../pipe/PipeEventConnectionChange.java | 8 +- .../api/transport/pipe/PipeEventFluid.java | 71 +++--- .../api/transport/pipe/PipeEventHandler.java | 10 +- .../api/transport/pipe/PipeEventItem.java | 148 ++++++----- .../api/transport/pipe/PipeEventPower.java | 11 +- .../transport/pipe/PipeEventStatement.java | 18 +- .../transport/pipe/PipeEventTileState.java | 6 +- .../api/transport/pipe/PipeFaceTex.java | 2 +- .../api/transport/pipe/PipeFlow.java | 68 ++--- .../api/transport/pipe/PipeFlowType.java | 4 +- .../pluggable/IPlugDynamicRenderer.java | 7 +- .../pluggable/IPluggableStaticBaker.java | 11 +- .../transport/pluggable/PipePluggable.java | 103 ++++---- .../pluggable/PluggableDefinition.java | 31 +-- .../pluggable/PluggableModelKey.java | 14 +- build.gradle | 240 +++++++++++++----- build.properties | 7 +- gradle/wrapper/gradle-wrapper.jar | Bin 52271 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 117 +++++---- gradlew.bat | 53 ++-- 226 files changed, 2379 insertions(+), 2126 deletions(-) create mode 100644 api/buildcraft/api/blocks/BlockConstants.java create mode 100644 api/buildcraft/api/blocks/ISpring.java delete mode 100644 api/buildcraft/api/core/EnumColor.java create mode 100644 api/buildcraft/api/core/IFakeWorld.java create mode 100644 api/buildcraft/api/fuels/EnumCoolantType.java create mode 100644 api/buildcraft/api/fuels/IFluidCoolant.java create mode 100644 api/buildcraft/api/imc/BcImcMessage.java create mode 100644 api/buildcraft/api/items/IChipset.java delete mode 100644 api/buildcraft/api/library/ILibraryTypeHandler.java delete mode 100644 api/buildcraft/api/library/LibraryAPI.java delete mode 100644 api/buildcraft/api/library/LibraryTypeHandler.java delete mode 100644 api/buildcraft/api/library/LibraryTypeHandlerByteArray.java delete mode 100644 api/buildcraft/api/library/LibraryTypeHandlerNBT.java delete mode 100644 api/buildcraft/api/library/package-info.java create mode 100644 api/buildcraft/api/net/IMessage.java create mode 100644 api/buildcraft/api/net/IMessageHandler.java delete mode 100644 api/buildcraft/api/recipes/AssemblyRecipeBasic.java create mode 100644 api/buildcraft/api/recipes/EnumAssemblyRecipeType.java rename api/buildcraft/api/recipes/{AssemblyRecipe.java => IAssemblyRecipe.java} (52%) create mode 100644 api/buildcraft/api/tiles/IBCTileMenuProvider.java create mode 100644 api/buildcraft/api/tiles/ITickable.java diff --git a/api/buildcraft/api/BCBlocks.java b/api/buildcraft/api/BCBlocks.java index 693aa4e..905afe6 100644 --- a/api/buildcraft/api/BCBlocks.java +++ b/api/buildcraft/api/BCBlocks.java @@ -1,16 +1,24 @@ package buildcraft.api; import net.minecraft.block.Block; - -import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder; +import net.minecraftforge.registries.ObjectHolder; public class BCBlocks { @ObjectHolder("buildcraftcore") public static class Core { - public static final Block SPRING = null; - public static final Block DECORATED = null; - public static final Block ENGINE = null; + public static final Block SPRING_WATER = null; + public static final Block SPRING_OIL = null; + public static final Block DECORATED_DESTROY = null; + public static final Block DECORATED_BLUEPRINT = null; + public static final Block DECORATED_TEMPLATE = null; + public static final Block DECORATED_PAPER = null; + public static final Block DECORATED_LEATHER = null; + public static final Block DECORATED_LASER_BACK = null; + public static final Block ENGINE_WOOD = null; + public static final Block ENGINE_STONE = null; + public static final Block ENGINE_IRON = null; + public static final Block ENGINE_CREATIVE = null; public static final Block MARKER_VOLUME = null; public static final Block MARKER_PATH = null; } diff --git a/api/buildcraft/api/BCItems.java b/api/buildcraft/api/BCItems.java index 01f5446..38cd0bd 100644 --- a/api/buildcraft/api/BCItems.java +++ b/api/buildcraft/api/BCItems.java @@ -1,10 +1,8 @@ package buildcraft.api; -import net.minecraft.item.Item; - -import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder; - import buildcraft.api.items.FluidItemDrops; +import net.minecraft.item.Item; +import net.minecraftforge.registries.ObjectHolder; public class BCItems { @@ -23,7 +21,7 @@ public static class Core { public static final Item GEAR_GOLD = null; public static final Item GEAR_DIAMOND = null; public static final Item WRENCH = null; - public static final Item PAINTBRUSH = null; + public static final Item PAINTBRUSH_CLEAN = null; public static final Item LIST = null; public static final Item MAP_LOCATION = null; public static final Item MARKER_CONNECTOR = null; @@ -42,14 +40,14 @@ public static class Builders { @ObjectHolder("buildcraftenergy") public static class Energy { - public static final Item GLOB_OF_OIL = null; + public static final Item GLOB_OIL = null; } @ObjectHolder("buildcraftfactory") public static class Factory { public static final Item PLASTIC_SHEET = null; - public static final Item WATER_GEL = null; - public static final Item GELLED_WATER = null; + public static final Item WATER_GEL_SPAWN = null; + public static final Item GEL = null; } @ObjectHolder("buildcrafttransport") @@ -57,19 +55,24 @@ public static class Transport { public static final Item PLUG_BLOCKER = null; public static final Item PLUG_POWER_ADAPTOR = null; - public static final Item PIPE_STRUCTURE = null; - public static final Item PIPE_WOOD_ITEM = null; - public static final Item PIPE_EMZULI_ITEM = null; - public static final Item PIPE_DIAMOND_WOOD_ITEM = null; - public static final Item PIPE_WOOD_FLUID = null; - public static final Item PIPE_DIAMOND_WOOD_FLUID = null; + public static final Item PIPE_STRUCTURE_COBBLESTONE_COLORLESS = null; + public static final Item PIPE_ITEMS_WOOD_COLORLESS = null; + public static final Item PIPE_ITEMS_EMZULI_COLORLESS = null; + public static final Item PIPE_ITEMS_DIAMOND_WOOD_COLORLESS = null; + public static final Item PIPE_FLUIDS_WOOD_COLORLESS = null; + public static final Item PIPE_FLUIDS_DIAMOND_WOOD_COLORLESS = null; } @ObjectHolder("buildcraftsilicon") public static class Silicon { - public static final Item REDSTONE_CHIPSET = null; + public static final Item CHIPSET_REDSTONE = null; + public static final Item CHIPSET_IRON = null; + public static final Item CHIPSET_GOLD = null; + public static final Item CHIPSET_QUARTZ = null; + public static final Item CHIPSET_DIAMOND = null; public static final Item PLUG_PULSAR = null; + public static final Item PLUG_FACADE = null; } @ObjectHolder("buildcraftrobotics") diff --git a/api/buildcraft/api/BCModules.java b/api/buildcraft/api/BCModules.java index bb9cf30..2cb78f6 100644 --- a/api/buildcraft/api/BCModules.java +++ b/api/buildcraft/api/BCModules.java @@ -1,17 +1,16 @@ package buildcraft.api; +import net.minecraft.client.renderer.model.ModelResourceLocation; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.fml.ModLoadingContext; +import net.minecraftforge.fml.ModLoadingStage; + +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Locale; -import javax.annotation.Nullable; - -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.util.ResourceLocation; - -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.LoaderState; - public enum BCModules implements IBuildCraftMod { LIB, // Base module for all BC. @@ -30,10 +29,14 @@ public enum BCModules implements IBuildCraftMod { private static boolean hasChecked = false; private static BCModules[] loadedModules, missingModules; + // Calen + public static final String BUILDCRAFT = "buildcraft"; + public final String lowerCaseName = name().toLowerCase(Locale.ROOT); // Bit hacky, but it works as this is all english public final String camelCaseName = name().charAt(0) + lowerCaseName.substring(1); - private final String modId = "buildcraft" + lowerCaseName; + // private final String modId = "buildcraft" + lowerCaseName; + private final String modId = BUILDCRAFT + lowerCaseName; private boolean loaded; private static void checkLoadStatus() { @@ -48,12 +51,14 @@ private static synchronized void load0() { if (hasChecked) { return; } - if (!Loader.instance().hasReachedState(LoaderState.PREINITIALIZATION)) { +// if (!Loader.instance().hasReachedState(LoaderState.PREINITIALIZATION)) + if (ModLoadingContext.get().getActiveContainer().getCurrentState().ordinal() < ModLoadingStage.CONSTRUCT.ordinal()) { throw new RuntimeException("You can only use BCModules.isLoaded from pre-init onwards!"); } List found = new ArrayList<>(), missing = new ArrayList<>(); for (BCModules module : VALUES) { - module.loaded = Loader.isModLoaded(module.modId); + module.loaded = ModList.get().isLoaded(module.modId); + if (module.loaded) { found.add(module); } else { diff --git a/api/buildcraft/api/blocks/BlockConstants.java b/api/buildcraft/api/blocks/BlockConstants.java new file mode 100644 index 0000000..e44a77c --- /dev/null +++ b/api/buildcraft/api/blocks/BlockConstants.java @@ -0,0 +1,15 @@ +package buildcraft.api.blocks; + +public class BlockConstants { + public static final int UPDATE_NEIGHBORS = 1; + public static final int UPDATE_CLIENTS = 2; + public static final int UPDATE_INVISIBLE = 4; + public static final int UPDATE_IMMEDIATE = 8; + public static final int UPDATE_KNOWN_SHAPE = 16; + public static final int UPDATE_SUPPRESS_DROPS = 32; + public static final int UPDATE_MOVE_BY_PISTON = 64; + public static final int UPDATE_SUPPRESS_LIGHT = 128; + public static final int UPDATE_NONE = 4; + public static final int UPDATE_ALL = 3; + public static final int UPDATE_ALL_IMMEDIATE = 11; +} diff --git a/api/buildcraft/api/blocks/CustomPaintHelper.java b/api/buildcraft/api/blocks/CustomPaintHelper.java index 2517af2..16bae67 100644 --- a/api/buildcraft/api/blocks/CustomPaintHelper.java +++ b/api/buildcraft/api/blocks/CustomPaintHelper.java @@ -1,24 +1,23 @@ package buildcraft.api.blocks; -import java.util.List; -import java.util.Map; - -import javax.annotation.Nullable; - +import buildcraft.api.core.BCDebugging; +import buildcraft.api.core.BCLog; import com.google.common.collect.Lists; import com.google.common.collect.Maps; - import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; +import net.minecraft.block.BlockState; +import net.minecraft.item.DyeColor; +import net.minecraft.state.Property; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; +import net.minecraftforge.registries.ForgeRegistries; -import buildcraft.api.core.BCDebugging; -import buildcraft.api.core.BCLog; +import javax.annotation.Nullable; +import java.util.List; +import java.util.Map; /** Provides a simple way to paint a single block, iterating through all {@link ICustomPaintHandler}'s that are * registered for the block. */ @@ -43,7 +42,8 @@ public void registerHandlerForAll(ICustomPaintHandler handler) { /** Register's a paint handler for every class of a given block. */ public void registerHandlerForAll(Class blockClass, ICustomPaintHandler handler) { - for (Block block : Block.REGISTRY) { +// for (Block block : Block.REGISTRY) + for (Block block : ForgeRegistries.BLOCKS.getValues()) { Class foundClass = block.getClass(); if (blockClass.isAssignableFrom(foundClass)) { if (DEBUG) { @@ -77,7 +77,7 @@ private boolean registerHandlerInternal(Block block, ICustomPaintHandler handler } /** Attempts to paint a block at the given position. Basically iterates through all registered paint handlers. */ - public EnumActionResult attemptPaintBlock(World world, BlockPos pos, IBlockState state, Vec3d hitPos, @Nullable EnumFacing hitSide, @Nullable EnumDyeColor paint) { + public ActionResultType attemptPaintBlock(World world, BlockPos pos, BlockState state, Vector3d hitPos, @Nullable Direction hitSide, @Nullable DyeColor paint) { Block block = state.getBlock(); if (block instanceof ICustomPaintHandler) { return ((ICustomPaintHandler) block).attemptPaint(world, pos, state, hitPos, hitSide, paint); @@ -87,29 +87,55 @@ public EnumActionResult attemptPaintBlock(World world, BlockPos pos, IBlockState return defaultAttemptPaint(world, pos, state, hitPos, hitSide, paint); } for (ICustomPaintHandler handler : custom) { - EnumActionResult result = handler.attemptPaint(world, pos, state, hitPos, hitSide, paint); - if (result != EnumActionResult.PASS) { + ActionResultType result = handler.attemptPaint(world, pos, state, hitPos, hitSide, paint); + if (result != ActionResultType.PASS) { return result; } } return defaultAttemptPaint(world, pos, state, hitPos, hitSide, paint); } - private EnumActionResult defaultAttemptPaint(World world, BlockPos pos, IBlockState state, Vec3d hitPos, EnumFacing hitSide, @Nullable EnumDyeColor paint) { + private ActionResultType defaultAttemptPaint(World world, BlockPos pos, BlockState state, Vector3d hitPos, Direction hitSide, @Nullable DyeColor paint) { for (ICustomPaintHandler handler : allHandlers) { - EnumActionResult result = handler.attemptPaint(world, pos, state, hitPos, hitSide, paint); - if (result != EnumActionResult.PASS) { + ActionResultType result = handler.attemptPaint(world, pos, state, hitPos, hitSide, paint); + if (result != ActionResultType.PASS) { return result; } } if (paint == null) { - return EnumActionResult.FAIL; + return ActionResultType.FAIL; } - Block b = state.getBlock(); - if (b.recolorBlock(world, pos, hitSide, paint)) { - return EnumActionResult.SUCCESS; +// Block b = state.getBlock(); +// if (b.recolorBlock(world, pos, hitSide, paint)) + if (recolorBlock(world, pos, hitSide, paint)) { + return ActionResultType.SUCCESS; } else { - return EnumActionResult.FAIL; + return ActionResultType.FAIL; + } + } + + /** + * From 1.12.2 Block + * Common way to recolor a block with an external tool + * + * @param world The world + * @param pos Block position in world + * @param side The side hit with the coloring tool + * @param color The color to change to + * @return If the recoloring was successful + */ + @SuppressWarnings({ "unchecked", "rawtypes" }) + public static boolean recolorBlock(World world, BlockPos pos, Direction side, DyeColor color) { + BlockState state = world.getBlockState(pos); + for (Property prop : state.getProperties()) { + if (prop.getName().equals("color") && prop.getValueClass() == DyeColor.class) { + DyeColor current = (DyeColor) state.getValue(prop); + if (current != color && prop.getPossibleValues().contains(color)) { + world.setBlock(pos, state.setValue(prop, color), BlockConstants.UPDATE_ALL); + return true; + } + } } + return false; } } diff --git a/api/buildcraft/api/blocks/CustomRotationHelper.java b/api/buildcraft/api/blocks/CustomRotationHelper.java index 235c0de..22733cb 100644 --- a/api/buildcraft/api/blocks/CustomRotationHelper.java +++ b/api/buildcraft/api/blocks/CustomRotationHelper.java @@ -1,20 +1,19 @@ package buildcraft.api.blocks; -import java.util.List; -import java.util.Map; - +import buildcraft.api.core.BCDebugging; +import buildcraft.api.core.BCLog; import com.google.common.collect.Lists; import com.google.common.collect.Maps; - import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; +import net.minecraft.block.BlockState; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.registries.ForgeRegistries; -import buildcraft.api.core.BCDebugging; -import buildcraft.api.core.BCLog; +import java.util.List; +import java.util.Map; public enum CustomRotationHelper { INSTANCE; @@ -26,7 +25,7 @@ public enum CustomRotationHelper { private final Map> handlers = Maps.newIdentityHashMap(); public void registerHandlerForAll(Class blockClass, ICustomRotationHandler handler) { - for (Block block : Block.REGISTRY) { + for (Block block : ForgeRegistries.BLOCKS) { Class foundClass = block.getClass(); if (blockClass.isAssignableFrom(foundClass)) { if (DEBUG) { @@ -59,18 +58,18 @@ private boolean registerHandlerInternal(Block block, ICustomRotationHandler hand } } - public EnumActionResult attemptRotateBlock(World world, BlockPos pos, IBlockState state, EnumFacing sideWrenched) { + public ActionResultType attemptRotateBlock(World world, BlockPos pos, BlockState state, Direction sideWrenched) { Block block = state.getBlock(); if (block instanceof ICustomRotationHandler) { return ((ICustomRotationHandler) block).attemptRotation(world, pos, state, sideWrenched); } - if (!handlers.containsKey(block)) return EnumActionResult.PASS; + if (!handlers.containsKey(block)) return ActionResultType.PASS; for (ICustomRotationHandler handler : handlers.get(block)) { - EnumActionResult result = handler.attemptRotation(world, pos, state, sideWrenched); - if (result != EnumActionResult.PASS) { + ActionResultType result = handler.attemptRotation(world, pos, state, sideWrenched); + if (result != ActionResultType.PASS) { return result; } } - return EnumActionResult.PASS; + return ActionResultType.PASS; } } diff --git a/api/buildcraft/api/blocks/ICustomPaintHandler.java b/api/buildcraft/api/blocks/ICustomPaintHandler.java index fd79c91..ce0aa20 100644 --- a/api/buildcraft/api/blocks/ICustomPaintHandler.java +++ b/api/buildcraft/api/blocks/ICustomPaintHandler.java @@ -1,21 +1,21 @@ package buildcraft.api.blocks; -import javax.annotation.Nullable; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; +import net.minecraft.block.BlockState; +import net.minecraft.item.DyeColor; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; +import javax.annotation.Nullable; + /** Provides a way to paint blocks from any position. You can either implement this on a block, or register an instance * for a block with {@link CustomPaintHelper} */ public interface ICustomPaintHandler { /** Attempts to paint the given block. This can also only paint a specific part of the block (as the hit position is * given). - * + * * @param world The world that the block is contained within. * @param pos The position of the block. * @param state The current state of the block. @@ -27,5 +27,5 @@ public interface ICustomPaintHandler { * @return The result of attempting to paint. SUCCESS means that you changed the block from before to a new value, * FAIL means you COULD have handled the block, but it was already painted to that colour, or PASS if you * have no idea how to handle the block in question. */ - EnumActionResult attemptPaint(World world, BlockPos pos, IBlockState state, Vec3d hitPos, @Nullable EnumFacing hitSide, @Nullable EnumDyeColor paintColour); + ActionResultType attemptPaint(World world, BlockPos pos, BlockState state, Vector3d hitPos, @Nullable Direction hitSide, @Nullable DyeColor paintColour); } diff --git a/api/buildcraft/api/blocks/ICustomRotationHandler.java b/api/buildcraft/api/blocks/ICustomRotationHandler.java index 9076f8f..bdac4f5 100644 --- a/api/buildcraft/api/blocks/ICustomRotationHandler.java +++ b/api/buildcraft/api/blocks/ICustomRotationHandler.java @@ -1,11 +1,11 @@ package buildcraft.api.blocks; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; +import net.minecraft.block.BlockState; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public interface ICustomRotationHandler { - EnumActionResult attemptRotation(World world, BlockPos pos, IBlockState state, EnumFacing sideWrenched); + ActionResultType attemptRotation(World world, BlockPos pos, BlockState state, Direction sideWrenched); } diff --git a/api/buildcraft/api/blocks/ISpring.java b/api/buildcraft/api/blocks/ISpring.java new file mode 100644 index 0000000..27903b6 --- /dev/null +++ b/api/buildcraft/api/blocks/ISpring.java @@ -0,0 +1,7 @@ +package buildcraft.api.blocks; + +import buildcraft.api.enums.EnumSpring; + +public interface ISpring { + EnumSpring getType(); +} diff --git a/api/buildcraft/api/blocks/package-info.java b/api/buildcraft/api/blocks/package-info.java index 47ae1d2..a820019 100644 --- a/api/buildcraft/api/blocks/package-info.java +++ b/api/buildcraft/api/blocks/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.0", owner = "buildcraftapi_core", provides = "buildcraftapi_blocks") +//@API(apiVersion = "1.0", owner = "buildcraftapi_core", provides = "buildcraftapi_blocks") package buildcraft.api.blocks; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/boards/RedstoneBoardNBT.java b/api/buildcraft/api/boards/RedstoneBoardNBT.java index 0ced64a..ea859e7 100755 --- a/api/buildcraft/api/boards/RedstoneBoardNBT.java +++ b/api/buildcraft/api/boards/RedstoneBoardNBT.java @@ -4,38 +4,37 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.boards; -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - +import net.minecraft.nbt.CompoundNBT; import net.minecraftforge.common.util.Constants; +import java.util.List; +import java.util.Random; + public abstract class RedstoneBoardNBT { private static Random rand = new Random(); public abstract String getID(); - public abstract void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced); + public abstract void addInformation(ItemStack stack, PlayerEntity player, List list, boolean advanced); public abstract String getDisplayName(); - public abstract IRedstoneBoard create(NBTTagCompound nbt, T object); + public abstract IRedstoneBoard create(CompoundNBT nbt, T object); public abstract String getItemModelLocation(); - public void createBoard(NBTTagCompound nbt) { - nbt.setString("id", getID()); + public void createBoard(CompoundNBT nbt) { + nbt.putString("id", getID()); } - public int getParameterNumber(NBTTagCompound nbt) { - if (!nbt.hasKey("parameters")) { + public int getParameterNumber(CompoundNBT nbt) { + if (!nbt.contains("parameters")) { return 0; } else { - return nbt.getTagList("parameters", Constants.NBT.TAG_COMPOUND).tagCount(); + return nbt.getList("parameters", Constants.NBT.TAG_COMPOUND).size(); } } diff --git a/api/buildcraft/api/boards/RedstoneBoardRegistry.java b/api/buildcraft/api/boards/RedstoneBoardRegistry.java index edfe79c..769ebba 100755 --- a/api/buildcraft/api/boards/RedstoneBoardRegistry.java +++ b/api/buildcraft/api/boards/RedstoneBoardRegistry.java @@ -4,16 +4,16 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.boards; -import java.util.Collection; +import net.minecraft.nbt.CompoundNBT; -import net.minecraft.nbt.NBTTagCompound; +import java.util.Collection; public abstract class RedstoneBoardRegistry { public static RedstoneBoardRegistry instance; /** Register a redstone board type. - * + * * @param redstoneBoardNBT The RedstoneBoardNBT instance containing the board information. * @param microJoules MJ price of the board, in micro MJ. */ public abstract void registerBoardType(RedstoneBoardNBT redstoneBoardNBT, long microJoules); @@ -22,7 +22,7 @@ public abstract class RedstoneBoardRegistry { public abstract RedstoneBoardRobotNBT getEmptyRobotBoard(); - public abstract RedstoneBoardNBT getRedstoneBoard(NBTTagCompound nbt); + public abstract RedstoneBoardNBT getRedstoneBoard(CompoundNBT nbt); public abstract RedstoneBoardNBT getRedstoneBoard(String id); diff --git a/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java b/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java index 4a4161b..ecd3d2e 100755 --- a/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java +++ b/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java @@ -4,15 +4,14 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.boards; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - import buildcraft.api.robots.EntityRobotBase; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.ResourceLocation; public abstract class RedstoneBoardRobotNBT extends RedstoneBoardNBT { @Override - public RedstoneBoardRobot create(NBTTagCompound nbt, EntityRobotBase robot) { + public RedstoneBoardRobot create(CompoundNBT nbt, EntityRobotBase robot) { return create(robot); } diff --git a/api/buildcraft/api/boards/package-info.java b/api/buildcraft/api/boards/package-info.java index 69405e4..8ee0580 100644 --- a/api/buildcraft/api/boards/package-info.java +++ b/api/buildcraft/api/boards/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.0", owner = "buildcraftapi_core", provides = "buildcraftapi_boards") +//@API(apiVersion = "2.0", owner = "buildcraftapi_core", provides = "buildcraftapi_boards") package buildcraft.api.boards; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/core/AreaProviders.java b/api/buildcraft/api/core/AreaProviders.java index 0ebe02f..e323fb0 100644 --- a/api/buildcraft/api/core/AreaProviders.java +++ b/api/buildcraft/api/core/AreaProviders.java @@ -1,11 +1,11 @@ package buildcraft.api.core; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import java.util.ArrayList; +import java.util.List; + public class AreaProviders { public static final List providers = new ArrayList<>(); diff --git a/api/buildcraft/api/core/BCDebugging.java b/api/buildcraft/api/core/BCDebugging.java index 14e5917..dd5d55c 100644 --- a/api/buildcraft/api/core/BCDebugging.java +++ b/api/buildcraft/api/core/BCDebugging.java @@ -4,17 +4,11 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; -import java.lang.reflect.Method; -import java.util.Locale; - import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.LoaderState; -import net.minecraftforge.fml.common.ModContainer; - -import buildcraft.api.BCModules; +import java.lang.reflect.Method; +import java.util.Locale; /** Provides a way to quickly enable or disable certain debug conditions via VM arguments or whether the client/server * is in a dev environment */ @@ -48,8 +42,8 @@ enum DebugLevel { boolean isDev; try { - Method getTileEntity = World.class.getDeclaredMethod("getTileEntity", BlockPos.class); - BCLog.logger.info("[debugger] Method found: World.getTileEntity = " + getTileEntity); + Method getBlockEntity = World.class.getDeclaredMethod("getBlockEntity", BlockPos.class); + BCLog.logger.info("[debugger] Method found: World.getBlockEntity = " + getBlockEntity); isDev = true; } catch (Throwable ignored) { // If it didn't find it then we aren't in a dev environment diff --git a/api/buildcraft/api/core/BCLog.java b/api/buildcraft/api/core/BCLog.java index f745091..7b892f7 100644 --- a/api/buildcraft/api/core/BCLog.java +++ b/api/buildcraft/api/core/BCLog.java @@ -12,7 +12,8 @@ public final class BCLog { public static final Logger logger = LogManager.getLogger("BuildCraft"); /** Deactivate constructor */ - private BCLog() {} + private BCLog() { + } @Deprecated public static void logErrorAPI(String mod, Throwable error, Class classFile) { diff --git a/api/buildcraft/api/core/BuildCraftAPI.java b/api/buildcraft/api/core/BuildCraftAPI.java index f7f24c0..2f765ea 100644 --- a/api/buildcraft/api/core/BuildCraftAPI.java +++ b/api/buildcraft/api/core/BuildCraftAPI.java @@ -1,22 +1,21 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.core; -import java.util.HashMap; -import java.util.Set; - import com.google.common.collect.Maps; import com.google.common.collect.Sets; - import net.minecraft.block.Block; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.ModContainer; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.fml.ModLoadingContext; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModContainer; +import java.util.HashMap; +import java.util.Set; public final class BuildCraftAPI { public static IFakePlayerProvider fakePlayerProvider; @@ -25,12 +24,13 @@ public final class BuildCraftAPI { public static final HashMap worldProperties = Maps.newHashMap(); /** Deactivate constructor */ - private BuildCraftAPI() {} + private BuildCraftAPI() { + } public static String getVersion() { - ModContainer container = Loader.instance().getIndexedModList().get("buildcraftlib"); + ModContainer container = ModList.get().getModContainerById("buildcraftlib").get(); if (container != null) { - return container.getDisplayVersion(); + return container.getModInfo().getVersion().getQualifier(); } return "UNKNOWN VERSION"; } @@ -52,7 +52,8 @@ public static boolean isSoftBlock(World world, BlockPos pos) { public static ResourceLocation nameToResourceLocation(String name) { if (name.indexOf(':') > 0) return new ResourceLocation(name); - ModContainer modContainer = Loader.instance().activeModContainer(); +// ModContainer modContainer = Loader.instance().activeModContainer(); + ModContainer modContainer = ModLoadingContext.get().getActiveContainer(); if (modContainer == null) { throw new IllegalStateException("Illegal recipe name " + name + ". Provide domain id to register it correctly."); } diff --git a/api/buildcraft/api/core/CapabilitiesHelper.java b/api/buildcraft/api/core/CapabilitiesHelper.java index e39a8c4..19beb12 100644 --- a/api/buildcraft/api/core/CapabilitiesHelper.java +++ b/api/buildcraft/api/core/CapabilitiesHelper.java @@ -1,19 +1,17 @@ package buildcraft.api.core; -import java.lang.reflect.Field; -import java.util.IdentityHashMap; -import java.util.concurrent.Callable; - -import javax.annotation.Nonnull; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.util.EnumFacing; - +import net.minecraft.nbt.INBT; +import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.Capability.IStorage; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; +import javax.annotation.Nonnull; +import java.lang.reflect.Field; +import java.util.IdentityHashMap; +import java.util.concurrent.Callable; + /** Forge has a wonderful system for capabilities, which provides a better way of managing mod compat even if the target * mod isn't loaded. Said system uses ASM data to inject capabilities into every mod, which makes it a matter of * checking a (generic) field at runtime. @@ -38,20 +36,21 @@ public class CapabilitiesHelper { /** Registers a given type with {@link #registerCapability(CheckedStorage, Callable)}, but with a * {@link ThrowingStorage} and a factory that throws an {@link UnsupportedOperationException} instead of creating a * new capability instance. - * + * * @param clazz The type that all instances must derive from. * @return The registered {@link Capability} */ @Nonnull public static Capability registerCapability(Class clazz) { - return registerCapability(new ThrowingStorage<>(clazz), () -> { + return registerCapability(new ThrowingStorage<>(clazz), () -> + { throw new UnsupportedOperationException("You must create your own instances!"); }); } /** Registers a given type with the {@link CapabilityManager}, but also returns the capability instance. - * + * * @param storage The storage for the capability. This must extend {@link CheckedStorage} in order to allow the - * internal mechanisms to ensure that nothing went wrong during our meddling into forge. + * internal mechanisms to ensure that nothing went wrong during our meddling into forge. * @param factory The factory for the capability. * @return The registered {@link Capability} */ @Nonnull @@ -62,7 +61,7 @@ public static Capability registerCapability(CheckedStorage storage, Ca /** A type of {@link IStorage} that contains the class that it would store. Used by the internal mechanisms of * {@link CapabilitiesHelper} to ensure that everything registers properly. A default always-throwing implementation * is {@link ThrowingStorage}. - * + * * @param The type of this storage */ public static abstract class CheckedStorage implements IStorage { @@ -82,12 +81,12 @@ public ThrowingStorage(Class clazz) { } @Override - public NBTBase writeNBT(Capability capability, T instance, EnumFacing side) { + public INBT writeNBT(Capability capability, T instance, Direction side) { throw new UnsupportedOperationException("You must create your own instances!"); } @Override - public void readNBT(Capability capability, T instance, EnumFacing side, NBTBase nbt) { + public void readNBT(Capability capability, T instance, Direction side, INBT nbt) { throw new UnsupportedOperationException("You must create your own instances!"); } } @@ -127,7 +126,7 @@ private static Capability registerCapInternal(CheckedStorage storage, } if (!(obj instanceof Capability)) { throw new Error("We must have the wrong map! providers.get(key) returned " + obj.getClass() - + " rather than " + Capability.class); + + " rather than " + Capability.class); } Capability cap = (Capability) obj; // Ensure that the given cap is actually *our* capability @@ -136,12 +135,12 @@ private static Capability registerCapInternal(CheckedStorage storage, IStorage cStorage = cap.getStorage(); if (!(cStorage instanceof CheckedStorage)) { throw new IllegalStateException( - "Returned capability storage has a different storage class than expected! " + cStorage.getClass()); + "Returned capability storage has a different storage class than expected! " + cStorage.getClass()); } CheckedStorage vStorage = (CheckedStorage) cStorage; if (vStorage.clazz != clazz) { throw new IllegalStateException( - "Returned capability storage has a different class than expected! " + vStorage.clazz + " vs " + clazz); + "Returned capability storage has a different class than expected! " + vStorage.clazz + " vs " + clazz); } return (Capability) cap; } @@ -159,12 +158,12 @@ public static Capability ensureRegistration(Capability cap, Class c public static class VoidStorage implements Capability.IStorage { @Override - public NBTBase writeNBT(Capability capability, T instance, EnumFacing side) { + public INBT writeNBT(Capability capability, T instance, Direction side) { throw new IllegalStateException("You must create your own instances!"); } @Override - public void readNBT(Capability capability, T instance, EnumFacing side, NBTBase nbt) { + public void readNBT(Capability capability, T instance, Direction side, INBT nbt) { throw new IllegalStateException("You must create your own instances!"); } } diff --git a/api/buildcraft/api/core/EnumColor.java b/api/buildcraft/api/core/EnumColor.java deleted file mode 100644 index 0288438..0000000 --- a/api/buildcraft/api/core/EnumColor.java +++ /dev/null @@ -1,147 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.core; - -import java.util.Locale; -import java.util.Random; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.IStringSerializable; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.translation.I18n; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -/** Use minecraft's EnumDyeColor in as many places as possible. */ -@Deprecated -public enum EnumColor implements IStringSerializable { - - BLACK, - RED, - GREEN, - BROWN, - BLUE, - PURPLE, - CYAN, - LIGHT_GRAY, - GRAY, - PINK, - LIME, - YELLOW, - LIGHT_BLUE, - MAGENTA, - ORANGE, - WHITE; - - public static final EnumColor[] VALUES = values(); - public static final String[] DYES = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan", "dyeLightGray", "dyeGray", - "dyePink", "dyeLime", "dyeYellow", "dyeLightBlue", "dyeMagenta", "dyeOrange", "dyeWhite" }; - public static final String[] NAMES = { "Black", "Red", "Green", "Brown", "Blue", "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", "Yellow", - "LightBlue", "Magenta", "Orange", "White" }; - public static final int[] DARK_HEX = { 0x2D2D2D, 0xA33835, 0x394C1E, 0x5C3A24, 0x3441A2, 0x843FBF, 0x36809E, 0x888888, 0x444444, 0xE585A0, - 0x3FAA36, 0xCFC231, 0x7F9AD1, 0xFF64FF, 0xFF6A00, 0xFFFFFF }; - public static final int[] LIGHT_HEX = { 0x181414, 0xBE2B27, 0x007F0E, 0x89502D, 0x253193, 0x7e34bf, 0x299799, 0xa0a7a7, 0x7A7A7A, 0xD97199, - 0x39D52E, 0xFFD91C, 0x66AAFF, 0xD943C6, 0xEA7835, 0xe4e4e4 }; - - @SideOnly(Side.CLIENT) - private static ResourceLocation iconSheet; - - @SideOnly(Side.CLIENT) - private static TextureAtlasSprite[] brushSprites; - - public int getDarkHex() { - return DARK_HEX[ordinal()]; - } - - public int getLightHex() { - return LIGHT_HEX[ordinal()]; - } - - public static EnumColor fromId(int id) { - if (id < 0 || id >= VALUES.length) { - return WHITE; - } - return VALUES[id]; - } - - public static EnumColor fromDye(String dyeTag) { - for (int id = 0; id < DYES.length; id++) { - if (DYES[id].equals(dyeTag)) { - return VALUES[id]; - } - } - return null; - } - - public static EnumColor fromName(String name) { - for (int id = 0; id < NAMES.length; id++) { - if (NAMES[id].equals(name)) { - return VALUES[id]; - } - } - return null; - } - - public static EnumColor getRand() { - return VALUES[new Random().nextInt(VALUES.length)]; - } - - public EnumColor getNext() { - EnumColor next = VALUES[(ordinal() + 1) % VALUES.length]; - return next; - } - - public EnumColor getPrevious() { - EnumColor previous = VALUES[(ordinal() + VALUES.length - 1) % VALUES.length]; - return previous; - } - - public EnumColor inverse() { - return EnumColor.VALUES[15 - ordinal()]; - } - - public String getTag() { - return "color." + name().replace("_", ".").toLowerCase(Locale.ENGLISH); - } - - public String getBasicTag() { - return name().replace("_", ".").toLowerCase(Locale.ENGLISH); - } - - @Override - public String getName() { - return NAMES[ordinal()]; - } - - public String getLocalizedName() { - return I18n.translateToLocal(getTag()); - } - - public String getDye() { - return DYES[ordinal()]; - } - - @Override - public String toString() { - String s = name().replace("_", " "); - String[] words = s.split(" "); - StringBuilder b = new StringBuilder(); - for (String word : words) { - b.append(word.charAt(0)).append(word.substring(1).toLowerCase(Locale.ENGLISH)).append(" "); - } - return b.toString().trim(); - } - - @SideOnly(Side.CLIENT) - public static void registerSprites(TextureAtlasSprite[] sprites) { - brushSprites = sprites; - } - - @SideOnly(Side.CLIENT) - public TextureAtlasSprite getSprite() { - return brushSprites[ordinal()]; - } -} diff --git a/api/buildcraft/api/core/EnumPipePart.java b/api/buildcraft/api/core/EnumPipePart.java index 3eb3731..5773c53 100644 --- a/api/buildcraft/api/core/EnumPipePart.java +++ b/api/buildcraft/api/core/EnumPipePart.java @@ -1,23 +1,22 @@ package buildcraft.api.core; -import java.util.Locale; -import java.util.Map; - import com.google.common.collect.Maps; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTPrimitive; -import net.minecraft.nbt.NBTTagString; -import net.minecraft.util.EnumFacing; +import net.minecraft.nbt.INBT; +import net.minecraft.nbt.NumberNBT; +import net.minecraft.nbt.StringNBT; +import net.minecraft.util.Direction; import net.minecraft.util.IStringSerializable; +import java.util.Locale; +import java.util.Map; + public enum EnumPipePart implements IStringSerializable { - DOWN(EnumFacing.DOWN), - UP(EnumFacing.UP), - NORTH(EnumFacing.NORTH), - SOUTH(EnumFacing.SOUTH), - WEST(EnumFacing.WEST), - EAST(EnumFacing.EAST), + DOWN(Direction.DOWN), + UP(Direction.UP), + NORTH(Direction.NORTH), + SOUTH(Direction.SOUTH), + WEST(Direction.WEST), + EAST(Direction.EAST), /** CENTER, UNKNOWN and ALL are all valid uses of this. */ CENTER(null); @@ -25,22 +24,23 @@ public enum EnumPipePart implements IStringSerializable { public static final EnumPipePart[] FACES; public static final EnumPipePart[] HORIZONTALS; - private static final Map facingMap = Maps.newEnumMap(EnumFacing.class); + private static final Map facingMap = Maps.newEnumMap(Direction.class); private static final Map nameMap = Maps.newHashMap(); private static final int MAX_VALUES = values().length; - public final EnumFacing face; + public final Direction face; static { for (EnumPipePart part : values()) { nameMap.put(part.name(), part); if (part.face != null) facingMap.put(part.face, part); } - FACES = fromFacingArray(EnumFacing.VALUES); - HORIZONTALS = fromFacingArray(EnumFacing.HORIZONTALS); + FACES = fromFacingArray(Direction.values()); +// HORIZONTALS = fromFacingArray(Direction.HORIZONTALS); + HORIZONTALS = fromFacingArray(Direction.BY_2D_DATA); } - private static EnumPipePart[] fromFacingArray(EnumFacing... faces) { + private static EnumPipePart[] fromFacingArray(Direction... faces) { EnumPipePart[] arr = new EnumPipePart[faces.length]; for (int i = 0; i < faces.length; i++) { arr[i] = fromFacing(faces[i]); @@ -48,11 +48,11 @@ private static EnumPipePart[] fromFacingArray(EnumFacing... faces) { return arr; } - public static int ordinal(EnumFacing face) { + public static int ordinal(Direction face) { return face == null ? 6 : face.ordinal(); } - public static EnumPipePart fromFacing(EnumFacing face) { + public static EnumPipePart fromFacing(Direction face) { if (face == null) { return EnumPipePart.CENTER; } @@ -70,17 +70,17 @@ public static EnumPipePart fromMeta(int meta) { return VALUES[meta]; } - EnumPipePart(EnumFacing face) { + EnumPipePart(Direction face) { this.face = face; } public int getIndex() { if (face == null) return 6; - return face.getIndex(); + return face.get3DDataValue(); } @Override - public String getName() { + public String getSerializedName() { return name().toLowerCase(Locale.ROOT); } @@ -110,16 +110,16 @@ public EnumPipePart opposite() { return fromFacing(face.getOpposite()); } - public static EnumPipePart readFromNBT(NBTBase base) { + public static EnumPipePart readFromNBT(INBT base) { if (base == null) { return CENTER; } - if (base instanceof NBTTagString) { - NBTTagString nbtString = (NBTTagString) base; - String string = nbtString.getString(); + if (base instanceof StringNBT) { + StringNBT nbtString = (StringNBT) base; + String string = nbtString.getAsString(); return nameMap.getOrDefault(string, CENTER); } else { - byte ord = ((NBTPrimitive) base).getByte(); + byte ord = ((NumberNBT) base).getAsByte(); if (ord < 0 || ord > 6) { return CENTER; } @@ -127,7 +127,7 @@ public static EnumPipePart readFromNBT(NBTBase base) { } } - public NBTBase writeToNBT() { - return new NBTTagString(name()); + public INBT writeToNBT() { + return StringNBT.valueOf(name()); } } diff --git a/api/buildcraft/api/core/EnumWireColour.java b/api/buildcraft/api/core/EnumWireColour.java index b6e1e3d..e06bf78 100644 --- a/api/buildcraft/api/core/EnumWireColour.java +++ b/api/buildcraft/api/core/EnumWireColour.java @@ -1,41 +1,42 @@ package buildcraft.api.core; +import net.minecraft.item.DyeColor; + import java.util.EnumMap; import java.util.EnumSet; import java.util.Set; -import net.minecraft.item.EnumDyeColor; - -/** A subset of colours from {@link EnumDyeColor} that are suitable for use in LED's or wires (or equivalent). In other +/** A subset of colours from {@link DyeColor} that are suitable for use in LED's or wires (or equivalent). In other * words they must all be uniquely identifiable from both their lit and dark colours, and not look similar to other * colours. */ +@Deprecated() public enum EnumWireColour { // We disallow all variants of grey and black, as they don't make much sense relative to LED's. // In theory we could keep black OR dark gey LED's (as they are very distant) but it's simpler not to. - WHITE(EnumDyeColor.WHITE, EnumDyeColor.SILVER, EnumDyeColor.GRAY, EnumDyeColor.BLACK), - ORANGE(EnumDyeColor.ORANGE), + WHITE(DyeColor.WHITE, DyeColor.LIGHT_GRAY, DyeColor.GRAY, DyeColor.BLACK), + ORANGE(DyeColor.ORANGE), // MAGENTA -> PINK - LIGHT_BLUE(EnumDyeColor.LIGHT_BLUE, EnumDyeColor.CYAN), - YELLOW(EnumDyeColor.YELLOW), - LIME(EnumDyeColor.LIME), - PINK(EnumDyeColor.PINK, EnumDyeColor.MAGENTA), + LIGHT_BLUE(DyeColor.LIGHT_BLUE, DyeColor.CYAN), + YELLOW(DyeColor.YELLOW), + LIME(DyeColor.LIME), + PINK(DyeColor.PINK, DyeColor.MAGENTA), // GRAY -> WHITE // SILVER (LIGHT_GRAY) -> WHITE // CYAN -> LIGHT_BLUE - PURPLE(EnumDyeColor.PURPLE), - BLUE(EnumDyeColor.BLUE), - BROWN(EnumDyeColor.BROWN), - GREEN(EnumDyeColor.GREEN), - RED(EnumDyeColor.RED), + PURPLE(DyeColor.PURPLE), + BLUE(DyeColor.BLUE), + BROWN(DyeColor.BROWN), + GREEN(DyeColor.GREEN), + RED(DyeColor.RED), // BLACK -> WHITE ; - private static final EnumMap DYE_TO_WIRE; + private static final EnumMap DYE_TO_WIRE; static { - DYE_TO_WIRE = new EnumMap<>(EnumDyeColor.class); + DYE_TO_WIRE = new EnumMap<>(DyeColor.class); for (EnumWireColour wire : values()) { - for (EnumDyeColor dye : wire.similarBasedColours) { + for (DyeColor dye : wire.similarBasedColours) { EnumWireColour prev = DYE_TO_WIRE.put(dye, wire); if (prev != null) { throw new Error(wire + " attempted to override " + prev + " for the dye " + dye + "!"); @@ -43,7 +44,7 @@ public enum EnumWireColour { } } - for (EnumDyeColor dye : EnumDyeColor.values()) { + for (DyeColor dye : DyeColor.values()) { EnumWireColour wire = DYE_TO_WIRE.get(dye); if (wire == null) { throw new Error(dye + " isn't mapped to a wire colour!"); @@ -52,18 +53,18 @@ public enum EnumWireColour { } /** The primary minecraft colour that this is based on. */ - public final EnumDyeColor primaryIdenticalColour; + public final DyeColor primaryIdenticalColour; /** A set of similar minecraft colours that this single colour is based on. Always includes * {@link #primaryIdenticalColour}. */ - public final Set similarBasedColours; + public final Set similarBasedColours; - private EnumWireColour(EnumDyeColor primary, EnumDyeColor... secondary) { + private EnumWireColour(DyeColor primary, DyeColor... secondary) { this.primaryIdenticalColour = primary; this.similarBasedColours = EnumSet.of(primary, secondary); } - public static EnumWireColour convertToWire(EnumDyeColor dye) { + public static EnumWireColour convertToWire(DyeColor dye) { return DYE_TO_WIRE.get(dye); } } diff --git a/api/buildcraft/api/core/IBox.java b/api/buildcraft/api/core/IBox.java index 6449077..c7fdd07 100644 --- a/api/buildcraft/api/core/IBox.java +++ b/api/buildcraft/api/core/IBox.java @@ -18,6 +18,6 @@ public interface IBox extends IZone { BlockPos max(); default BlockPos size() { - return max().subtract(min()).add(1, 1, 1); + return max().subtract(min()).offset(1, 1, 1); } } diff --git a/api/buildcraft/api/core/IEngineType.java b/api/buildcraft/api/core/IEngineType.java index b871096..11361a1 100644 --- a/api/buildcraft/api/core/IEngineType.java +++ b/api/buildcraft/api/core/IEngineType.java @@ -1,5 +1,6 @@ package buildcraft.api.core; public interface IEngineType { + @Deprecated() String getItemModelLocation(); } diff --git a/api/buildcraft/api/core/IFakePlayerProvider.java b/api/buildcraft/api/core/IFakePlayerProvider.java index c8bed73..c028d3f 100755 --- a/api/buildcraft/api/core/IFakePlayerProvider.java +++ b/api/buildcraft/api/core/IFakePlayerProvider.java @@ -1,16 +1,12 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - *

- * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. - */ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.core; import com.mojang.authlib.GameProfile; - import net.minecraft.util.math.BlockPos; -import net.minecraft.world.WorldServer; - +import net.minecraft.world.server.ServerWorld; import net.minecraftforge.common.util.FakePlayer; public interface IFakePlayerProvider { @@ -19,7 +15,7 @@ public interface IFakePlayerProvider { * UUID of the real player who created the block or entity that calls this. */ @Deprecated - FakePlayer getBuildCraftPlayer(WorldServer world); + FakePlayer getBuildCraftPlayer(ServerWorld world); /** * @param world @@ -27,7 +23,7 @@ public interface IFakePlayerProvider { * @return A fake player that can be used IN THE CURRENT METHOD CONTEXT ONLY! This will cause problems if this * player is left around as it holds a reference to the world object. */ - FakePlayer getFakePlayer(WorldServer world, GameProfile profile); + FakePlayer getFakePlayer(ServerWorld world, GameProfile profile); /** * @param world @@ -36,5 +32,5 @@ public interface IFakePlayerProvider { * @return A fake player that can be used IN THE CURRENT METHOD CONTEXT ONLY! This will cause problems if this * player is left around as it holds a reference to the world object. */ - FakePlayer getFakePlayer(WorldServer world, GameProfile profile, BlockPos pos); + FakePlayer getFakePlayer(ServerWorld world, GameProfile profile, BlockPos pos); } diff --git a/api/buildcraft/api/core/IFakeWorld.java b/api/buildcraft/api/core/IFakeWorld.java new file mode 100644 index 0000000..c1c6ea8 --- /dev/null +++ b/api/buildcraft/api/core/IFakeWorld.java @@ -0,0 +1,15 @@ +package buildcraft.api.core; + +import net.minecraft.profiler.IProfiler; +import net.minecraft.util.RegistryKey; +import net.minecraft.world.DimensionType; +import net.minecraft.world.World; +import net.minecraft.world.storage.ISpawnWorldInfo; + +import java.util.function.Supplier; + +public abstract class IFakeWorld extends World { + protected IFakeWorld(ISpawnWorldInfo data, RegistryKey dim, DimensionType dimensionType, Supplier profiler, boolean pIsClientSide, boolean p_204154_, long p_204155_) { + super(data, dim, dimensionType, profiler, pIsClientSide, p_204154_, p_204155_); + } +} diff --git a/api/buildcraft/api/core/IFluidFilter.java b/api/buildcraft/api/core/IFluidFilter.java index 0cd10d6..7774892 100755 --- a/api/buildcraft/api/core/IFluidFilter.java +++ b/api/buildcraft/api/core/IFluidFilter.java @@ -7,6 +7,5 @@ import net.minecraftforge.fluids.FluidStack; public interface IFluidFilter { - boolean matches(FluidStack fluid); } diff --git a/api/buildcraft/api/core/IFluidHandlerAdv.java b/api/buildcraft/api/core/IFluidHandlerAdv.java index aba2d8a..aa8fdd9 100644 --- a/api/buildcraft/api/core/IFluidHandlerAdv.java +++ b/api/buildcraft/api/core/IFluidHandlerAdv.java @@ -1,10 +1,10 @@ package buildcraft.api.core; -import javax.annotation.Nullable; - import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; +import javax.annotation.Nullable; + /** A version of {@link IFluidHandler} that can drain a fluid that a fluid filter accepts. */ public interface IFluidHandlerAdv extends IFluidHandler { /** Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler. @@ -14,5 +14,5 @@ public interface IFluidHandlerAdv extends IFluidHandler { * @param doDrain If false, drain will only be simulated. * @return FluidStack representing the Fluid and amount that was (or would have been, if simulated) drained. */ @Nullable - FluidStack drain(IFluidFilter filter, int maxDrain, boolean doDrain); + FluidStack drain(IFluidFilter filter, int maxDrain, FluidAction doDrain); } diff --git a/api/buildcraft/api/core/IPathProvider.java b/api/buildcraft/api/core/IPathProvider.java index f21ef36..06e5f59 100644 --- a/api/buildcraft/api/core/IPathProvider.java +++ b/api/buildcraft/api/core/IPathProvider.java @@ -1,10 +1,9 @@ package buildcraft.api.core; -import java.util.List; - +import buildcraft.api.items.IMapLocation.MapLocationType; import net.minecraft.util.math.BlockPos; -import buildcraft.api.items.IMapLocation.MapLocationType; +import java.util.List; /** To be implemented by TileEntities able to provide a path on the world, typically BuildCraft path markers. */ public interface IPathProvider { diff --git a/api/buildcraft/api/core/IStackFilter.java b/api/buildcraft/api/core/IStackFilter.java index 4f450c6..c251598 100644 --- a/api/buildcraft/api/core/IStackFilter.java +++ b/api/buildcraft/api/core/IStackFilter.java @@ -4,17 +4,17 @@ * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.core; -import javax.annotation.Nonnull; - import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import javax.annotation.Nonnull; + /** This interface provides a convenient means of dealing with entire classes of items without having to specify each * item individually. */ public interface IStackFilter { /** Check to see if a given stack matches this filter. - * + * * @param stack The stack to test. stack.isEmpty will always return false. * @return True if it does match, false otherwise. */ boolean matches(@Nonnull ItemStack stack); @@ -24,9 +24,7 @@ default IStackFilter and(IStackFilter filter) { return (stack) -> before.matches(stack) && filter.matches(stack); } - /** - * Returns example stack to match this filter - */ + /** Returns example stack to match this filter */ default NonNullList getExamples() { return NonNullList.withSize(0, ItemStack.EMPTY); } diff --git a/api/buildcraft/api/core/IZone.java b/api/buildcraft/api/core/IZone.java index efc9b16..efe04f4 100755 --- a/api/buildcraft/api/core/IZone.java +++ b/api/buildcraft/api/core/IZone.java @@ -4,15 +4,15 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; -import java.util.Random; - import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; + +import java.util.Random; /** Defines some volume in the world. This is not guaranteed to be fully connected to itself. */ public interface IZone { /** Returns the smallest possible distance that the pos would have to be changed by in order for - * {@link #contains(Vec3d)} to return true. If the position is already inside then this will return 0 */ + * {@link #contains(Vector3d)} to return true. If the position is already inside then this will return 0 */ double distanceTo(BlockPos pos); /** Returns {@link #distanceTo(BlockPos)} but squared. Usually this will be quicker to calculate. */ @@ -20,8 +20,8 @@ public interface IZone { /** Returns true if the point is enclosed by this zone, such that none of the coordinates lie outside the range * specified by this zone. */ - boolean contains(Vec3d point); + boolean contains(Vector3d point); - /** Gets a random position that {@link #contains(Vec3d)} will return true. */ + /** Gets a random position that {@link #contains(Vector3d)} will return true. */ BlockPos getRandomBlockPos(Random rand); } diff --git a/api/buildcraft/api/core/InvalidInputDataException.java b/api/buildcraft/api/core/InvalidInputDataException.java index 866c36c..6e90933 100644 --- a/api/buildcraft/api/core/InvalidInputDataException.java +++ b/api/buildcraft/api/core/InvalidInputDataException.java @@ -8,9 +8,7 @@ import java.io.IOException; -/** - * Indicates that we failed to load from NBT or some other file. - */ +/** Indicates that we failed to load from NBT or some other file. */ public class InvalidInputDataException extends IOException { public InvalidInputDataException() { } diff --git a/api/buildcraft/api/core/SafeTimeTracker.java b/api/buildcraft/api/core/SafeTimeTracker.java index 30593be..3e35233 100644 --- a/api/buildcraft/api/core/SafeTimeTracker.java +++ b/api/buildcraft/api/core/SafeTimeTracker.java @@ -44,7 +44,7 @@ public boolean markTimeIfDelay(World world, long delay) { return false; } - long currentTime = world.getTotalWorldTime(); + long currentTime = world.getGameTime(); if (currentTime < lastMark) { lastMark = currentTime; @@ -65,6 +65,6 @@ public long durationOfLastDelay() { } public void markTime(World world) { - lastMark = world.getTotalWorldTime(); + lastMark = world.getGameTime(); } } diff --git a/api/buildcraft/api/core/StackKey.java b/api/buildcraft/api/core/StackKey.java index d8c2c44..bc7f076 100644 --- a/api/buildcraft/api/core/StackKey.java +++ b/api/buildcraft/api/core/StackKey.java @@ -5,10 +5,9 @@ package buildcraft.api.core; import net.minecraft.block.Block; +import net.minecraft.fluid.Fluid; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; /** This class is used whenever stacks needs to be stored as keys. */ @@ -29,20 +28,26 @@ public StackKey(ItemStack stack, FluidStack fluidStack) { this.fluidStack = fluidStack; } - public static StackKey stack(Item item, int amount, int damage) { - return new StackKey(new ItemStack(item, amount, damage)); + // public static StackKey stack(Item item, int amount, int damage) + public static StackKey stack(Item item, int amount) { +// return new StackKey(new ItemStack(item, amount, damage)); + return new StackKey(new ItemStack(item, amount)); } - public static StackKey stack(Block block, int amount, int damage) { - return new StackKey(new ItemStack(block, amount, damage)); + // public static StackKey stack(Block block, int amount, int damage) + public static StackKey stack(Block block, int amount) { +// return new StackKey(new ItemStack(block, amount, damage)); + return new StackKey(new ItemStack(block, amount)); } public static StackKey stack(Item item) { - return new StackKey(new ItemStack(item, 1, 0)); +// return new StackKey(new ItemStack(item, 1, 0)); + return new StackKey(new ItemStack(item, 1)); } public static StackKey stack(Block block) { - return new StackKey(new ItemStack(block, 1, 0)); +// return new StackKey(new ItemStack(block, 1, 0)); + return new StackKey(new ItemStack(block, 1)); } public static StackKey stack(ItemStack itemStack) { @@ -74,13 +79,18 @@ public boolean equals(Object o) { return false; } if (stack != null) { - if (stack.getItem() != k.stack.getItem() || stack.getHasSubtypes() && stack.getItemDamage() != k.stack.getItemDamage() || !objectsEqual( - stack.getTagCompound(), k.stack.getTagCompound())) { + if ( + stack.getItem() != k.stack.getItem() +// || stack.getHasSubtypes() + && stack.getDamageValue() != k.stack.getDamageValue() + || !objectsEqual(stack.getTag(), k.stack.getTag()) + ) + { return false; } } if (fluidStack != null) { - if (!fluidStack.isFluidEqual(k.fluidStack) || fluidStack.amount != k.fluidStack.amount) { + if (!fluidStack.isFluidEqual(k.fluidStack) || fluidStack.getAmount() != k.fluidStack.getAmount()) { return false; } } @@ -92,14 +102,15 @@ public int hashCode() { int result = 7; if (stack != null) { result = 31 * result + stack.getItem().hashCode(); - result = 31 * result + stack.getItemDamage(); - result = 31 * result + objectHashCode(stack.getTagCompound()); + result = 31 * result + stack.getDamageValue(); + result = 31 * result + objectHashCode(stack.getTag()); } result = 31 * result + 7; if (fluidStack != null) { - result = 31 * result + fluidStack.getFluid().getName().hashCode(); - result = 31 * result + fluidStack.amount; - result = 31 * result + objectHashCode(fluidStack.tag); +// result = 31 * result + fluidStack.getFluid().getName().hashCode(); + result = 31 * result + fluidStack.getFluid().getRegistryName().hashCode(); + result = 31 * result + fluidStack.getAmount(); + result = 31 * result + objectHashCode(fluidStack.getTag()); } return result; } diff --git a/api/buildcraft/api/core/package-info.java b/api/buildcraft/api/core/package-info.java index 223c751..1f2a297 100644 --- a/api/buildcraft/api/core/package-info.java +++ b/api/buildcraft/api/core/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.2", owner = "buildcraftlib", provides = "buildcraftapi_core") +//@API(apiVersion = "2.2", owner = "buildcraftlib", provides = "buildcraftapi_core") package buildcraft.api.core; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/crops/CropManager.java b/api/buildcraft/api/crops/CropManager.java index 68a4302..6cc470b 100644 --- a/api/buildcraft/api/crops/CropManager.java +++ b/api/buildcraft/api/crops/CropManager.java @@ -1,16 +1,16 @@ package buildcraft.api.crops; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.block.BlockState; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; +import net.minecraft.world.IWorld; import net.minecraft.world.World; +import java.util.ArrayList; +import java.util.List; + public final class CropManager { private static List handlers = new ArrayList<>(); private static ICropHandler defaultHandler; @@ -52,7 +52,7 @@ public static boolean canSustainPlant(World world, ItemStack seed, BlockPos pos) /** Attempts to plant the crop given by the seed into the world. Also checks to make sure that * {@link ICropHandler#isSeed(ItemStack)} is true, and * {@link ICropHandler#canSustainPlant(World, ItemStack, BlockPos)} is true for the position. */ - public static boolean plantCrop(World world, EntityPlayer player, ItemStack seed, BlockPos pos) { + public static boolean plantCrop(World world, PlayerEntity player, ItemStack seed, BlockPos pos) { for (ICropHandler cropHandler : handlers) { if (cropHandler.isSeed(seed) && cropHandler.canSustainPlant(world, seed, pos) && cropHandler.plantCrop(world, player, seed, pos)) { return true; @@ -64,7 +64,7 @@ public static boolean plantCrop(World world, EntityPlayer player, ItemStack seed return false; } - public static boolean isMature(IBlockAccess blockAccess, IBlockState state, BlockPos pos) { + public static boolean isMature(IWorld blockAccess, BlockState state, BlockPos pos) { for (ICropHandler cropHandler : handlers) { if (cropHandler.isMature(blockAccess, state, pos)) { return true; @@ -74,7 +74,7 @@ public static boolean isMature(IBlockAccess blockAccess, IBlockState state, Bloc } public static boolean harvestCrop(World world, BlockPos pos, NonNullList drops) { - IBlockState state = world.getBlockState(pos); + BlockState state = world.getBlockState(pos); for (ICropHandler cropHandler : handlers) { if (cropHandler.isMature(world, state, pos)) { return cropHandler.harvestCrop(world, pos, drops); @@ -82,5 +82,4 @@ public static boolean harvestCrop(World world, BlockPos pos, NonNullList= VALUES.length) { - meta = 0; - } - return VALUES[meta]; - } +// public static EnumEngineType fromMeta(int meta) { +// if (meta < 0 || meta >= VALUES.length) { +// meta = 0; +// } +// return VALUES[meta]; +// } } diff --git a/api/buildcraft/api/enums/EnumLaserTableType.java b/api/buildcraft/api/enums/EnumLaserTableType.java index dbf99a5..0fe39f6 100644 --- a/api/buildcraft/api/enums/EnumLaserTableType.java +++ b/api/buildcraft/api/enums/EnumLaserTableType.java @@ -10,7 +10,7 @@ public enum EnumLaserTableType implements IStringSerializable { PROGRAMMING_TABLE; @Override - public String getName() { + public String getSerializedName() { return name(); } } diff --git a/api/buildcraft/api/enums/EnumMachineState.java b/api/buildcraft/api/enums/EnumMachineState.java index 7b7caf7..31bf15d 100644 --- a/api/buildcraft/api/enums/EnumMachineState.java +++ b/api/buildcraft/api/enums/EnumMachineState.java @@ -1,21 +1,20 @@ package buildcraft.api.enums; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.IStringSerializable; - import buildcraft.api.properties.BuildCraftProperties; +import net.minecraft.block.BlockState; +import net.minecraft.util.IStringSerializable; public enum EnumMachineState implements IStringSerializable { OFF, ON, DONE; - public static EnumMachineState getType(IBlockState state) { + public static EnumMachineState getType(BlockState state) { return state.getValue(BuildCraftProperties.MACHINE_STATE); } @Override - public String getName() { + public String getSerializedName() { return name(); } } diff --git a/api/buildcraft/api/enums/EnumOptionalSnapshotType.java b/api/buildcraft/api/enums/EnumOptionalSnapshotType.java index cfd413d..16afc20 100644 --- a/api/buildcraft/api/enums/EnumOptionalSnapshotType.java +++ b/api/buildcraft/api/enums/EnumOptionalSnapshotType.java @@ -1,9 +1,9 @@ package buildcraft.api.enums; -import java.util.Locale; - import net.minecraft.util.IStringSerializable; +import java.util.Locale; + /** * Version of {@link EnumSnapshotType} with {@link EnumOptionalSnapshotType#NONE} value. * Shouldn't be used where it's possible to use {@link EnumSnapshotType}. @@ -34,7 +34,7 @@ public static EnumOptionalSnapshotType fromNullable(EnumSnapshotType type) { } @Override - public String getName() { + public String getSerializedName() { return name().toLowerCase(Locale.ROOT); } } diff --git a/api/buildcraft/api/enums/EnumPowerStage.java b/api/buildcraft/api/enums/EnumPowerStage.java index 0a88bae..7c4b4f9 100644 --- a/api/buildcraft/api/enums/EnumPowerStage.java +++ b/api/buildcraft/api/enums/EnumPowerStage.java @@ -1,9 +1,9 @@ package buildcraft.api.enums; -import java.util.Locale; - import net.minecraft.util.IStringSerializable; +import java.util.Locale; + public enum EnumPowerStage implements IStringSerializable { BLUE, GREEN, @@ -21,7 +21,7 @@ public String getModelName() { } @Override - public String getName() { + public String getSerializedName() { return getModelName(); } } diff --git a/api/buildcraft/api/enums/EnumRedstoneChipset.java b/api/buildcraft/api/enums/EnumRedstoneChipset.java index 90d7cc4..90e1950 100644 --- a/api/buildcraft/api/enums/EnumRedstoneChipset.java +++ b/api/buildcraft/api/enums/EnumRedstoneChipset.java @@ -1,13 +1,14 @@ package buildcraft.api.enums; -import java.util.Locale; - +import buildcraft.api.BCItems; +import buildcraft.api.items.IChipset; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IStringSerializable; -import buildcraft.api.BCItems; +import java.util.Locale; +// public enum EnumRedstoneChipset implements IStringSerializable public enum EnumRedstoneChipset implements IStringSerializable { RED, IRON, @@ -18,12 +19,29 @@ public enum EnumRedstoneChipset implements IStringSerializable { private final String name = name().toLowerCase(Locale.ROOT); public ItemStack getStack(int stackSize) { - Item chipset = BCItems.Silicon.REDSTONE_CHIPSET; + Item chipset = null; + switch (this) { + case RED: + chipset = BCItems.Silicon.CHIPSET_REDSTONE; + break; + case IRON: + chipset = BCItems.Silicon.CHIPSET_IRON; + break; + case GOLD: + chipset = BCItems.Silicon.CHIPSET_GOLD; + break; + case QUARTZ: + chipset = BCItems.Silicon.CHIPSET_QUARTZ; + break; + case DIAMOND: + chipset = BCItems.Silicon.CHIPSET_DIAMOND; + break; + } if (chipset == null) { return ItemStack.EMPTY; + } else { + return new ItemStack(chipset, stackSize); } - - return new ItemStack(chipset, stackSize, ordinal()); } public ItemStack getStack() { @@ -31,10 +49,12 @@ public ItemStack getStack() { } public static EnumRedstoneChipset fromStack(ItemStack stack) { - if (stack == null) { +// if (stack == null) + if (stack == null || !(stack.getItem() instanceof IChipset)) { return RED; } - return fromOrdinal(stack.getMetadata()); +// return fromOrdinal(stack.getMetadata()); + return ((IChipset) stack.getItem()).getType(); } public static EnumRedstoneChipset fromOrdinal(int ordinal) { @@ -45,7 +65,8 @@ public static EnumRedstoneChipset fromOrdinal(int ordinal) { } @Override - public String getName() { +// public String getName() + public String getSerializedName() { return name; } } diff --git a/api/buildcraft/api/enums/EnumSpring.java b/api/buildcraft/api/enums/EnumSpring.java index 21e4cf2..b8347df 100644 --- a/api/buildcraft/api/enums/EnumSpring.java +++ b/api/buildcraft/api/enums/EnumSpring.java @@ -1,40 +1,46 @@ package buildcraft.api.enums; -import java.util.Locale; -import java.util.function.Supplier; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; +import buildcraft.api.blocks.ISpring; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IStringSerializable; -import buildcraft.api.properties.BuildCraftProperties; +import java.util.Locale; +import java.util.function.Supplier; public enum EnumSpring implements IStringSerializable { - WATER(5, -1, Blocks.WATER.getDefaultState()), + WATER(5, -1, Blocks.WATER.defaultBlockState()), OIL(6000, 8, null); // Set in BuildCraftEnergy public static final EnumSpring[] VALUES = values(); public final int tickRate, chance; - public IBlockState liquidBlock; + public BlockState liquidBlock; public boolean canGen = true; + // public Supplier tileConstructor; public Supplier tileConstructor; private final String lowerCaseName = name().toLowerCase(Locale.ROOT); - EnumSpring(int tickRate, int chance, IBlockState liquidBlock) { + EnumSpring(int tickRate, int chance, BlockState liquidBlock) { this.tickRate = tickRate; this.chance = chance; this.liquidBlock = liquidBlock; } - public static EnumSpring fromState(IBlockState state) { - return state.getValue(BuildCraftProperties.SPRING_TYPE); + public static EnumSpring fromState(BlockState state) { +// return state.getValue(BuildCraftProperties.SPRING_TYPE); + if (state.getBlock() instanceof ISpring) { + ISpring spring = (ISpring) state.getBlock(); + return spring.getType(); + } else { + return null; + } } @Override - public String getName() { + public String getSerializedName() { return lowerCaseName; } } diff --git a/api/buildcraft/api/enums/package-info.java b/api/buildcraft/api/enums/package-info.java index ab21992..49f7dd0 100644 --- a/api/buildcraft/api/enums/package-info.java +++ b/api/buildcraft/api/enums/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.0", owner = "buildcraftapi_core", provides = "buildcraftapi_enums") +//@API(apiVersion = "1.0", owner = "buildcraftapi_core", provides = "buildcraftapi_enums") package buildcraft.api.enums; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/events/BlockInteractionEvent.java b/api/buildcraft/api/events/BlockInteractionEvent.java index 4a4d8b7..5a2e1f0 100644 --- a/api/buildcraft/api/events/BlockInteractionEvent.java +++ b/api/buildcraft/api/events/BlockInteractionEvent.java @@ -4,18 +4,17 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.events; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; - -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; +import net.minecraft.block.BlockState; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraftforge.eventbus.api.Cancelable; +import net.minecraftforge.eventbus.api.Event; @Cancelable public class BlockInteractionEvent extends Event { - public final EntityPlayer player; - public final IBlockState state; + public final PlayerEntity player; + public final BlockState state; - public BlockInteractionEvent(EntityPlayer player, IBlockState state) { + public BlockInteractionEvent(PlayerEntity player, BlockState state) { this.player = player; this.state = state; } diff --git a/api/buildcraft/api/events/BlockPlacedDownEvent.java b/api/buildcraft/api/events/BlockPlacedDownEvent.java index 22a8a74..15f37a1 100644 --- a/api/buildcraft/api/events/BlockPlacedDownEvent.java +++ b/api/buildcraft/api/events/BlockPlacedDownEvent.java @@ -4,20 +4,19 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.events; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.block.BlockState; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; - -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; +import net.minecraftforge.eventbus.api.Cancelable; +import net.minecraftforge.eventbus.api.Event; @Cancelable public class BlockPlacedDownEvent extends Event { - public final EntityPlayer player; - public final IBlockState state; + public final PlayerEntity player; + public final BlockState state; public final BlockPos pos; - public BlockPlacedDownEvent(EntityPlayer player, BlockPos pos, IBlockState state) { + public BlockPlacedDownEvent(PlayerEntity player, BlockPos pos, BlockState state) { this.player = player; this.state = state; this.pos = pos; diff --git a/api/buildcraft/api/events/PipePlacedEvent.java b/api/buildcraft/api/events/PipePlacedEvent.java index 3664a57..6fafa06 100644 --- a/api/buildcraft/api/events/PipePlacedEvent.java +++ b/api/buildcraft/api/events/PipePlacedEvent.java @@ -4,18 +4,17 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.events; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.util.math.BlockPos; - -import net.minecraftforge.fml.common.eventhandler.Event; +import net.minecraftforge.eventbus.api.Event; public class PipePlacedEvent extends Event { - public EntityPlayer player; + public PlayerEntity player; public Item pipeType; public BlockPos pos; - public PipePlacedEvent(EntityPlayer player, Item pipeType, BlockPos pos) { + public PipePlacedEvent(PlayerEntity player, Item pipeType, BlockPos pos) { this.player = player; this.pipeType = pipeType; this.pos = pos; diff --git a/api/buildcraft/api/events/RobotEvent.java b/api/buildcraft/api/events/RobotEvent.java index 9b12b64..09bdb37 100644 --- a/api/buildcraft/api/events/RobotEvent.java +++ b/api/buildcraft/api/events/RobotEvent.java @@ -4,13 +4,11 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.events; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; - import buildcraft.api.robots.EntityRobotBase; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraftforge.eventbus.api.Cancelable; +import net.minecraftforge.eventbus.api.Event; public abstract class RobotEvent extends Event { public final EntityRobotBase robot; @@ -21,9 +19,9 @@ public RobotEvent(EntityRobotBase robot) { @Cancelable public static class Place extends RobotEvent { - public final EntityPlayer player; + public final PlayerEntity player; - public Place(EntityRobotBase robot, EntityPlayer player) { + public Place(EntityRobotBase robot, PlayerEntity player) { super(robot); this.player = player; } @@ -31,10 +29,10 @@ public Place(EntityRobotBase robot, EntityPlayer player) { @Cancelable public static class Interact extends RobotEvent { - public final EntityPlayer player; + public final PlayerEntity player; public final ItemStack item; - public Interact(EntityRobotBase robot, EntityPlayer player, ItemStack item) { + public Interact(EntityRobotBase robot, PlayerEntity player, ItemStack item) { super(robot); this.player = player; this.item = item; @@ -43,9 +41,9 @@ public Interact(EntityRobotBase robot, EntityPlayer player, ItemStack item) { @Cancelable public static class Dismantle extends RobotEvent { - public final EntityPlayer player; + public final PlayerEntity player; - public Dismantle(EntityRobotBase robot, EntityPlayer player) { + public Dismantle(EntityRobotBase robot, PlayerEntity player) { super(robot); this.player = player; } diff --git a/api/buildcraft/api/events/RobotPlacementEvent.java b/api/buildcraft/api/events/RobotPlacementEvent.java index b0abc44..71c71e8 100644 --- a/api/buildcraft/api/events/RobotPlacementEvent.java +++ b/api/buildcraft/api/events/RobotPlacementEvent.java @@ -4,19 +4,17 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.events; -import net.minecraft.entity.player.EntityPlayer; - -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraftforge.eventbus.api.Cancelable; +import net.minecraftforge.eventbus.api.Event; @Cancelable public class RobotPlacementEvent extends Event { - public EntityPlayer player; + public PlayerEntity player; public String robotProgram; - public RobotPlacementEvent(EntityPlayer player, String robotProgram) { + public RobotPlacementEvent(PlayerEntity player, String robotProgram) { this.player = player; this.robotProgram = robotProgram; } - } diff --git a/api/buildcraft/api/events/package-info.java b/api/buildcraft/api/events/package-info.java index 46ac77c..dbbc4cc 100644 --- a/api/buildcraft/api/events/package-info.java +++ b/api/buildcraft/api/events/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.0", owner = "buildcraftapi_core", provides = "buildcraftapi_events") +//@API(apiVersion = "2.0", owner = "buildcraftapi_core", provides = "buildcraftapi_events") package buildcraft.api.events; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/facades/FacadeAPI.java b/api/buildcraft/api/facades/FacadeAPI.java index 1f3e2b9..802b667 100644 --- a/api/buildcraft/api/facades/FacadeAPI.java +++ b/api/buildcraft/api/facades/FacadeAPI.java @@ -1,11 +1,13 @@ package buildcraft.api.facades; +import buildcraft.api.imc.BcImcMessage; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; +import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import net.minecraftforge.fml.common.event.FMLInterModComms; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.NBTUtil; +import net.minecraftforge.fml.InterModComms; +import net.minecraftforge.fml.RegistryObject; public final class FacadeAPI { public static final String IMC_MOD_TARGET = "buildcraftsilicon"; @@ -15,7 +17,8 @@ public final class FacadeAPI { public static final String NBT_CUSTOM_BLOCK_META = "block_meta"; public static final String NBT_CUSTOM_ITEM_STACK = "item_stack"; - public static IFacadeItem facadeItem; + // public static IFacadeItem facadeItem; + public static RegistryObject facadeItem; public static IFacadeRegistry registry; private FacadeAPI() { @@ -23,19 +26,22 @@ private FacadeAPI() { } public static void disableBlock(Block block) { - FMLInterModComms.sendMessage(IMC_MOD_TARGET, IMC_FACADE_DISABLE, block.getRegistryName()); +// FMLInterModComms.sendMessage(IMC_MOD_TARGET, IMC_FACADE_DISABLE, block.getRegistryName()); + InterModComms.sendTo(IMC_MOD_TARGET, IMC_FACADE_DISABLE, () -> new BcImcMessage(block.getRegistryName())); } - public static void mapStateToStack(IBlockState state, ItemStack stack) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString(NBT_CUSTOM_BLOCK_REG_KEY, state.getBlock().getRegistryName().toString()); - nbt.setInteger(NBT_CUSTOM_BLOCK_META, state.getBlock().getMetaFromState(state)); - nbt.setTag(NBT_CUSTOM_ITEM_STACK, stack.serializeNBT()); - FMLInterModComms.sendMessage(IMC_MOD_TARGET, IMC_FACADE_CUSTOM, nbt); + public static void mapStateToStack(BlockState state, ItemStack stack) { + CompoundNBT nbt = new CompoundNBT(); + nbt.putString(NBT_CUSTOM_BLOCK_REG_KEY, state.getBlock().getRegistryName().toString()); +// nbt.putInt(NBT_CUSTOM_BLOCK_META, state.getBlock().getMetaFromState(state)); + nbt.put(NBT_CUSTOM_BLOCK_META, NBTUtil.writeBlockState(state)); + nbt.put(NBT_CUSTOM_ITEM_STACK, stack.serializeNBT()); +// FMLInterModComms.sendMessage(IMC_MOD_TARGET, IMC_FACADE_CUSTOM, nbt); + InterModComms.sendTo(IMC_MOD_TARGET, IMC_FACADE_CUSTOM, () -> new BcImcMessage(nbt)); } public static boolean isFacadeMessageId(String id) { return IMC_FACADE_CUSTOM.equals(id) // - || IMC_FACADE_DISABLE.equals(id); + || IMC_FACADE_DISABLE.equals(id); } } diff --git a/api/buildcraft/api/facades/IFacade.java b/api/buildcraft/api/facades/IFacade.java index 1142a73..68c6744 100644 --- a/api/buildcraft/api/facades/IFacade.java +++ b/api/buildcraft/api/facades/IFacade.java @@ -1,9 +1,13 @@ package buildcraft.api.facades; +import net.minecraft.nbt.CompoundNBT; + public interface IFacade { FacadeType getType(); boolean isHollow(); IFacadePhasedState[] getPhasedStates(); + + CompoundNBT writeToNbt(); } diff --git a/api/buildcraft/api/facades/IFacadeItem.java b/api/buildcraft/api/facades/IFacadeItem.java index 65c312a..ddde00f 100644 --- a/api/buildcraft/api/facades/IFacadeItem.java +++ b/api/buildcraft/api/facades/IFacadeItem.java @@ -4,12 +4,12 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.facades; +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemStack; + import javax.annotation.Nonnull; import javax.annotation.Nullable; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.ItemStack; - public interface IFacadeItem { @Nullable @@ -22,7 +22,7 @@ default FacadeType getFacadeType(@Nonnull ItemStack stack) { } @Nonnull - ItemStack getFacadeForBlock(IBlockState state); + ItemStack getFacadeForBlock(BlockState state); /** @param facade The {@link IFacade} instance. NOTE: This MUST be an object returned from * {@link IFacadeRegistry#createBasicFacade(IFacadeState, boolean)} or @@ -32,4 +32,6 @@ default FacadeType getFacadeType(@Nonnull ItemStack stack) { @Nullable IFacade getFacade(@Nonnull ItemStack facade); + + ItemStack createItemStack(IFacade state); } diff --git a/api/buildcraft/api/facades/IFacadePhasedState.java b/api/buildcraft/api/facades/IFacadePhasedState.java index e576e09..f1ffefe 100644 --- a/api/buildcraft/api/facades/IFacadePhasedState.java +++ b/api/buildcraft/api/facades/IFacadePhasedState.java @@ -1,12 +1,12 @@ package buildcraft.api.facades; -import javax.annotation.Nullable; +import net.minecraft.item.DyeColor; -import net.minecraft.item.EnumDyeColor; +import javax.annotation.Nullable; public interface IFacadePhasedState { IFacadeState getState(); @Nullable - EnumDyeColor getActiveColor(); + DyeColor getActiveColor(); } diff --git a/api/buildcraft/api/facades/IFacadeRegistry.java b/api/buildcraft/api/facades/IFacadeRegistry.java index c0e53f3..3faecb3 100644 --- a/api/buildcraft/api/facades/IFacadeRegistry.java +++ b/api/buildcraft/api/facades/IFacadeRegistry.java @@ -1,16 +1,15 @@ package buildcraft.api.facades; -import java.util.Collection; +import net.minecraft.item.DyeColor; import javax.annotation.Nullable; - -import net.minecraft.item.EnumDyeColor; +import java.util.Collection; public interface IFacadeRegistry { Collection getValidFacades(); - IFacadePhasedState createPhasedState(IFacadeState state, @Nullable EnumDyeColor activeColor); + IFacadePhasedState createPhasedState(IFacadeState state, @Nullable DyeColor activeColor); IFacade createPhasedFacade(IFacadePhasedState[] states, boolean isHollow); diff --git a/api/buildcraft/api/facades/IFacadeState.java b/api/buildcraft/api/facades/IFacadeState.java index cf7ad7f..21dafbd 100644 --- a/api/buildcraft/api/facades/IFacadeState.java +++ b/api/buildcraft/api/facades/IFacadeState.java @@ -1,12 +1,12 @@ package buildcraft.api.facades; -import net.minecraft.block.state.IBlockState; +import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; public interface IFacadeState { boolean isTransparent(); - IBlockState getBlockState(); + BlockState getBlockState(); ItemStack getRequiredStack(); } diff --git a/api/buildcraft/api/facades/package-info.java b/api/buildcraft/api/facades/package-info.java index ee3094d..7679c3a 100644 --- a/api/buildcraft/api/facades/package-info.java +++ b/api/buildcraft/api/facades/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.1", owner = "buildcraftapi_core", provides = "buildcraftapi_facades") +//@API(apiVersion = "1.1", owner = "buildcraftapi_core", provides = "buildcraftapi_facades") package buildcraft.api.facades; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/filler/IFilledTemplate.java b/api/buildcraft/api/filler/IFilledTemplate.java index d0b59d4..47b2f86 100644 --- a/api/buildcraft/api/filler/IFilledTemplate.java +++ b/api/buildcraft/api/filler/IFilledTemplate.java @@ -2,9 +2,7 @@ import net.minecraft.util.math.BlockPos; -/** - * Use methods of the interface as much as possible, implementation can do optimizations - */ +/** Use methods of the interface as much as possible, implementation can do optimizations */ public interface IFilledTemplate { BlockPos getSize(); diff --git a/api/buildcraft/api/filler/IFillerPattern.java b/api/buildcraft/api/filler/IFillerPattern.java index cd23730..107535d 100644 --- a/api/buildcraft/api/filler/IFillerPattern.java +++ b/api/buildcraft/api/filler/IFillerPattern.java @@ -4,14 +4,13 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.filler; -import javax.annotation.Nullable; - -import net.minecraft.util.math.BlockPos; - import buildcraft.api.core.render.ISprite; import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementParameter; import buildcraft.api.statements.containers.IFillerStatementContainer; +import net.minecraft.util.math.BlockPos; + +import javax.annotation.Nullable; /** A type of statement that is used for filler patterns. */ public interface IFillerPattern extends IStatement { diff --git a/api/buildcraft/api/filler/IFillerPatternShape.java b/api/buildcraft/api/filler/IFillerPatternShape.java index b51e253..364b2dd 100644 --- a/api/buildcraft/api/filler/IFillerPatternShape.java +++ b/api/buildcraft/api/filler/IFillerPatternShape.java @@ -4,12 +4,11 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.filler; -import javax.annotation.Nullable; - -import net.minecraft.world.World; - import buildcraft.api.statements.IStatementParameter; import buildcraft.api.statements.containers.IFillerStatementContainer; +import net.minecraft.world.World; + +import javax.annotation.Nullable; /** {@code IFillerPattern} independent from {@link World} */ public interface IFillerPatternShape extends IFillerPattern { @@ -23,8 +22,8 @@ public interface IFillerPatternShape extends IFillerPattern { @Override default IFilledTemplate createTemplate(IFillerStatementContainer filler, IStatementParameter[] params) { IFilledTemplate template = FillerManager.registry.createFilledTemplate( - filler.getBox().min(), - filler.getBox().size() + filler.getBox().min(), + filler.getBox().size() ); if (!fillTemplate(template, params)) { return null; diff --git a/api/buildcraft/api/filler/IFillerRegistry.java b/api/buildcraft/api/filler/IFillerRegistry.java index fa49cb1..cd4984e 100644 --- a/api/buildcraft/api/filler/IFillerRegistry.java +++ b/api/buildcraft/api/filler/IFillerRegistry.java @@ -1,12 +1,10 @@ package buildcraft.api.filler; -import java.util.Collection; - -import javax.annotation.Nullable; - +import buildcraft.api.statements.IStatement; import net.minecraft.util.math.BlockPos; -import buildcraft.api.statements.IStatement; +import javax.annotation.Nullable; +import java.util.Collection; public interface IFillerRegistry { void addPattern(IFillerPattern pattern); diff --git a/api/buildcraft/api/filler/package-info.java b/api/buildcraft/api/filler/package-info.java index d5b3f2a..e76db5e 100644 --- a/api/buildcraft/api/filler/package-info.java +++ b/api/buildcraft/api/filler/package-info.java @@ -1,8 +1,6 @@ -/* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "5.0", owner = "buildcraftapi_core", provides = "buildcraftapi_filler") +//@API(apiVersion = "5.0", owner = "buildcraftapi_core", provides = "buildcraftapi_filler") package buildcraft.api.filler; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/fuels/BuildcraftFuelRegistry.java b/api/buildcraft/api/fuels/BuildcraftFuelRegistry.java index 545ac3d..107b26a 100644 --- a/api/buildcraft/api/fuels/BuildcraftFuelRegistry.java +++ b/api/buildcraft/api/fuels/BuildcraftFuelRegistry.java @@ -8,5 +8,6 @@ public final class BuildcraftFuelRegistry { public static IFuelManager fuel; public static ICoolantManager coolant; - private BuildcraftFuelRegistry() {} + private BuildcraftFuelRegistry() { + } } diff --git a/api/buildcraft/api/fuels/EnumCoolantType.java b/api/buildcraft/api/fuels/EnumCoolantType.java new file mode 100644 index 0000000..a5008d6 --- /dev/null +++ b/api/buildcraft/api/fuels/EnumCoolantType.java @@ -0,0 +1,17 @@ +package buildcraft.api.fuels; + +import java.util.Locale; + +public enum EnumCoolantType { + FLUID, + SOLID, + ; + + public String getLowerName() { + return this.name().toLowerCase(Locale.ROOT); + } + + public static EnumCoolantType byName(String name) { + return valueOf(name.toUpperCase(Locale.ROOT)); + } +} diff --git a/api/buildcraft/api/fuels/ICoolant.java b/api/buildcraft/api/fuels/ICoolant.java index f81a863..026fc34 100644 --- a/api/buildcraft/api/fuels/ICoolant.java +++ b/api/buildcraft/api/fuels/ICoolant.java @@ -1,16 +1,50 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.fuels; +import buildcraft.api.BCModules; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -public interface ICoolant { - boolean matchesFluid(FluidStack fluid); +public interface ICoolant extends IRecipe { + public static final ResourceLocation TYPE_ID = new ResourceLocation(BCModules.ENERGY.getModId(), "coolant"); - /** @param fluid - * @param heat - * @return 0 if the input fluid provides no cooling, or a value greater than 0 if it does. */ - float getDegreesCoolingPerMB(FluidStack fluid, float heat); + public static final IRecipeType TYPE = IRecipeType.register(TYPE_ID.toString()); + + EnumCoolantType getCoolantType(); + + FluidStack getFluid(); + + @Override + default boolean matches(IInventory inv, World world) { + return false; + } + + @Override + default ItemStack assemble(IInventory inv) { + return ItemStack.EMPTY; + } + + @Override + default boolean canCraftInDimensions(int width, int height) { + return true; + } + + @Override + default ItemStack getResultItem() { + return ItemStack.EMPTY; + } + + @Override + default boolean isSpecial() { + return true; + } + + @Override + default IRecipeType getType() { + return TYPE; + } } diff --git a/api/buildcraft/api/fuels/ICoolantManager.java b/api/buildcraft/api/fuels/ICoolantManager.java index dfcf78b..f2f952f 100644 --- a/api/buildcraft/api/fuels/ICoolantManager.java +++ b/api/buildcraft/api/fuels/ICoolantManager.java @@ -1,36 +1,48 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.fuels; -import java.util.Collection; - +import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.Fluid; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import java.util.Collection; + public interface ICoolantManager { - ICoolant addCoolant(ICoolant coolant); + // IFluidCoolant addCoolant(IFluidCoolant coolant); + IFluidCoolant addUnregisteredFluidCoolant(IFluidCoolant coolant); - ICoolant addCoolant(FluidStack fluid, float degreesCoolingPerMb); + // IFluidCoolant addCoolant(FluidStack fluid, float degreesCoolingPerMb); + IFluidCoolant addCoolant(ResourceLocation id, FluidStack fluid, float degreesCoolingPerMb); - default ICoolant addCoolant(Fluid fluid, float degreesCoolingPerMb) { - return addCoolant(new FluidStack(fluid, 1), degreesCoolingPerMb); + // default IFluidCoolant addCoolant(Fluid fluid, float degreesCoolingPerMb) + default IFluidCoolant addCoolant(ResourceLocation id, Fluid fluid, float degreesCoolingPerMb) { +// return addCoolant(new FluidStack(fluid, 1), degreesCoolingPerMb); + return addCoolant(id, new FluidStack(fluid, 1), degreesCoolingPerMb); } - ISolidCoolant addSolidCoolant(ISolidCoolant solidCoolant); + // ISolidCoolant addSolidCoolant(ISolidCoolant solidCoolant); + ISolidCoolant addUnregisteredSolidCoolant(ISolidCoolant solidCoolant); - ISolidCoolant addSolidCoolant(ItemStack solid, FluidStack fluid, float multiplier); + // ISolidCoolant addSolidCoolant(ItemStack solid, FluidStack fluid, float multiplier); + ISolidCoolant addSolidCoolant(ResourceLocation id, ItemStack solid, FluidStack fluid, float multiplier); - Collection getCoolants(); + // Collection getCoolants(); + Collection getCoolants(World world); - Collection getSolidCoolants(); + // Collection getSolidCoolants(); + Collection getSolidCoolants(World world); - ICoolant getCoolant(FluidStack fluid); + // IFluidCoolant getCoolant(FluidStack fluid); + IFluidCoolant getCoolant(World world, FluidStack fluid); - float getDegreesPerMb(FluidStack fluid, float heat); + // float getDegreesPerMb(FluidStack fluid, float heat); + float getDegreesPerMb(World world, FluidStack fluid, float heat); - ISolidCoolant getSolidCoolant(ItemStack solid); + // ISolidCoolant getSolidCoolant(ItemStack solid); + ISolidCoolant getSolidCoolant(World world, ItemStack solid); } diff --git a/api/buildcraft/api/fuels/IFluidCoolant.java b/api/buildcraft/api/fuels/IFluidCoolant.java new file mode 100644 index 0000000..b0fee8d --- /dev/null +++ b/api/buildcraft/api/fuels/IFluidCoolant.java @@ -0,0 +1,24 @@ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ +package buildcraft.api.fuels; + +import net.minecraftforge.fluids.FluidStack; + +/** + * This was named ICoolant in 1.12.2. + * In 1.18.2, we differ coolants as {@link EnumCoolantType#FLUID} AND {@link EnumCoolantType#SOLID}., + * {@link IFluidCoolant} and {@link ISolidCoolant} both extends {@link ICoolant}. + */ +public interface IFluidCoolant extends ICoolant { + boolean matchesFluid(FluidStack fluid); + + /** @param fluid + * @param heat + * @return 0 if the input fluid provides no cooling, or a value greater than 0 if it does. */ + float getDegreesCoolingPerMB(FluidStack fluid, float heat); + + /** @return The degrees-of-cooling-per-mb value of the recipe, ignoring whether a correct input is present. */ + float getDegreesCoolingPerMB(); +} diff --git a/api/buildcraft/api/fuels/IFuel.java b/api/buildcraft/api/fuels/IFuel.java index 382eb2a..9f370e0 100644 --- a/api/buildcraft/api/fuels/IFuel.java +++ b/api/buildcraft/api/fuels/IFuel.java @@ -1,13 +1,25 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.fuels; +import buildcraft.api.BCModules; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -public interface IFuel { - /** @return The input fluid. The {@link FluidStack#amount} is ignored. */ +//public interface IFuel +public interface IFuel extends IRecipe { + public static final ResourceLocation TYPE_ID = new ResourceLocation(BCModules.ENERGY.getModId(), "fuel"); + + public static final IRecipeType TYPE = IRecipeType.register(TYPE_ID.toString()); + + /** @return The input fluid. The {@link FluidStack#getAmount()} is ignored. */ FluidStack getFluid(); /** @return The number of ticks that a single bucket (1000mb) of this fuel will burn for. */ @@ -15,4 +27,34 @@ public interface IFuel { /** @return The amount (in micro mj) of power that this fuel will give off in 1 tick. */ long getPowerPerCycle(); + + @Override + default boolean matches(IInventory inv, World world) { + return false; + } + + @Override + default ItemStack assemble(IInventory inv) { + return ItemStack.EMPTY; + } + + @Override + default boolean canCraftInDimensions(int width, int height) { + return true; + } + + @Override + default ItemStack getResultItem() { + return ItemStack.EMPTY; + } + + @Override + default boolean isSpecial() { + return true; + } + + @Override + default IRecipeType getType() { + return TYPE; + } } diff --git a/api/buildcraft/api/fuels/IFuelManager.java b/api/buildcraft/api/fuels/IFuelManager.java index cb02063..abc0b32 100644 --- a/api/buildcraft/api/fuels/IFuelManager.java +++ b/api/buildcraft/api/fuels/IFuelManager.java @@ -1,34 +1,45 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.fuels; -import java.util.Collection; - -import net.minecraftforge.fluids.Fluid; +import net.minecraft.fluid.Fluid; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import java.util.Collection; + public interface IFuelManager { - F addFuel(F fuel); + // F addFuel(F fuel); + F addUnregisteredFuel(F fuel); - IFuel addFuel(FluidStack fluid, long powerPerCycle, int totalBurningTime); + // IFuel addFuel(FluidStack fluid, long powerPerCycle, int totalBurningTime); + IFuel addUnregisteredFuel(ResourceLocation id, FluidStack fluid, long powerPerCycle, int totalBurningTime); - default IFuel addFuel(Fluid fluid, long powerPerCycle, int totalBurningTime) { - return addFuel(new FluidStack(fluid, 1), powerPerCycle, totalBurningTime); + // default IFuel addFuel(Fluid fluid, long powerPerCycle, int totalBurningTime) + default IFuel addUnregisteredFuel(ResourceLocation id, Fluid fluid, long powerPerCycle, int totalBurningTime) { +// return addFuel(new FluidStack(fluid, 1), powerPerCycle, totalBurningTime); + return addUnregisteredFuel(id, new FluidStack(fluid, 1), powerPerCycle, totalBurningTime); } /** @param residue The residue fluidstack, per bucket of the original fuel. */ - IDirtyFuel addDirtyFuel(FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue); +// IDirtyFuel addDirtyFuel(FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue); + IDirtyFuel addUnregisteredDirtyFuel(ResourceLocation id, FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue); /** @param residue The residue fluidstack, per bucket of the original fuel. */ - default IDirtyFuel addDirtyFuel(Fluid fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) { - return addDirtyFuel(new FluidStack(fuel, 1), powerPerCycle, totalBurningTime, residue); +// default IDirtyFuel addDirtyFuel(Fluid fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) + default IDirtyFuel addUnregisteredDirtyFuel(ResourceLocation id, Fluid fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) { +// return addDirtyFuel(new FluidStack(fuel, 1), powerPerCycle, totalBurningTime, residue); + return addUnregisteredDirtyFuel(id, new FluidStack(fuel, 1), powerPerCycle, totalBurningTime, residue); } - Collection getFuels(); + // Collection getFuels(); + Collection getFuels(World world); - IFuel getFuel(FluidStack fluid); + // IFuel getFuel(FluidStack fluid); + IFuel getFuel(World world, FluidStack fluid); interface IDirtyFuel extends IFuel { /** @return The residue fluidstack, per bucket of original fuel. */ diff --git a/api/buildcraft/api/fuels/ISolidCoolant.java b/api/buildcraft/api/fuels/ISolidCoolant.java index 2b466ef..a9c1ff0 100644 --- a/api/buildcraft/api/fuels/ISolidCoolant.java +++ b/api/buildcraft/api/fuels/ISolidCoolant.java @@ -1,13 +1,16 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.fuels; import net.minecraft.item.ItemStack; - import net.minecraftforge.fluids.FluidStack; -public interface ISolidCoolant { +public interface ISolidCoolant extends ICoolant { FluidStack getFluidFromSolidCoolant(ItemStack stack); + + float getMultiplier(); + + ItemStack getSolid(); } diff --git a/api/buildcraft/api/fuels/package-info.java b/api/buildcraft/api/fuels/package-info.java index b108eae..1515996 100644 --- a/api/buildcraft/api/fuels/package-info.java +++ b/api/buildcraft/api/fuels/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.0", owner = "buildcraftapi_core", provides = "buildcraftapi_fuels") +//@API(apiVersion = "2.0", owner = "buildcraftapi_core", provides = "buildcraftapi_fuels") package buildcraft.api.fuels; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/gates/IGate.java b/api/buildcraft/api/gates/IGate.java index 2d9302c..0350649 100644 --- a/api/buildcraft/api/gates/IGate.java +++ b/api/buildcraft/api/gates/IGate.java @@ -4,14 +4,14 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.gates; -import java.util.List; - import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementParameter; import buildcraft.api.statements.StatementSlot; import buildcraft.api.statements.containers.ISidedStatementContainer; import buildcraft.api.transport.pipe.IPipeHolder; +import java.util.List; + public interface IGate extends ISidedStatementContainer { IPipeHolder getPipeHolder(); diff --git a/api/buildcraft/api/gates/package-info.java b/api/buildcraft/api/gates/package-info.java index 63d9988..5b5928c 100644 --- a/api/buildcraft/api/gates/package-info.java +++ b/api/buildcraft/api/gates/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "4.1", owner = "buildcraftapi_core", provides = "buildcraftapi_gates") +//@API(apiVersion = "4.1", owner = "buildcraftapi_core", provides = "buildcraftapi_gates") package buildcraft.api.gates; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/imc/BcImcMessage.java b/api/buildcraft/api/imc/BcImcMessage.java new file mode 100644 index 0000000..e949666 --- /dev/null +++ b/api/buildcraft/api/imc/BcImcMessage.java @@ -0,0 +1,32 @@ +package buildcraft.api.imc; + +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.ResourceLocation; + +import javax.annotation.Nonnull; + +/** Used in {@link buildcraft.api.facades.FacadeAPI} */ +public class BcImcMessage { + @Nonnull + private final Object value; + + public BcImcMessage(@Nonnull Object value) { + this.value = value; + } + + public ResourceLocation getResourceLocationValue() { + return (ResourceLocation) value; + } + + public CompoundNBT getNBTValue() { + return (CompoundNBT) value; + } + + public boolean isNBTMessage() { + return CompoundNBT.class.isAssignableFrom(getMessageType()); + } + + public Class getMessageType() { + return value.getClass(); + } +} diff --git a/api/buildcraft/api/inventory/IItemHandlerFiltered.java b/api/buildcraft/api/inventory/IItemHandlerFiltered.java index 8672d1d..664eede 100644 --- a/api/buildcraft/api/inventory/IItemHandlerFiltered.java +++ b/api/buildcraft/api/inventory/IItemHandlerFiltered.java @@ -1,7 +1,6 @@ package buildcraft.api.inventory; import net.minecraft.item.ItemStack; - import net.minecraftforge.items.IItemHandler; /** A type of {@link IItemHandler} that has a single valid stack per slot, as specified by {@link #getFilter(int)}. Note diff --git a/api/buildcraft/api/inventory/IItemTransactor.java b/api/buildcraft/api/inventory/IItemTransactor.java index 212d2e3..d503782 100644 --- a/api/buildcraft/api/inventory/IItemTransactor.java +++ b/api/buildcraft/api/inventory/IItemTransactor.java @@ -1,12 +1,11 @@ package buildcraft.api.inventory; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import buildcraft.api.core.IStackFilter; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; -import buildcraft.api.core.IStackFilter; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** A simple way to define something that deals with item insertion and extraction, without caring about slots. */ public interface IItemTransactor { @@ -19,7 +18,7 @@ public interface IItemTransactor { /** Similar to {@link #insert(ItemStack, boolean, boolean)} but probably be more efficient at inserting lots of * items. - * + * * @param stacks The stacks to insert. Must not be null! * @param simulate If true then the in-world state of this will not be changed. * @return The overflow stacks. Will be an empty list if all of it was accepted. */ @@ -35,7 +34,7 @@ default NonNullList insert(NonNullList stacks, boolean sim } /** Extracts a number of items that match the given filter - * + * * @param filter The filter that MUST be met by the extracted stack. Null means no filter - it can be any item. * @param min The minimum number of items to extract, or 0 if not enough items can be extracted * @param max The maximum number of items to extract. diff --git a/api/buildcraft/api/items/FluidItemDrops.java b/api/buildcraft/api/items/FluidItemDrops.java index de82f18..7504c65 100644 --- a/api/buildcraft/api/items/FluidItemDrops.java +++ b/api/buildcraft/api/items/FluidItemDrops.java @@ -2,18 +2,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; - import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidTank; +import net.minecraftforge.fml.RegistryObject; public class FluidItemDrops { - - public static IItemFluidShard item; + public static RegistryObject item; public static void addFluidDrops(NonNullList toDrop, FluidStack... fluids) { if (item != null) { for (FluidStack fluid : fluids) { - item.addFluidDrops(toDrop, fluid); + item.get().addFluidDrops(toDrop, fluid); } } } @@ -21,7 +20,7 @@ public static void addFluidDrops(NonNullList toDrop, FluidStack... fl public static void addFluidDrops(NonNullList toDrop, IFluidTank... tanks) { if (item != null) { for (IFluidTank tank : tanks) { - item.addFluidDrops(toDrop, tank.getFluid()); + item.get().addFluidDrops(toDrop, tank.getFluid()); } } } diff --git a/api/buildcraft/api/items/IChipset.java b/api/buildcraft/api/items/IChipset.java new file mode 100644 index 0000000..8914f84 --- /dev/null +++ b/api/buildcraft/api/items/IChipset.java @@ -0,0 +1,7 @@ +package buildcraft.api.items; + +import buildcraft.api.enums.EnumRedstoneChipset; + +public interface IChipset { + EnumRedstoneChipset getType(); +} diff --git a/api/buildcraft/api/items/IItemCustomPipeRender.java b/api/buildcraft/api/items/IItemCustomPipeRender.java index 697b875..b047cf3 100644 --- a/api/buildcraft/api/items/IItemCustomPipeRender.java +++ b/api/buildcraft/api/items/IItemCustomPipeRender.java @@ -1,14 +1,13 @@ package buildcraft.api.items; import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public interface IItemCustomPipeRender { float getPipeRenderScale(ItemStack stack); /** @return False to use the default renderer, true otherwise. */ - @SideOnly(Side.CLIENT) + @OnlyIn(Dist.CLIENT) boolean renderItemInPipe(ItemStack stack, double x, double y, double z); } diff --git a/api/buildcraft/api/items/IItemFluidShard.java b/api/buildcraft/api/items/IItemFluidShard.java index 0557f6b..25fb86c 100644 --- a/api/buildcraft/api/items/IItemFluidShard.java +++ b/api/buildcraft/api/items/IItemFluidShard.java @@ -1,12 +1,11 @@ package buildcraft.api.items; -import javax.annotation.Nullable; - import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; - import net.minecraftforge.fluids.FluidStack; +import javax.annotation.Nullable; + public interface IItemFluidShard { void addFluidDrops(NonNullList toDrop, @Nullable FluidStack fluid); } diff --git a/api/buildcraft/api/items/IList.java b/api/buildcraft/api/items/IList.java index 1456d24..3089af7 100644 --- a/api/buildcraft/api/items/IList.java +++ b/api/buildcraft/api/items/IList.java @@ -1,9 +1,9 @@ package buildcraft.api.items; -import javax.annotation.Nonnull; - import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + public interface IList extends INamedItem { boolean matches(@Nonnull ItemStack stackList, @Nonnull ItemStack item); } diff --git a/api/buildcraft/api/items/IMapLocation.java b/api/buildcraft/api/items/IMapLocation.java index cb5dba5..1689751 100644 --- a/api/buildcraft/api/items/IMapLocation.java +++ b/api/buildcraft/api/items/IMapLocation.java @@ -1,15 +1,13 @@ package buildcraft.api.items; -import java.util.List; - -import javax.annotation.Nonnull; - +import buildcraft.api.core.IBox; +import buildcraft.api.core.IZone; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import buildcraft.api.core.IBox; -import buildcraft.api.core.IZone; +import javax.annotation.Nonnull; +import java.util.List; /** Created by asie on 2/28/15. */ public interface IMapLocation extends INamedItem { @@ -25,7 +23,7 @@ enum MapLocationType { public final int meta = ordinal(); public static MapLocationType getFromStack(@Nonnull ItemStack stack) { - int dam = stack.getItemDamage(); + int dam = stack.getDamageValue(); if (dam < 0 || dam >= values().length) { return MapLocationType.CLEAN; } @@ -33,37 +31,37 @@ public static MapLocationType getFromStack(@Nonnull ItemStack stack) { } public void setToStack(@Nonnull ItemStack stack) { - stack.setItemDamage(meta); + stack.setDamageValue(meta); } } /** This function can be used for SPOT types. - * + * * @param stack * @return The point representing the map location. */ BlockPos getPoint(@Nonnull ItemStack stack); /** This function can be used for SPOT and AREA types. - * + * * @param stack * @return The box representing the map location. */ IBox getBox(@Nonnull ItemStack stack); /** This function can be used for SPOT, AREA and ZONE types. The PATH type needs to be handled separately. - * + * * @param stack * @return An IZone representing the map location - also an instance of IBox for SPOT and AREA types. */ IZone getZone(@Nonnull ItemStack stack); /** This function can be used for SPOT and PATH types. - * + * * @param stack * @return A list of BlockPoses representing the path the Map Location stores. */ List getPath(@Nonnull ItemStack stack); /** This function can be used for SPOT types only. - * + * * @param stack * @return The side of the spot. */ - EnumFacing getPointSide(@Nonnull ItemStack stack); + Direction getPointSide(@Nonnull ItemStack stack); } diff --git a/api/buildcraft/api/items/INamedItem.java b/api/buildcraft/api/items/INamedItem.java index 87c3420..9efd341 100644 --- a/api/buildcraft/api/items/INamedItem.java +++ b/api/buildcraft/api/items/INamedItem.java @@ -1,11 +1,12 @@ package buildcraft.api.items; -import javax.annotation.Nonnull; - import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + public interface INamedItem { - String getName(@Nonnull ItemStack stack); + // ITextComponent getName(@Nonnull ItemStack stack); + String getName_INamedItem(@Nonnull ItemStack stack); boolean setName(@Nonnull ItemStack stack, String name); } diff --git a/api/buildcraft/api/items/package-info.java b/api/buildcraft/api/items/package-info.java index 883db47..8747597 100644 --- a/api/buildcraft/api/items/package-info.java +++ b/api/buildcraft/api/items/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.1", owner = "buildcraftapi_core", provides = "buildcraftapi_items") +//@API(apiVersion = "1.1", owner = "buildcraftapi_core", provides = "buildcraftapi_items") package buildcraft.api.items; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/library/ILibraryTypeHandler.java b/api/buildcraft/api/library/ILibraryTypeHandler.java deleted file mode 100644 index 8616d10..0000000 --- a/api/buildcraft/api/library/ILibraryTypeHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package buildcraft.api.library; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public interface ILibraryTypeHandler { - boolean isHandler(ItemStack stack, boolean store); - - String getFileExtension(); - - int getTextColor(); - - String getName(ItemStack stack); - - ItemStack load(ItemStack stack, NBTTagCompound compound); - - boolean store(ItemStack stack, NBTTagCompound compound); -} diff --git a/api/buildcraft/api/library/LibraryAPI.java b/api/buildcraft/api/library/LibraryAPI.java deleted file mode 100644 index b899793..0000000 --- a/api/buildcraft/api/library/LibraryAPI.java +++ /dev/null @@ -1,30 +0,0 @@ -package buildcraft.api.library; - -import java.util.HashSet; -import java.util.Set; - -@Deprecated -public final class LibraryAPI { - private static final Set handlers = new HashSet<>(); - - private LibraryAPI() { - - } - - public static Set getHandlerSet() { - return handlers; - } - - public static void registerHandler(LibraryTypeHandler handler) { - handlers.add(handler); - } - - public static LibraryTypeHandler getHandlerFor(String extension) { - for (LibraryTypeHandler h : handlers) { - if (h.isInputExtension(extension)) { - return h; - } - } - return null; - } -} diff --git a/api/buildcraft/api/library/LibraryTypeHandler.java b/api/buildcraft/api/library/LibraryTypeHandler.java deleted file mode 100644 index 08db4f6..0000000 --- a/api/buildcraft/api/library/LibraryTypeHandler.java +++ /dev/null @@ -1,31 +0,0 @@ -package buildcraft.api.library; - -import net.minecraft.item.ItemStack; - -@Deprecated -public abstract class LibraryTypeHandler { - public enum HandlerType { - LOAD, - STORE - } - - private final String extension; - - public LibraryTypeHandler(String extension) { - this.extension = extension; - } - - public abstract boolean isHandler(ItemStack stack, HandlerType type); - - public boolean isInputExtension(String ext) { - return extension.equals(ext); - } - - public String getOutputExtension() { - return extension; - } - - public abstract int getTextColor(); - - public abstract String getName(ItemStack stack); -} diff --git a/api/buildcraft/api/library/LibraryTypeHandlerByteArray.java b/api/buildcraft/api/library/LibraryTypeHandlerByteArray.java deleted file mode 100644 index c7c5e23..0000000 --- a/api/buildcraft/api/library/LibraryTypeHandlerByteArray.java +++ /dev/null @@ -1,13 +0,0 @@ -package buildcraft.api.library; - -import net.minecraft.item.ItemStack; - -public abstract class LibraryTypeHandlerByteArray extends LibraryTypeHandler { - public LibraryTypeHandlerByteArray(String extension) { - super(extension); - } - - public abstract ItemStack load(ItemStack stack, byte[] data); - - public abstract byte[] store(ItemStack stack); -} diff --git a/api/buildcraft/api/library/LibraryTypeHandlerNBT.java b/api/buildcraft/api/library/LibraryTypeHandlerNBT.java deleted file mode 100644 index a656ff7..0000000 --- a/api/buildcraft/api/library/LibraryTypeHandlerNBT.java +++ /dev/null @@ -1,14 +0,0 @@ -package buildcraft.api.library; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public abstract class LibraryTypeHandlerNBT extends LibraryTypeHandler { - public LibraryTypeHandlerNBT(String extension) { - super(extension); - } - - public abstract ItemStack load(ItemStack stack, NBTTagCompound nbt); - - public abstract boolean store(ItemStack stack, NBTTagCompound nbt); -} diff --git a/api/buildcraft/api/library/package-info.java b/api/buildcraft/api/library/package-info.java deleted file mode 100644 index ecf627f..0000000 --- a/api/buildcraft/api/library/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.0", owner = "buildcraftapi_core", provides = "buildcraftapi_library") -package buildcraft.api.library; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/lists/ListMatchHandler.java b/api/buildcraft/api/lists/ListMatchHandler.java index e35a680..70bcf34 100644 --- a/api/buildcraft/api/lists/ListMatchHandler.java +++ b/api/buildcraft/api/lists/ListMatchHandler.java @@ -1,11 +1,11 @@ package buildcraft.api.lists; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + public abstract class ListMatchHandler { public enum Type { TYPE, @@ -18,7 +18,7 @@ public enum Type { public abstract boolean isValidSource(Type type, @Nonnull ItemStack stack); /** Get custom client examples. - * + * * @param type * @param stack * @return A List (even empty!) if the examples satisfy this handler, null if iteration and .matches should be used diff --git a/api/buildcraft/api/lists/ListRegistry.java b/api/buildcraft/api/lists/ListRegistry.java index 38a9166..6f31442 100644 --- a/api/buildcraft/api/lists/ListRegistry.java +++ b/api/buildcraft/api/lists/ListRegistry.java @@ -1,11 +1,11 @@ package buildcraft.api.lists; +import net.minecraft.item.Item; + import java.util.ArrayList; import java.util.Collections; import java.util.List; -import net.minecraft.item.Item; - public final class ListRegistry { public static final List> itemClassAsType = new ArrayList<>(); private static final List handlers = new ArrayList<>(); diff --git a/api/buildcraft/api/lists/package-info.java b/api/buildcraft/api/lists/package-info.java index b953535..a4456d8 100644 --- a/api/buildcraft/api/lists/package-info.java +++ b/api/buildcraft/api/lists/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.0", owner = "buildcraftapi_core", provides = "buildcraftapi_lists") +//@API(apiVersion = "1.0", owner = "buildcraftapi_core", provides = "buildcraftapi_lists") package buildcraft.api.lists; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/mj/ILaserTarget.java b/api/buildcraft/api/mj/ILaserTarget.java index e1fbfb4..981c1db 100644 --- a/api/buildcraft/api/mj/ILaserTarget.java +++ b/api/buildcraft/api/mj/ILaserTarget.java @@ -7,6 +7,7 @@ /** This interface should be defined by any Tile which wants to receive power from BuildCraft lasers. * * The respective Block MUST implement ILaserTargetBlock! */ +//@ILaserTargetAnnotation // Calen public interface ILaserTarget { /** Returns The amount of power this target currently needs. diff --git a/api/buildcraft/api/mj/IMjConnector.java b/api/buildcraft/api/mj/IMjConnector.java index 3c5f997..713599d 100644 --- a/api/buildcraft/api/mj/IMjConnector.java +++ b/api/buildcraft/api/mj/IMjConnector.java @@ -3,12 +3,12 @@ import javax.annotation.Nonnull; /** Signifies that this should visibly connect to other Mj handling entities/tiles. This should NEVER be the tile - * entity, but an encapsulated class that refers back to it. Use {@link buildcraft.api.mj.MjAPI#CAP_CONNECTOR} to access + * entity, but an encapsulated class that refers back to it. Use {@link MjAPI#CAP_CONNECTOR} to access * this. */ public interface IMjConnector { /** Checks to see if this connector can connect to the other connector. By default this should check that the other * connector is the same power system. - * + * * @param other * @return */ boolean canConnect(@Nonnull IMjConnector other); diff --git a/api/buildcraft/api/mj/IMjEffectManager.java b/api/buildcraft/api/mj/IMjEffectManager.java index c7fb899..b6062f3 100644 --- a/api/buildcraft/api/mj/IMjEffectManager.java +++ b/api/buildcraft/api/mj/IMjEffectManager.java @@ -1,15 +1,15 @@ package buildcraft.api.mj; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.Direction; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; /** Various effects for showing power loss visibly, and for large amounts of power, causes some damage to nearby * entities. */ public interface IMjEffectManager { - void createPowerLossEffect(World world, Vec3d center, long microJoulesLost); + void createPowerLossEffect(World world, Vector3d center, long microJoulesLost); - void createPowerLossEffect(World world, Vec3d center, EnumFacing direction, long microJoulesLost); + void createPowerLossEffect(World world, Vector3d center, Direction direction, long microJoulesLost); - void createPowerLossEffect(World world, Vec3d center, Vec3d direction, long microJoulesLost); + void createPowerLossEffect(World world, Vector3d center, Vector3d direction, long microJoulesLost); } diff --git a/api/buildcraft/api/mj/IMjPassiveProvider.java b/api/buildcraft/api/mj/IMjPassiveProvider.java index 55b33c6..e6df834 100644 --- a/api/buildcraft/api/mj/IMjPassiveProvider.java +++ b/api/buildcraft/api/mj/IMjPassiveProvider.java @@ -4,7 +4,7 @@ * engine). Power can be extracted from this by powered wooden kinesis pipes, for example. */ public interface IMjPassiveProvider extends IMjConnector { /** Attempts to extract power from this provider - * + * * @param simulate * @return Either 0, min, max, or a value between min and max. */ long extractPower(long min, long max, boolean simulate); diff --git a/api/buildcraft/api/mj/IMjReceiver.java b/api/buildcraft/api/mj/IMjReceiver.java index a8cecd7..750640e 100644 --- a/api/buildcraft/api/mj/IMjReceiver.java +++ b/api/buildcraft/api/mj/IMjReceiver.java @@ -11,10 +11,10 @@ public interface IMjReceiver extends IMjConnector { *

  • Store all power in something like an {@link MjBattery} for later usage. *
  • Refuse all power (if you have no more work to do or your {@link MjBattery} is full). * - * + * * Note that callers are NOT expected to call {@link #canReceive()} before calling this - implementors should check * all of the conditions in {@link #canReceive()} before accepting power. - * + * * @param microJoules The number of micro joules to add. * @param simulate If true then just pretend you received power- don't actually change any of your internal state. * @return The excess power. */ @@ -22,7 +22,7 @@ public interface IMjReceiver extends IMjConnector { /** Checks to see if {@link #receivePower(long, boolean)} *might* accept any power right now, ignoring the amount of * power contained right now (if any). - * + * * @return True if this {@link IMjReceiver} can receive power right now. */ default boolean canReceive() { return true; diff --git a/api/buildcraft/api/mj/IMjRedstoneReceiver.java b/api/buildcraft/api/mj/IMjRedstoneReceiver.java index 11eb5de..f0e892e 100644 --- a/api/buildcraft/api/mj/IMjRedstoneReceiver.java +++ b/api/buildcraft/api/mj/IMjRedstoneReceiver.java @@ -1,4 +1,5 @@ package buildcraft.api.mj; /** Designates that a receiver can receive redstone power (cheap, free, small amounts) */ -public interface IMjRedstoneReceiver extends IMjReceiver {} +public interface IMjRedstoneReceiver extends IMjReceiver { +} diff --git a/api/buildcraft/api/mj/MjAPI.java b/api/buildcraft/api/mj/MjAPI.java index 1ed476e..c1344d8 100644 --- a/api/buildcraft/api/mj/MjAPI.java +++ b/api/buildcraft/api/mj/MjAPI.java @@ -1,16 +1,13 @@ package buildcraft.api.mj; -import java.text.DecimalFormat; - -import javax.annotation.Nonnull; - -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.Vec3d; +import buildcraft.api.core.CapabilitiesHelper; +import net.minecraft.util.Direction; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; - import net.minecraftforge.common.capabilities.Capability; -import buildcraft.api.core.CapabilitiesHelper; +import javax.annotation.Nonnull; +import java.text.DecimalFormat; public class MjAPI { @@ -53,14 +50,18 @@ private static String formatMjInternal(double val) { public enum NullaryEffectManager implements IMjEffectManager { INSTANCE; + @Override - public void createPowerLossEffect(World world, Vec3d center, long microJoulesLost) {} + public void createPowerLossEffect(World world, Vector3d center, long microJoulesLost) { + } @Override - public void createPowerLossEffect(World world, Vec3d center, EnumFacing direction, long microJoulesLost) {} + public void createPowerLossEffect(World world, Vector3d center, Direction direction, long microJoulesLost) { + } @Override - public void createPowerLossEffect(World world, Vec3d center, Vec3d direction, long microJoulesLost) {} + public void createPowerLossEffect(World world, Vector3d center, Vector3d direction, long microJoulesLost) { + } } // @formatter:on @@ -71,21 +72,22 @@ public void createPowerLossEffect(World world, Vec3d center, Vec3d direction, lo // ############### @Nonnull - public static final Capability CAP_CONNECTOR; + public static Capability CAP_CONNECTOR; @Nonnull - public static final Capability CAP_RECEIVER; + public static Capability CAP_RECEIVER; @Nonnull - public static final Capability CAP_REDSTONE_RECEIVER; + public static Capability CAP_REDSTONE_RECEIVER; @Nonnull - public static final Capability CAP_READABLE; + public static Capability CAP_READABLE; @Nonnull - public static final Capability CAP_PASSIVE_PROVIDER; + public static Capability CAP_PASSIVE_PROVIDER; - static { + //static + public static void regCaps() { CAP_CONNECTOR = CapabilitiesHelper.registerCapability(IMjConnector.class); CAP_RECEIVER = CapabilitiesHelper.registerCapability(IMjReceiver.class); CAP_REDSTONE_RECEIVER = CapabilitiesHelper.registerCapability(IMjRedstoneReceiver.class); diff --git a/api/buildcraft/api/mj/MjBattery.java b/api/buildcraft/api/mj/MjBattery.java index 68c2ea1..18bb878 100644 --- a/api/buildcraft/api/mj/MjBattery.java +++ b/api/buildcraft/api/mj/MjBattery.java @@ -1,17 +1,15 @@ package buildcraft.api.mj; import io.netty.buffer.ByteBuf; - -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; - import net.minecraftforge.common.util.INBTSerializable; /** Provides a basic implementation of a simple battery. Note that you should call {@link #tick(World, BlockPos)} or - * {@link #tick(World, Vec3d)} every tick to allow for losing excess power. */ -public class MjBattery implements INBTSerializable { + * {@link #tick(World, Vector3d)} every tick to allow for losing excess power. */ +public class MjBattery implements INBTSerializable { private final long capacity; private long microJoules = 0; @@ -20,14 +18,14 @@ public MjBattery(long capacity) { } @Override - public NBTTagCompound serializeNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setLong("stored", microJoules); + public CompoundNBT serializeNBT() { + CompoundNBT nbt = new CompoundNBT(); + nbt.putLong("stored", microJoules); return nbt; } @Override - public void deserializeNBT(NBTTagCompound nbt) { + public void deserializeNBT(CompoundNBT nbt) { microJoules = nbt.getLong("stored"); } @@ -47,7 +45,7 @@ public long addPower(long microJoulesToAdd, boolean simulate) { } /** Attempts to add power, but only if this is not already full. - * + * * @param microJoulesToAdd The power to add. * @return The excess power. */ public long addPowerChecking(long microJoulesToAdd, boolean simulate) { @@ -63,7 +61,7 @@ public long extractAll() { } /** Attempts to extract exactly the given amount of power. - * + * * @param power The amount of power to extract. * @return True if the power was removed, false if not. */ public boolean extractPower(long power) { @@ -90,16 +88,16 @@ public long getCapacity() { } public void tick(World world, BlockPos position) { - tick(world, new Vec3d(position.getX() + 0.5, position.getY() + 0.5, position.getZ() + 0.5)); + tick(world, new Vector3d(position.getX() + 0.5, position.getY() + 0.5, position.getZ() + 0.5)); } - public void tick(World world, Vec3d position) { + public void tick(World world, Vector3d position) { if (microJoules > capacity * 2) { losePower(world, position); } } - protected void losePower(World world, Vec3d position) { + protected void losePower(World world, Vector3d position) { long diff = microJoules - capacity * 2; long lost = ceilDivide(diff, 32); microJoules -= lost; diff --git a/api/buildcraft/api/mj/MjCapabilityHelper.java b/api/buildcraft/api/mj/MjCapabilityHelper.java index c70c74c..1ebb320 100644 --- a/api/buildcraft/api/mj/MjCapabilityHelper.java +++ b/api/buildcraft/api/mj/MjCapabilityHelper.java @@ -1,12 +1,12 @@ package buildcraft.api.mj; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import net.minecraft.util.EnumFacing; - +import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.common.util.LazyOptional; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** Provides a quick way to return all types of a single {@link IMjConnector} for all the different capabilities. */ public class MjCapabilityHelper implements ICapabilityProvider { @@ -34,28 +34,33 @@ public MjCapabilityHelper(@Nonnull IMjConnector mj) { this.provider = mj instanceof IMjPassiveProvider ? (IMjPassiveProvider) mj : null; } - @Override - public boolean hasCapability(@Nonnull Capability capability, EnumFacing facing) { - return getCapability(capability, facing) != null; - } +// @Override +// public boolean hasCapability(@Nonnull Capability capability, EnumFacing facing) { +// return getCapability(capability, facing) != null; +// } @Override - public T getCapability(@Nonnull Capability capability, EnumFacing facing) { + public LazyOptional getCapability(@Nonnull Capability capability, Direction facing) { if (capability == MjAPI.CAP_CONNECTOR) { - return MjAPI.CAP_CONNECTOR.cast(connector); +// return MjAPI.CAP_CONNECTOR.cast(connector); + return connector == null ? LazyOptional.empty() : LazyOptional.of(() -> connector).cast(); } if (capability == MjAPI.CAP_RECEIVER) { - return MjAPI.CAP_RECEIVER.cast(receiver); +// return MjAPI.CAP_RECEIVER.cast(receiver); + return receiver == null ? LazyOptional.empty() : LazyOptional.of(() -> receiver).cast(); } if (capability == MjAPI.CAP_REDSTONE_RECEIVER) { - return MjAPI.CAP_REDSTONE_RECEIVER.cast(rsReceiver); +// return MjAPI.CAP_REDSTONE_RECEIVER.cast(rsReceiver); + return rsReceiver == null ? LazyOptional.empty() : LazyOptional.of(() -> rsReceiver).cast(); } if (capability == MjAPI.CAP_READABLE) { - return MjAPI.CAP_READABLE.cast(readable); +// return MjAPI.CAP_READABLE.cast(readable); + return readable == null ? LazyOptional.empty() : LazyOptional.of(() -> readable).cast(); } if (capability == MjAPI.CAP_PASSIVE_PROVIDER) { - return MjAPI.CAP_PASSIVE_PROVIDER.cast(provider); +// return MjAPI.CAP_PASSIVE_PROVIDER.cast(provider); + return provider == null ? LazyOptional.empty() : LazyOptional.of(() -> provider).cast(); } - return null; + return LazyOptional.empty(); } } diff --git a/api/buildcraft/api/net/IMessage.java b/api/buildcraft/api/net/IMessage.java new file mode 100644 index 0000000..6833ba9 --- /dev/null +++ b/api/buildcraft/api/net/IMessage.java @@ -0,0 +1,21 @@ +package buildcraft.api.net; + +import buildcraft.api.core.BCLog; +import net.minecraft.network.PacketBuffer; + +public interface IMessage { + void fromBytes(PacketBuffer buf); + + void toBytes(PacketBuffer buf); + + public static IMessage staticFromBytes(Class clazz, PacketBuffer buf) { + try { + IMessage message = clazz.newInstance(); + message.fromBytes(buf); + return message; + } catch (Exception e) { + BCLog.logger.error(e); + return null; + } + } +} diff --git a/api/buildcraft/api/net/IMessageHandler.java b/api/buildcraft/api/net/IMessageHandler.java new file mode 100644 index 0000000..09f82c4 --- /dev/null +++ b/api/buildcraft/api/net/IMessageHandler.java @@ -0,0 +1,7 @@ +package buildcraft.api.net; + +import net.minecraftforge.fml.network.NetworkEvent; + +public interface IMessageHandler { + REPLY onMessage(REQ message, NetworkEvent.Context ctx); +} diff --git a/api/buildcraft/api/power/IEngine.java b/api/buildcraft/api/power/IEngine.java index c25037c..9e752ea 100644 --- a/api/buildcraft/api/power/IEngine.java +++ b/api/buildcraft/api/power/IEngine.java @@ -4,23 +4,23 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.power; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; /** Engines should implement this interface if they want to support BuildCraft's behaviour of passing power between * engines without using receivePower() (which has other issues). */ public interface IEngine { /** Returns true if the engine wants to receive power from another engine on this side. - * + * * @param side * @return */ - boolean canReceiveFromEngine(EnumFacing side); + boolean canReceiveFromEngine(Direction side); /** Receives power from an engine. * * @param microJoules The number of micro joules to add. * @param simulate If true then just pretend you received power- don't actually change any of your internal state. * @return True if all the power was accepted, false if not. - * + * * @see buildcraft.api.mj.IMjReceiver#receivePower(long, boolean) */ boolean receivePower(long microJoules, boolean simulate); } diff --git a/api/buildcraft/api/power/IRedstoneEngine.java b/api/buildcraft/api/power/IRedstoneEngine.java index 3fc534d..e942d61 100644 --- a/api/buildcraft/api/power/IRedstoneEngine.java +++ b/api/buildcraft/api/power/IRedstoneEngine.java @@ -4,4 +4,5 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.power; -public interface IRedstoneEngine {} +public interface IRedstoneEngine { +} diff --git a/api/buildcraft/api/power/package-info.java b/api/buildcraft/api/power/package-info.java index 66e7868..6f368b4 100644 --- a/api/buildcraft/api/power/package-info.java +++ b/api/buildcraft/api/power/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.3", owner = "buildcraftapi_core", provides = "buildcraftapi_power") +//@API(apiVersion = "1.3", owner = "buildcraftapi_core", provides = "buildcraftapi_power") package buildcraft.api.power; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/properties/BuildCraftProperties.java b/api/buildcraft/api/properties/BuildCraftProperties.java index a04b44e..c762c38 100644 --- a/api/buildcraft/api/properties/BuildCraftProperties.java +++ b/api/buildcraft/api/properties/BuildCraftProperties.java @@ -1,54 +1,46 @@ package buildcraft.api.properties; -import java.util.Map; - +import buildcraft.api.enums.*; import com.google.common.collect.Maps; +import net.minecraft.item.DyeColor; +import net.minecraft.state.BooleanProperty; +import net.minecraft.state.EnumProperty; +import net.minecraft.state.IntegerProperty; +import net.minecraft.state.Property; +import net.minecraft.util.Direction; -import net.minecraft.block.properties.IProperty; -import net.minecraft.block.properties.PropertyBool; -import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.EnumFacing; - -import buildcraft.api.enums.EnumDecoratedBlock; -import buildcraft.api.enums.EnumEngineType; -import buildcraft.api.enums.EnumLaserTableType; -import buildcraft.api.enums.EnumMachineState; -import buildcraft.api.enums.EnumOptionalSnapshotType; -import buildcraft.api.enums.EnumPowerStage; -import buildcraft.api.enums.EnumSpring; +import java.util.Map; public final class BuildCraftProperties { - public static final IProperty BLOCK_FACING = PropertyEnum.create("facing", EnumFacing.class, EnumFacing.Plane.HORIZONTAL.facings()); - public static final IProperty BLOCK_FACING_6 = PropertyEnum.create("facing", EnumFacing.class); + public static final Property BLOCK_FACING = EnumProperty.create("facing", Direction.class, new Direction[] { Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST }); + public static final Property BLOCK_FACING_6 = EnumProperty.create("facing", Direction.class); - public static final IProperty BLOCK_COLOR = PropertyEnum.create("color", EnumDyeColor.class); - public static final IProperty SPRING_TYPE = PropertyEnum.create("type", EnumSpring.class); - public static final IProperty ENGINE_TYPE = PropertyEnum.create("type", EnumEngineType.class); - public static final IProperty LASER_TABLE_TYPE = PropertyEnum.create("type", EnumLaserTableType.class); - public static final IProperty MACHINE_STATE = PropertyEnum.create("state", EnumMachineState.class); - public static final IProperty ENERGY_STAGE = PropertyEnum.create("stage", EnumPowerStage.class); - public static final IProperty SNAPSHOT_TYPE = PropertyEnum.create("snapshot_type", EnumOptionalSnapshotType.class); - public static final IProperty DECORATED_BLOCK = PropertyEnum.create("decoration_type", EnumDecoratedBlock.class); + public static final Property BLOCK_COLOR = EnumProperty.create("color", DyeColor.class); + // public static final EnumProperty SPRING_TYPE = EnumProperty.create("type", EnumSpring.class); +// public static final Property ENGINE_TYPE = EnumProperty.create("type", EnumEngineType.class); + public static final Property LASER_TABLE_TYPE = EnumProperty.create("type", EnumLaserTableType.class); + public static final Property MACHINE_STATE = EnumProperty.create("state", EnumMachineState.class); + public static final Property ENERGY_STAGE = EnumProperty.create("stage", EnumPowerStage.class); + public static final Property SNAPSHOT_TYPE = EnumProperty.create("snapshot_type", EnumOptionalSnapshotType.class); + public static final Property DECORATED_BLOCK = EnumProperty.create("decoration_type", EnumDecoratedBlock.class); - public static final IProperty GENERIC_PIPE_DATA = PropertyInteger.create("pipe_data", 0, 15); - public static final IProperty LED_POWER = PropertyInteger.create("led_power", 0, 3); + public static final Property GENERIC_PIPE_DATA = IntegerProperty.create("pipe_data", 0, 15); + public static final Property LED_POWER = IntegerProperty.create("led_power", 0, 3); - public static final IProperty JOINED_BELOW = PropertyBool.create("joined_below"); - public static final IProperty MOVING = PropertyBool.create("moving"); - public static final IProperty LED_DONE = PropertyBool.create("led_done"); - public static final IProperty ACTIVE = PropertyBool.create("active"); - public static final IProperty VALID = PropertyBool.create("valid"); + public static final Property JOINED_BELOW = BooleanProperty.create("joined_below"); // 这里的注册名就是model文件里的条件 + public static final Property MOVING = BooleanProperty.create("moving"); + public static final Property LED_DONE = BooleanProperty.create("led_done"); + // public static final Property ACTIVE = BooleanProperty.create("active"); // set but never used + public static final Property VALID = BooleanProperty.create("valid"); - public static final IProperty CONNECTED_UP = PropertyBool.create("connected_up"); - public static final IProperty CONNECTED_DOWN = PropertyBool.create("connected_down"); - public static final IProperty CONNECTED_EAST = PropertyBool.create("connected_east"); - public static final IProperty CONNECTED_WEST = PropertyBool.create("connected_west"); - public static final IProperty CONNECTED_NORTH = PropertyBool.create("connected_north"); - public static final IProperty CONNECTED_SOUTH = PropertyBool.create("connected_south"); + public static final Property CONNECTED_UP = BooleanProperty.create("connected_up"); + public static final Property CONNECTED_DOWN = BooleanProperty.create("connected_down"); + public static final Property CONNECTED_EAST = BooleanProperty.create("connected_east"); + public static final Property CONNECTED_WEST = BooleanProperty.create("connected_west"); + public static final Property CONNECTED_NORTH = BooleanProperty.create("connected_north"); + public static final Property CONNECTED_SOUTH = BooleanProperty.create("connected_south"); - public static final Map> CONNECTED_MAP; + public static final Map> CONNECTED_MAP; // Block state setting flags -these are used by World.markAndNotifyBlock and World.setBlockState. These flags can be // added together to pass the additions @@ -70,16 +62,17 @@ public final class BuildCraftProperties { public static final int UPDATE_ALL = UPDATE_NEIGHBOURS + MARK_BLOCK_FOR_UPDATE + UPDATE_EVEN_CLIENT; static { - Map> map = Maps.newEnumMap(EnumFacing.class); - map.put(EnumFacing.DOWN, CONNECTED_DOWN); - map.put(EnumFacing.UP, CONNECTED_UP); - map.put(EnumFacing.EAST, CONNECTED_EAST); - map.put(EnumFacing.WEST, CONNECTED_WEST); - map.put(EnumFacing.NORTH, CONNECTED_NORTH); - map.put(EnumFacing.SOUTH, CONNECTED_SOUTH); + Map> map = Maps.newEnumMap(Direction.class); + map.put(Direction.DOWN, CONNECTED_DOWN); + map.put(Direction.UP, CONNECTED_UP); + map.put(Direction.EAST, CONNECTED_EAST); + map.put(Direction.WEST, CONNECTED_WEST); + map.put(Direction.NORTH, CONNECTED_NORTH); + map.put(Direction.SOUTH, CONNECTED_SOUTH); CONNECTED_MAP = Maps.immutableEnumMap(map); } /** Deactivate constructor */ - private BuildCraftProperties() {} + private BuildCraftProperties() { + } } diff --git a/api/buildcraft/api/recipes/AssemblyRecipeBasic.java b/api/buildcraft/api/recipes/AssemblyRecipeBasic.java deleted file mode 100644 index 094d3c9..0000000 --- a/api/buildcraft/api/recipes/AssemblyRecipeBasic.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2017 SpaceToad and the BuildCraft team - * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not - * distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/ - */ - -package buildcraft.api.recipes; - -import java.util.Collections; -import java.util.Set; - -import javax.annotation.Nonnull; - -import com.google.common.collect.ImmutableSet; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.NonNullList; -import net.minecraft.util.ResourceLocation; - -import buildcraft.api.core.BuildCraftAPI; - -/** - * @deprecated TEMPORARY CLASS DO NOT USE! - */ -@Deprecated -public class AssemblyRecipeBasic extends AssemblyRecipe { - private final long requiredMicroJoules; - private final ImmutableSet requiredStacks; - private final ImmutableSet output; - - public AssemblyRecipeBasic(ResourceLocation name, long requiredMicroJoules, ImmutableSet requiredStacks, @Nonnull ItemStack output) { - this.requiredMicroJoules = requiredMicroJoules; - this.requiredStacks = ImmutableSet.copyOf(requiredStacks); - this.output = ImmutableSet.of(output); - setRegistryName(name); - } - - public AssemblyRecipeBasic(String name, long requiredMicroJoules, ImmutableSet requiredStacks, @Nonnull ItemStack output) { - this(BuildCraftAPI.nameToResourceLocation(name), requiredMicroJoules, requiredStacks, output); - } - - public AssemblyRecipeBasic(String name, long requiredMicroJoules, Set requiredStacks, @Nonnull ItemStack output) { - this(name, requiredMicroJoules, ImmutableSet.copyOf(requiredStacks), output); - } - - @Override - public Set getOutputs(NonNullList inputs) { - if (requiredStacks.stream().allMatch((definition) -> inputs.stream().anyMatch((stack) -> !stack.isEmpty() && definition.ingredient.apply(stack) && stack.getCount() >= definition.count))) - return output; - return Collections.emptySet(); - } - - @Override - public Set getOutputPreviews() { - return output; - } - - @Override - public Set getInputsFor(@Nonnull ItemStack output) { - return requiredStacks; - } - - @Override - public long getRequiredMicroJoulesFor(@Nonnull ItemStack output) { - return requiredMicroJoules; - } -} diff --git a/api/buildcraft/api/recipes/BuildcraftRecipeRegistry.java b/api/buildcraft/api/recipes/BuildcraftRecipeRegistry.java index 22ee171..6174520 100644 --- a/api/buildcraft/api/recipes/BuildcraftRecipeRegistry.java +++ b/api/buildcraft/api/recipes/BuildcraftRecipeRegistry.java @@ -9,5 +9,6 @@ public final class BuildcraftRecipeRegistry { public static IIntegrationRecipeRegistry integrationRecipes; public static IRefineryRecipeManager refineryRecipes; - private BuildcraftRecipeRegistry() {} + private BuildcraftRecipeRegistry() { + } } diff --git a/api/buildcraft/api/recipes/EnumAssemblyRecipeType.java b/api/buildcraft/api/recipes/EnumAssemblyRecipeType.java new file mode 100644 index 0000000..3b8f726 --- /dev/null +++ b/api/buildcraft/api/recipes/EnumAssemblyRecipeType.java @@ -0,0 +1,6 @@ +package buildcraft.api.recipes; + +public enum EnumAssemblyRecipeType { + BASIC, + FACADE, +} diff --git a/api/buildcraft/api/recipes/AssemblyRecipe.java b/api/buildcraft/api/recipes/IAssemblyRecipe.java similarity index 52% rename from api/buildcraft/api/recipes/AssemblyRecipe.java rename to api/buildcraft/api/recipes/IAssemblyRecipe.java index cbd8eb5..5cd9067 100644 --- a/api/buildcraft/api/recipes/AssemblyRecipe.java +++ b/api/buildcraft/api/recipes/IAssemblyRecipe.java @@ -1,85 +1,77 @@ package buildcraft.api.recipes; -import java.util.Set; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import buildcraft.api.BCModules; +import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeType; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import javax.annotation.Nonnull; +import java.util.Set; -import net.minecraftforge.registries.IForgeRegistryEntry; +public interface IAssemblyRecipe extends Comparable, IRecipe { + public static final ResourceLocation TYPE_ID = new ResourceLocation(BCModules.SILICON.getModId(), "assembly"); -/** - * @deprecated TEMPORARY CLASS DO NOT USE! - */ -@Deprecated -public abstract class AssemblyRecipe implements Comparable, IForgeRegistryEntry { - private ResourceLocation name; + public static final IRecipeType TYPE = IRecipeType.register(TYPE_ID.toString()); /** * The outputs this recipe can generate with any of the given inputs + * * @param inputs Current ingredients in the assembly table * @return A Set containing all possible outputs given the given inputs or an empty one if nothing can be assembled from the given inputs */ public abstract Set getOutputs(NonNullList inputs); - /** - * Used to determine all outputs from this recipe for recipe previews (guide book and/or JEI) - */ + /** Used to determine all outputs from this recipe for recipe previews (guide book and/or JEI) */ public abstract Set getOutputPreviews(); /** * Used to determine what items to use up for the given output + * * @param output The output we want to know the inputs for, only ever called using stacks obtained from getOutputs or getOutputPreviews */ public abstract Set getInputsFor(@Nonnull ItemStack output); /** * Used to determine how much MJ is required to asemble the given output item + * * @param output The output we want to know the MJ cost for, only ever called using stacks obtained from getOutputs or getOutputPreviews */ public abstract long getRequiredMicroJoulesFor(@Nonnull ItemStack output); @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + public default int compareTo(IAssemblyRecipe o) { + return getId().toString().compareTo(o.getId().toString()); + } - AssemblyRecipe that = (AssemblyRecipe) o; + public abstract long getRequiredMicroJoules(); - return name.equals(that.name); - } + public abstract Set getRequiredIngredientStacks(); - @Override - public int hashCode() { - return name.hashCode(); - } + public abstract Set getOutput(); + + // IRecipe @Override - public int compareTo(AssemblyRecipe o) { - return name.toString().compareTo(o.name.toString()); + public default boolean matches(IInventory inv, World world) { + return false; } @Override - public AssemblyRecipe setRegistryName(ResourceLocation name) { - this.name = name; - return this; + public default boolean canCraftInDimensions(int width, int height) { + return true; } - @Nullable @Override - public ResourceLocation getRegistryName() { - return name; + public default boolean isSpecial() { + return true; } @Override - public Class getRegistryType() { - return AssemblyRecipe.class; + public default IRecipeType getType() { + return TYPE; } } diff --git a/api/buildcraft/api/recipes/IIntegrationRecipeProvider.java b/api/buildcraft/api/recipes/IIntegrationRecipeProvider.java index a6ebeaa..b24d0ae 100644 --- a/api/buildcraft/api/recipes/IIntegrationRecipeProvider.java +++ b/api/buildcraft/api/recipes/IIntegrationRecipeProvider.java @@ -1,18 +1,18 @@ package buildcraft.api.recipes; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** Provides a way of registering complex recipes without needing to register every possible variant. If you want the * recipes to be viewable in JEI and the guide book then you will *also* need to implement the bc lib class * IIntegrationRecipeViewable. */ public interface IIntegrationRecipeProvider { /** Gets an integration recipe for the given ingredients. - * + * * @param target The center itemstack. * @param toIntegrate A list of stacks to try to integrate to the * @return */ diff --git a/api/buildcraft/api/recipes/IRefineryRecipeManager.java b/api/buildcraft/api/recipes/IRefineryRecipeManager.java index 65b523b..59079ed 100644 --- a/api/buildcraft/api/recipes/IRefineryRecipeManager.java +++ b/api/buildcraft/api/recipes/IRefineryRecipeManager.java @@ -1,30 +1,44 @@ package buildcraft.api.recipes; +import buildcraft.api.BCModules; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + +import javax.annotation.Nullable; import java.util.Collection; import java.util.function.Predicate; import java.util.stream.Stream; -import javax.annotation.Nullable; - -import net.minecraftforge.fluids.FluidStack; - public interface IRefineryRecipeManager { - IHeatableRecipe createHeatingRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo); + // IHeatableRecipe createHeatingRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo); + IHeatableRecipe createHeatingRecipe(ResourceLocation id, FluidStack in, FluidStack out, int heatFrom, int heatTo); - default IHeatableRecipe addHeatableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo) { - return getHeatableRegistry().addRecipe(createHeatingRecipe(in, out, heatFrom, heatTo)); + // default IHeatableRecipe addHeatableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo) + default IHeatableRecipe addUnregisteredHeatableRecipe(ResourceLocation id, FluidStack in, FluidStack out, int heatFrom, int heatTo) { +// return getHeatableRegistry().addRecipe(createHeatingRecipe(in, out, heatFrom, heatTo)); + return getHeatableRegistry().addUnregisteredRecipe(createHeatingRecipe(id, in, out, heatFrom, heatTo)); } - ICoolableRecipe createCoolableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo); + // ICoolableRecipe createCoolableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo); + ICoolableRecipe createCoolableRecipe(ResourceLocation id, FluidStack in, FluidStack out, int heatFrom, int heatTo); - default ICoolableRecipe addCoolableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo) { - return getCoolableRegistry().addRecipe(createCoolableRecipe(in, out, heatFrom, heatTo)); + // default ICoolableRecipe addCoolableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo) + default ICoolableRecipe addUnregisteredCoolableRecipe(ResourceLocation id, FluidStack in, FluidStack out, int heatFrom, int heatTo) { +// return getCoolableRegistry().addRecipe(createCoolableRecipe(in, out, heatFrom, heatTo)); + return getCoolableRegistry().addUnregisteredRecipe(createCoolableRecipe(id, in, out, heatFrom, heatTo)); } - IDistillationRecipe createDistillationRecipe(FluidStack in, FluidStack outGas, FluidStack outLiquid, long powerRequired); + // IDistillationRecipe createDistillationRecipe(FluidStack in, FluidStack outGas, FluidStack outLiquid, long powerRequired); + IDistillationRecipe createDistillationRecipe(ResourceLocation id, FluidStack in, FluidStack outGas, FluidStack outLiquid, long powerRequired); - default IDistillationRecipe addDistillationRecipe(FluidStack in, FluidStack outGas, FluidStack outLiquid, long powerRequired) { - return getDistillationRegistry().addRecipe(createDistillationRecipe(in, outGas, outLiquid, powerRequired)); + // default IDistillationRecipe addDistillationRecipe(FluidStack in, FluidStack outGas, FluidStack outLiquid, long powerRequired) + default IDistillationRecipe addUnregisteredDistillationRecipe(ResourceLocation id, FluidStack in, FluidStack outGas, FluidStack outLiquid, long powerRequired) { +// return getDistillationRegistry().addRecipe(createDistillationRecipe(in, outGas, outLiquid, powerRequired)); + return getDistillationRegistry().addUnregisteredRecipe(createDistillationRecipe(id, in, outGas, outLiquid, powerRequired)); } IRefineryRegistry getHeatableRegistry(); @@ -36,25 +50,34 @@ default IDistillationRecipe addDistillationRecipe(FluidStack in, FluidStack outG interface IRefineryRegistry { /** @return an unmodifiable collection containing all of the distillation recipes that satisfy the given * predicate. All of the recipe objects are guaranteed to never be null. */ - Stream getRecipes(Predicate toReturn); +// Stream getRecipes(Predicate toReturn); + Stream getRecipes(World world, Predicate toReturn); /** @return an unmodifiable set containing all of the distillation recipes. */ - Collection getAllRecipes(); +// Collection getAllRecipes(); + Collection getAllRecipes(World world); @Nullable - R getRecipeForInput(@Nullable FluidStack fluid); +// R getRecipeForInput(@Nullable FluidStack fluid); + R getRecipeForInput(World world, @Nullable FluidStack fluid); - Collection removeRecipes(Predicate toRemove); + // Collection removeRecipes(Predicate toRemove); + Collection removeUnregisteredRecipes(Predicate toRemove); /** Adds the given recipe to the registry. Note that this will remove any existing recipes for the passed * recipe's {@link IRefineryRecipe#in()} - * + * * @param recipe The recipe to add. * @return The input recipe. */ - R addRecipe(R recipe); +// R addRecipe(R recipe); + R addUnregisteredRecipe(R recipe); + +// // Calen +// IRecipeType getRecipeType; } - interface IRefineryRecipe { + // interface IRefineryRecipe + interface IRefineryRecipe extends IRecipe { FluidStack in(); } @@ -67,15 +90,43 @@ interface IHeatExchangerRecipe extends IRefineryRecipe { int heatTo(); } - interface IHeatableRecipe extends IHeatExchangerRecipe {} + interface IHeatableRecipe extends IHeatExchangerRecipe { + public static final ResourceLocation TYPE_ID = new ResourceLocation(BCModules.FACTORY.getModId(), "heat_exchange/heatable"); + + public static final IRecipeType TYPE = IRecipeType.register(TYPE_ID.toString()); + + + @Override + default IRecipeType getType() { + return TYPE; + } + } + + interface ICoolableRecipe extends IHeatExchangerRecipe { + public static final ResourceLocation TYPE_ID = new ResourceLocation(BCModules.FACTORY.getModId(), "heat_exchange/coolable"); - interface ICoolableRecipe extends IHeatExchangerRecipe {} + public static final IRecipeType TYPE = IRecipeType.register(TYPE_ID.toString()); + + @Override + default IRecipeType getType() { + return TYPE; + } + } interface IDistillationRecipe extends IRefineryRecipe { + public static final ResourceLocation TYPE_ID = new ResourceLocation(BCModules.FACTORY.getModId(), "distillation"); + + public static final IRecipeType TYPE = IRecipeType.register(TYPE_ID.toString()); + long powerRequired(); FluidStack outGas(); FluidStack outLiquid(); + + @Override + default IRecipeType getType() { + return TYPE; + } } } diff --git a/api/buildcraft/api/recipes/IngredientStack.java b/api/buildcraft/api/recipes/IngredientStack.java index adbcdea..d2d05ed 100644 --- a/api/buildcraft/api/recipes/IngredientStack.java +++ b/api/buildcraft/api/recipes/IngredientStack.java @@ -6,8 +6,12 @@ package buildcraft.api.recipes; +import com.google.gson.JsonElement; +import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; - +import net.minecraft.network.PacketBuffer; +import net.minecraft.tags.ITag.INamedTag; +import net.minecraft.util.IItemProvider; import net.minecraftforge.common.crafting.CraftingHelper; public final class IngredientStack { @@ -23,7 +27,31 @@ public IngredientStack(Ingredient ingredient) { this(ingredient, 1); } - public static IngredientStack of(Object o) { + // public static IngredientStack of(Object o) + public static IngredientStack of(JsonElement o) { return new IngredientStack(CraftingHelper.getIngredient(o)); } + + public static IngredientStack of(ItemStack o) { + return new IngredientStack(Ingredient.of(o)); + } + + public static IngredientStack of(IItemProvider o) { + return new IngredientStack(Ingredient.of(o)); + } + + public static IngredientStack of(INamedTag tag) { + return new IngredientStack(Ingredient.of(tag)); + } + + public void toNetwork(PacketBuffer buffer) { + buffer.writeInt(this.count); + this.ingredient.toNetwork(buffer); + } + + public static IngredientStack fromNetwork(PacketBuffer buffer) { + int countIn = buffer.readInt(); + Ingredient ingredientIn = Ingredient.fromNetwork(buffer); + return new IngredientStack(ingredientIn, countIn); + } } diff --git a/api/buildcraft/api/recipes/IntegrationRecipe.java b/api/buildcraft/api/recipes/IntegrationRecipe.java index 984404b..5d175c6 100644 --- a/api/buildcraft/api/recipes/IntegrationRecipe.java +++ b/api/buildcraft/api/recipes/IntegrationRecipe.java @@ -1,13 +1,12 @@ package buildcraft.api.recipes; -import javax.annotation.Nonnull; - import com.google.common.collect.ImmutableList; - import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; +import javax.annotation.Nonnull; + public abstract class IntegrationRecipe { public final ResourceLocation name; @@ -30,6 +29,9 @@ public IntegrationRecipe(ResourceLocation name) { */ public abstract ImmutableList getRequirements(@Nonnull ItemStack output); + // Calen + public abstract ImmutableList getRequirements(); + /** * Determines the amount of MJ required to integrate * @param output The output that would be generated @@ -39,6 +41,9 @@ public IntegrationRecipe(ResourceLocation name) { public abstract IngredientStack getCenterStack(); + // Calen + public abstract ItemStack getOutput(); + @Override public boolean equals(Object o) { if (this == o) { diff --git a/api/buildcraft/api/recipes/package-info.java b/api/buildcraft/api/recipes/package-info.java index 596d90d..0d35939 100644 --- a/api/buildcraft/api/recipes/package-info.java +++ b/api/buildcraft/api/recipes/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "3.0", owner = "buildcraftapi_core", provides = "buildcraftapi_recipes") +//@API(apiVersion = "3.0", owner = "buildcraftapi_core", provides = "buildcraftapi_recipes") package buildcraft.api.recipes; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/registry/EventBuildCraftReload.java b/api/buildcraft/api/registry/EventBuildCraftReload.java index 903a9c3..2c46636 100644 --- a/api/buildcraft/api/registry/EventBuildCraftReload.java +++ b/api/buildcraft/api/registry/EventBuildCraftReload.java @@ -1,16 +1,13 @@ package buildcraft.api.registry; -import java.util.Set; - -import javax.annotation.Nullable; - import com.google.gson.GsonBuilder; - import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; - +import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.common.eventhandler.Event; + +import javax.annotation.Nullable; +import java.util.Set; public abstract class EventBuildCraftReload extends Event { @@ -29,7 +26,7 @@ public EventBuildCraftReload(IReloadableRegistryManager manager, Set> reloadingRegistries) { + @Nullable Set> reloadingRegistries) { super(manager, reloadingRegistries); } } @@ -50,7 +47,7 @@ public static class PopulateGson extends EventBuildCraftReload { public final GsonBuilder gsonBuilder; public PopulateGson(IReloadableRegistryManager manager, - @Nullable Set> reloadingRegistries, GsonBuilder gsonBuilder) { + @Nullable Set> reloadingRegistries, GsonBuilder gsonBuilder) { super(manager, reloadingRegistries); this.gsonBuilder = gsonBuilder; } @@ -68,7 +65,7 @@ public PostLoad(IReloadableRegistryManager manager, @Nullable Set> reloadingRegistries) { + @Nullable Set> reloadingRegistries) { super(manager, reloadingRegistries); } } diff --git a/api/buildcraft/api/registry/IReloadableRegistry.java b/api/buildcraft/api/registry/IReloadableRegistry.java index e973dad..8c2abeb 100644 --- a/api/buildcraft/api/registry/IReloadableRegistry.java +++ b/api/buildcraft/api/registry/IReloadableRegistry.java @@ -1,10 +1,10 @@ package buildcraft.api.registry; +import net.minecraft.util.ResourceLocation; + import java.util.Collection; import java.util.Map; -import net.minecraft.util.ResourceLocation; - /** A registry of any Java object. This does not perform serialisation of any kind to the entries. */ public interface IReloadableRegistry { diff --git a/api/buildcraft/api/registry/IReloadableRegistryManager.java b/api/buildcraft/api/registry/IReloadableRegistryManager.java index 9c71ba1..f1a88bb 100644 --- a/api/buildcraft/api/registry/IReloadableRegistryManager.java +++ b/api/buildcraft/api/registry/IReloadableRegistryManager.java @@ -1,10 +1,10 @@ package buildcraft.api.registry; +import buildcraft.api.registry.IReloadableRegistry.PackType; + import java.util.Map; import java.util.Set; -import buildcraft.api.registry.IReloadableRegistry.PackType; - public interface IReloadableRegistryManager { PackType getType(); @@ -33,7 +33,7 @@ public interface IReloadableRegistryManager { Map> getAllRegistries(); /** Creates and registers a basic {@link IReloadableRegistry}. - * + * * @param name The name for the given registry. This should be unique, and the best way of doing that is to prefix * it with the modid, followed by a slash, and then the mod-unique name. * @throws IllegalArgumentException if name contains a colon. */ @@ -41,7 +41,7 @@ public interface IReloadableRegistryManager { /** Scripts will be loaded from "[pack_type.prefix]/[pack_name]/compat/[entry_path]/". The entryPath parameter * should start with the modid. - * + * * @param entryPath */ IScriptableRegistry createScriptableRegistry(String entryPath); diff --git a/api/buildcraft/api/registry/IScriptableRegistry.java b/api/buildcraft/api/registry/IScriptableRegistry.java index b6bae4d..5d3cea5 100644 --- a/api/buildcraft/api/registry/IScriptableRegistry.java +++ b/api/buildcraft/api/registry/IScriptableRegistry.java @@ -1,17 +1,15 @@ package buildcraft.api.registry; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; import com.google.gson.JsonSyntaxException; - import net.minecraft.util.ResourceLocation; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.Map; +import java.util.Set; + /** A type of {@link IReloadableRegistry} that can be configured with buildcraft style simple scripts. A full * description can be found [...] */ public interface IScriptableRegistry extends IReloadableRegistry { @@ -37,7 +35,7 @@ default void addCustomType(String name, IEntryDeserializer deserial } /** @return A {@link Set} (likely unmodifiable) that contains all of the - * {@link ResourceLocation#getResourceDomain()}'s that had added entries to this registry through + * {@link ResourceLocation#getNamespace()}'s that had added entries to this registry through * scripts. */ Set getSourceDomains(); @@ -56,7 +54,7 @@ public interface IEntryDeserializer { * @throws JsonSyntaxException if the input {@link JsonObject} was either missing required fields or had the * wrong type or data for those fields. */ OptionallyDisabled deserialize(ResourceLocation name, JsonObject obj, JsonDeserializationContext ctx) - throws JsonSyntaxException; + throws JsonSyntaxException; } /** Similar to {@link IEntryDeserializer} except that this guarantees that @@ -71,7 +69,7 @@ public interface ISimpleEntryDeserializer extends IEntryDeserializer { * {@link #deserializeConst(ResourceLocation, JsonObject, JsonDeserializationContext)} directly. */ @Override default OptionallyDisabled deserialize(ResourceLocation name, JsonObject obj, JsonDeserializationContext ctx) - throws JsonSyntaxException { + throws JsonSyntaxException { return new OptionallyDisabled<>(deserializeConst(name, obj, ctx)); } @@ -82,7 +80,7 @@ default OptionallyDisabled deserialize(ResourceLocation name, JsonObject obj, * @throws JsonSyntaxException if the input {@link JsonObject} was either missing required fields or had the * wrong type or data for those fields. */ E deserializeConst(ResourceLocation name, JsonObject obj, JsonDeserializationContext ctx) - throws JsonSyntaxException; + throws JsonSyntaxException; } /** A simple wrapper which either contains the object, or a string with a reason why it is allowed to be null. */ diff --git a/api/buildcraft/api/robots/AIRobot.java b/api/buildcraft/api/robots/AIRobot.java index 0fad582..39c970f 100755 --- a/api/buildcraft/api/robots/AIRobot.java +++ b/api/buildcraft/api/robots/AIRobot.java @@ -4,10 +4,9 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.robots; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - import buildcraft.api.mj.MjAPI; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; public class AIRobot { public EntityRobotBase robot; @@ -42,24 +41,24 @@ public void end() { } /** This gets called when a delegate AI ends work naturally. - * + * * @param ai The delegate AI which ended work. */ public void delegateAIEnded(AIRobot ai) { } /** This gets called when a delegate AI is forcibly aborted. - * + * * @param ai The delegate AI which was aborted. */ public void delegateAIAborted(AIRobot ai) { } - public void writeSelfToNBT(NBTTagCompound nbt) { + public void writeSelfToNBT(CompoundNBT nbt) { } - public void loadSelfFromNBT(NBTTagCompound nbt) { + public void loadSelfFromNBT(CompoundNBT nbt) { } @@ -155,30 +154,30 @@ public final AIRobot getDelegateAI() { return delegateAI; } - public final void writeToNBT(NBTTagCompound nbt) { - nbt.setString("aiName", RobotManager.getAIRobotName(getClass())); + public final void writeToNBT(CompoundNBT nbt) { + nbt.putString("aiName", RobotManager.getAIRobotName(getClass())); - NBTTagCompound data = new NBTTagCompound(); + CompoundNBT data = new CompoundNBT(); writeSelfToNBT(data); - nbt.setTag("data", data); + nbt.put("data", data); if (delegateAI != null && delegateAI.canLoadFromNBT()) { - NBTTagCompound sub = new NBTTagCompound(); + CompoundNBT sub = new CompoundNBT(); delegateAI.writeToNBT(sub); - nbt.setTag("delegateAI", sub); + nbt.put("delegateAI", sub); } } - public final void loadFromNBT(NBTTagCompound nbt) { - loadSelfFromNBT(nbt.getCompoundTag("data")); + public final void loadFromNBT(CompoundNBT nbt) { + loadSelfFromNBT(nbt.getCompound("data")); - if (nbt.hasKey("delegateAI")) { - NBTTagCompound sub = nbt.getCompoundTag("delegateAI"); + if (nbt.contains("delegateAI")) { + CompoundNBT sub = nbt.getCompound("delegateAI"); try { Class aiRobotClass; - if (sub.hasKey("class")) { + if (sub.contains("class")) { // Migration support for 6.4.x aiRobotClass = RobotManager.getAIRobotByLegacyClassName(sub.getString("class")); } else { @@ -198,12 +197,12 @@ public final void loadFromNBT(NBTTagCompound nbt) { } } - public static AIRobot loadAI(NBTTagCompound nbt, EntityRobotBase robot) { + public static AIRobot loadAI(CompoundNBT nbt, EntityRobotBase robot) { AIRobot ai = null; try { Class aiRobotClass; - if (nbt.hasKey("class")) { + if (nbt.contains("class")) { // Migration support for 6.4.x aiRobotClass = RobotManager.getAIRobotByLegacyClassName(nbt.getString("class")); } else { diff --git a/api/buildcraft/api/robots/DockingStation.java b/api/buildcraft/api/robots/DockingStation.java index d3237a0..7efd972 100755 --- a/api/buildcraft/api/robots/DockingStation.java +++ b/api/buildcraft/api/robots/DockingStation.java @@ -4,23 +4,21 @@ * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.robots; -import java.util.Arrays; - +import buildcraft.api.core.BCLog; +import buildcraft.api.core.EnumPipePart; +import buildcraft.api.statements.StatementSlot; +import buildcraft.api.transport.IInjectable; import net.minecraft.inventory.IInventory; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; - import net.minecraftforge.fluids.capability.IFluidHandler; -import buildcraft.api.core.BCLog; -import buildcraft.api.core.EnumPipePart; -import buildcraft.api.statements.StatementSlot; -import buildcraft.api.transport.IInjectable; +import java.util.Arrays; public abstract class DockingStation { - public EnumFacing side; + public Direction side; public World world; private long robotTakingId = EntityRobotBase.NULL_ROBOT_ID; @@ -30,12 +28,13 @@ public abstract class DockingStation { private BlockPos pos; - public DockingStation(BlockPos iIndex, EnumFacing iSide) { + public DockingStation(BlockPos iIndex, Direction iSide) { pos = iIndex; side = iSide; } - public DockingStation() {} + public DockingStation() { + } public boolean isMainStation() { return linkIsMain; @@ -45,7 +44,7 @@ public BlockPos getPos() { return pos; } - public EnumFacing side() { + public Direction side() { return side; } @@ -116,20 +115,20 @@ public void unsafeRelease(EntityRobotBase robot) { } } - public void writeToNBT(NBTTagCompound nbt) { - nbt.setIntArray("pos", new int[] { getPos().getX(), getPos().getY(), getPos().getZ() }); - nbt.setByte("side", (byte) side.ordinal()); - nbt.setBoolean("isMain", linkIsMain); - nbt.setLong("robotId", robotTakingId); + public void writeToNBT(CompoundNBT nbt) { + nbt.putIntArray("pos", new int[] { getPos().getX(), getPos().getY(), getPos().getZ() }); + nbt.putByte("side", (byte) side.ordinal()); + nbt.putBoolean("isMain", linkIsMain); + nbt.putLong("robotId", robotTakingId); } - public void readFromNBT(NBTTagCompound nbt) { - if (nbt.hasKey("index")) { + public void readFromNBT(CompoundNBT nbt) { + if (nbt.contains("index")) { // For compatibility with older versions of minecraft and buildcraft - NBTTagCompound indexNBT = nbt.getCompoundTag("index"); - int x = indexNBT.getInteger("i"); - int y = indexNBT.getInteger("j"); - int z = indexNBT.getInteger("k"); + CompoundNBT indexNBT = nbt.getCompound("index"); + int x = indexNBT.getInt("i"); + int y = indexNBT.getInt("j"); + int z = indexNBT.getInt("k"); pos = new BlockPos(x, y, z); } else { int[] array = nbt.getIntArray("pos"); @@ -141,7 +140,7 @@ public void readFromNBT(NBTTagCompound nbt) { BCLog.logger.warn("Did not find any integer positions! This is a bug!"); } } - side = EnumFacing.values()[nbt.getByte("side")]; + side = Direction.values()[nbt.getByte("side")]; linkIsMain = nbt.getBoolean("isMain"); robotTakingId = nbt.getLong("robotId"); } diff --git a/api/buildcraft/api/robots/EntityRobotBase.java b/api/buildcraft/api/robots/EntityRobotBase.java index 0e6439d..a3894a5 100755 --- a/api/buildcraft/api/robots/EntityRobotBase.java +++ b/api/buildcraft/api/robots/EntityRobotBase.java @@ -4,30 +4,29 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.robots; +import buildcraft.api.boards.RedstoneBoardRobot; +import buildcraft.api.core.IFluidHandlerAdv; +import buildcraft.api.core.IZone; +import buildcraft.api.mj.MjAPI; +import buildcraft.api.mj.MjBattery; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; - import net.minecraftforge.items.IItemHandler; -import buildcraft.api.boards.RedstoneBoardRobot; -import buildcraft.api.core.IFluidHandlerAdv; -import buildcraft.api.core.IZone; -import buildcraft.api.mj.MjAPI; -import buildcraft.api.mj.MjBattery; - -public abstract class EntityRobotBase extends EntityLiving implements IItemHandler, IFluidHandlerAdv { +public abstract class EntityRobotBase extends LivingEntity implements IItemHandler, IFluidHandlerAdv { - public static final long MAX_POWER = 5000 * MjAPI.MJ; + public static final long MAX_POWER = 5000 * MjAPI.MJ; public static final long SAFETY_POWER = MAX_POWER / 5; public static final long SHUTDOWN_POWER = 0; public static final long NULL_ROBOT_ID = Long.MAX_VALUE; - public EntityRobotBase(World par1World) { - super(par1World); + public EntityRobotBase(EntityType entityType, World par1World) { + super(entityType, par1World); } public abstract void setItemInUse(ItemStack stack); diff --git a/api/buildcraft/api/robots/IRobotOverlayItem.java b/api/buildcraft/api/robots/IRobotOverlayItem.java index fa39ee1..25cb2cf 100644 --- a/api/buildcraft/api/robots/IRobotOverlayItem.java +++ b/api/buildcraft/api/robots/IRobotOverlayItem.java @@ -2,13 +2,12 @@ import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public interface IRobotOverlayItem { boolean isValidRobotOverlay(ItemStack stack); - @SideOnly(Side.CLIENT) + @OnlyIn(Dist.CLIENT) void renderRobotOverlay(ItemStack stack, TextureManager textureManager); } diff --git a/api/buildcraft/api/robots/IRobotRegistry.java b/api/buildcraft/api/robots/IRobotRegistry.java index 96360f5..fbb7918 100755 --- a/api/buildcraft/api/robots/IRobotRegistry.java +++ b/api/buildcraft/api/robots/IRobotRegistry.java @@ -4,12 +4,12 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.robots; -import java.util.Collection; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; +import java.util.Collection; + public interface IRobotRegistry { long getNextRobotId(); @@ -36,7 +36,7 @@ public interface IRobotRegistry { void releaseResources(EntityRobotBase robot); - DockingStation getStation(BlockPos pos, EnumFacing side); + DockingStation getStation(BlockPos pos, Direction side); Collection getStations(); @@ -48,9 +48,9 @@ public interface IRobotRegistry { void release(DockingStation station, long robotId); - void writeToNBT(NBTTagCompound nbt); + void writeToNBT(CompoundNBT nbt); - void readFromNBT(NBTTagCompound nbt); + void readFromNBT(CompoundNBT nbt); void registryMarkDirty(); } diff --git a/api/buildcraft/api/robots/ResourceId.java b/api/buildcraft/api/robots/ResourceId.java index 539503a..667e1c0 100755 --- a/api/buildcraft/api/robots/ResourceId.java +++ b/api/buildcraft/api/robots/ResourceId.java @@ -4,22 +4,24 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.robots; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; public abstract class ResourceId { - protected ResourceId() {} + protected ResourceId() { + } - public void writeToNBT(NBTTagCompound nbt) { - nbt.setString("resourceName", RobotManager.getResourceIdName(getClass())); + public void writeToNBT(CompoundNBT nbt) { + nbt.putString("resourceName", RobotManager.getResourceIdName(getClass())); } - protected void readFromNBT(NBTTagCompound nbt) {} + protected void readFromNBT(CompoundNBT nbt) { + } - public static ResourceId load(NBTTagCompound nbt) { + public static ResourceId load(CompoundNBT nbt) { try { Class cls; - if (nbt.hasKey("class")) { + if (nbt.contains("class")) { // Migration support for 6.4.x cls = RobotManager.getResourceIdByLegacyClassName(nbt.getString("class")); } else { diff --git a/api/buildcraft/api/robots/ResourceIdBlock.java b/api/buildcraft/api/robots/ResourceIdBlock.java index 4e89a58..9ba539a 100755 --- a/api/buildcraft/api/robots/ResourceIdBlock.java +++ b/api/buildcraft/api/robots/ResourceIdBlock.java @@ -4,13 +4,11 @@ * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.robots; -import org.apache.commons.lang3.builder.HashCodeBuilder; - -import net.minecraft.nbt.NBTTagCompound; +import buildcraft.api.core.EnumPipePart; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; - -import buildcraft.api.core.EnumPipePart; +import org.apache.commons.lang3.builder.HashCodeBuilder; public class ResourceIdBlock extends ResourceId { @@ -30,7 +28,7 @@ public ResourceIdBlock(BlockPos iIndex) { } public ResourceIdBlock(TileEntity tile) { - pos = tile.getPos(); + pos = tile.getBlockPos(); } @Override @@ -51,21 +49,21 @@ public int hashCode() { } @Override - public void writeToNBT(NBTTagCompound nbt) { + public void writeToNBT(CompoundNBT nbt) { super.writeToNBT(nbt); int[] arr = new int[] { pos.getX(), pos.getY(), pos.getZ() }; - nbt.setIntArray("pos", arr); + nbt.putIntArray("pos", arr); - nbt.setTag("side", side.writeToNBT()); + nbt.put("side", side.writeToNBT()); } @Override - protected void readFromNBT(NBTTagCompound nbt) { + protected void readFromNBT(CompoundNBT nbt) { super.readFromNBT(nbt); int[] arr = nbt.getIntArray("pos"); pos = new BlockPos(arr[0], arr[1], arr[2]); - side = EnumPipePart.readFromNBT(nbt.getTag("side")); + side = EnumPipePart.readFromNBT(nbt.get("side")); } } diff --git a/api/buildcraft/api/robots/ResourceIdRequest.java b/api/buildcraft/api/robots/ResourceIdRequest.java index d224b8e..aee36c1 100755 --- a/api/buildcraft/api/robots/ResourceIdRequest.java +++ b/api/buildcraft/api/robots/ResourceIdRequest.java @@ -4,11 +4,9 @@ * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.robots; -import org.apache.commons.lang3.builder.HashCodeBuilder; - -import net.minecraft.nbt.NBTTagCompound; - import buildcraft.api.core.EnumPipePart; +import net.minecraft.nbt.CompoundNBT; +import org.apache.commons.lang3.builder.HashCodeBuilder; public class ResourceIdRequest extends ResourceIdBlock { @@ -39,16 +37,16 @@ public int hashCode() { } @Override - public void writeToNBT(NBTTagCompound nbt) { + public void writeToNBT(CompoundNBT nbt) { super.writeToNBT(nbt); - nbt.setInteger("localId", slot); + nbt.putInt("localId", slot); } @Override - protected void readFromNBT(NBTTagCompound nbt) { + protected void readFromNBT(CompoundNBT nbt) { super.readFromNBT(nbt); - slot = nbt.getInteger("localId"); + slot = nbt.getInt("localId"); } } diff --git a/api/buildcraft/api/robots/RobotManager.java b/api/buildcraft/api/robots/RobotManager.java index 7c712c9..98dd22b 100644 --- a/api/buildcraft/api/robots/RobotManager.java +++ b/api/buildcraft/api/robots/RobotManager.java @@ -4,12 +4,12 @@ * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.robots; +import buildcraft.api.core.BCLog; + import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import buildcraft.api.core.BCLog; - public abstract class RobotManager { public static IRobotRegistryProvider registryProvider; public static ArrayList> aiRobots = new ArrayList<>(); diff --git a/api/buildcraft/api/robots/package-info.java b/api/buildcraft/api/robots/package-info.java index 6196069..591fd15 100644 --- a/api/buildcraft/api/robots/package-info.java +++ b/api/buildcraft/api/robots/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "3.0", owner = "buildcraftapi_core", provides = "buildcraftapi_robotics") +//@API(apiVersion = "3.0", owner = "buildcraftapi_core", provides = "buildcraftapi_robotics") package buildcraft.api.robots; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/schematics/ISchematicBlock.java b/api/buildcraft/api/schematics/ISchematicBlock.java index 3ae62ed..c7a8f35 100644 --- a/api/buildcraft/api/schematics/ISchematicBlock.java +++ b/api/buildcraft/api/schematics/ISchematicBlock.java @@ -1,20 +1,18 @@ package buildcraft.api.schematics; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -import javax.annotation.Nonnull; - +import buildcraft.api.core.IFakeWorld; +import buildcraft.api.core.InvalidInputDataException; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; - import net.minecraftforge.fluids.FluidStack; -import buildcraft.api.core.InvalidInputDataException; +import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.List; +import java.util.Set; public interface ISchematicBlock { void init(SchematicBlockContext context); @@ -48,12 +46,13 @@ default boolean isReadyToBuild(World world, BlockPos blockPos) { boolean build(World world, BlockPos blockPos); - boolean buildWithoutChecks(World world, BlockPos blockPos); + // boolean buildWithoutChecks(World world, BlockPos blockPos); + boolean buildWithoutChecks(IFakeWorld world, BlockPos blockPos); boolean isBuilt(World world, BlockPos blockPos); - NBTTagCompound serializeNBT(); + CompoundNBT serializeNBT(); /** @throws InvalidInputDataException If the input data wasn't correct or didn't make sense. */ - void deserializeNBT(NBTTagCompound nbt) throws InvalidInputDataException; + void deserializeNBT(CompoundNBT nbt) throws InvalidInputDataException; } diff --git a/api/buildcraft/api/schematics/ISchematicEntity.java b/api/buildcraft/api/schematics/ISchematicEntity.java index b026f3b..5f37aaf 100644 --- a/api/buildcraft/api/schematics/ISchematicEntity.java +++ b/api/buildcraft/api/schematics/ISchematicEntity.java @@ -1,26 +1,23 @@ package buildcraft.api.schematics; -import java.util.Collections; -import java.util.List; - -import javax.annotation.Nonnull; - +import buildcraft.api.core.InvalidInputDataException; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; - import net.minecraftforge.fluids.FluidStack; -import buildcraft.api.core.InvalidInputDataException; +import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.List; public interface ISchematicEntity { void init(SchematicEntityContext context); - Vec3d getPos(); + Vector3d getPos(); @Nonnull default List computeRequiredItems() { @@ -38,8 +35,8 @@ default List computeRequiredFluids() { Entity buildWithoutChecks(World world, BlockPos basePos); - NBTTagCompound serializeNBT(); + CompoundNBT serializeNBT(); /** @throws InvalidInputDataException If the input data wasn't correct or didn't make sense. */ - void deserializeNBT(NBTTagCompound nbt) throws InvalidInputDataException; + void deserializeNBT(CompoundNBT nbt) throws InvalidInputDataException; } diff --git a/api/buildcraft/api/schematics/SchematicBlockContext.java b/api/buildcraft/api/schematics/SchematicBlockContext.java index 0ca9853..f126c58 100644 --- a/api/buildcraft/api/schematics/SchematicBlockContext.java +++ b/api/buildcraft/api/schematics/SchematicBlockContext.java @@ -1,12 +1,12 @@ package buildcraft.api.schematics; -import javax.annotation.Nonnull; - import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; +import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class SchematicBlockContext { @Nonnull public final World world; @@ -15,14 +15,14 @@ public class SchematicBlockContext { @Nonnull public final BlockPos pos; @Nonnull - public final IBlockState blockState; + public final BlockState blockState; @Nonnull public final Block block; public SchematicBlockContext(@Nonnull World world, @Nonnull BlockPos basePos, @Nonnull BlockPos pos, - @Nonnull IBlockState blockState, + @Nonnull BlockState blockState, @Nonnull Block block) { this.world = world; this.basePos = basePos; diff --git a/api/buildcraft/api/schematics/SchematicBlockFactory.java b/api/buildcraft/api/schematics/SchematicBlockFactory.java index bf57fb1..de3f922 100644 --- a/api/buildcraft/api/schematics/SchematicBlockFactory.java +++ b/api/buildcraft/api/schematics/SchematicBlockFactory.java @@ -1,11 +1,10 @@ package buildcraft.api.schematics; -import java.util.function.Predicate; -import java.util.function.Supplier; +import net.minecraft.util.ResourceLocation; import javax.annotation.Nonnull; - -import net.minecraft.util.ResourceLocation; +import java.util.function.Predicate; +import java.util.function.Supplier; public class SchematicBlockFactory implements Comparable> { @Nonnull diff --git a/api/buildcraft/api/schematics/SchematicBlockFactoryRegistry.java b/api/buildcraft/api/schematics/SchematicBlockFactoryRegistry.java index d88de20..e8d1263 100644 --- a/api/buildcraft/api/schematics/SchematicBlockFactoryRegistry.java +++ b/api/buildcraft/api/schematics/SchematicBlockFactoryRegistry.java @@ -1,33 +1,37 @@ package buildcraft.api.schematics; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.function.Predicate; -import java.util.function.Supplier; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import buildcraft.api.core.BuildCraftAPI; import com.google.common.collect.ImmutableList; - import net.minecraft.block.Block; import net.minecraft.util.ResourceLocation; -import buildcraft.api.core.BuildCraftAPI; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentSkipListSet; +import java.util.function.Predicate; +import java.util.function.Supplier; public class SchematicBlockFactoryRegistry { - private static final Set> FACTORIES = new TreeSet<>(); + // private static final Set> FACTORIES = new TreeSet<>(); + private static final Set> FACTORIES = new ConcurrentSkipListSet<>(); - public static void registerFactory(String name, - int priority, - Predicate predicate, - Supplier supplier) { - FACTORIES.add(new SchematicBlockFactory<>( - BuildCraftAPI.nameToResourceLocation(name), - priority, - predicate, - supplier + // Calen thread safety: sometimes "air" not registered just after BCBuildersSchematics#preInit:registerSchematicFactory("air", 0, SchematicBlockAir::predicate, SchematicBlockAir::new) + public synchronized static Set> getFactoriesSynchronized() { + return FACTORIES; + } + + public static synchronized void registerFactory(String name, + int priority, + Predicate predicate, + Supplier supplier) { +// FACTORIES.add(new SchematicBlockFactory<>( + getFactoriesSynchronized().add(new SchematicBlockFactory<>( + BuildCraftAPI.nameToResourceLocation(name), + priority, + predicate, + supplier )); } @@ -36,31 +40,34 @@ public static void registerFactory(String name, List blocks, Supplier supplier) { registerFactory( - name, - priority, - context -> blocks.contains(context.block), - supplier + name, + priority, + context -> blocks.contains(context.block), + supplier ); } public static List> getFactories() { - return ImmutableList.copyOf(FACTORIES); +// return ImmutableList.copyOf(FACTORIES); + return ImmutableList.copyOf(getFactoriesSynchronized()); } @Nonnull public static SchematicBlockFactory getFactoryByInstance(S instance) { // noinspection unchecked - return (SchematicBlockFactory) FACTORIES.stream() - .filter(schematicBlockFactory -> schematicBlockFactory.clazz == instance.getClass()) - .findFirst() - .orElseThrow(() -> new IllegalStateException("Didn't find a factory for " + instance.getClass())); +// return (SchematicBlockFactory) FACTORIES.stream() + return (SchematicBlockFactory) getFactoriesSynchronized().stream() + .filter(schematicBlockFactory -> schematicBlockFactory.clazz == instance.getClass()) + .findFirst() + .orElseThrow(() -> new IllegalStateException("Didn't find a factory for " + instance.getClass())); } @Nullable public static SchematicBlockFactory getFactoryByName(ResourceLocation name) { - return FACTORIES.stream() - .filter(schematicBlockFactory -> schematicBlockFactory.name.equals(name)) - .findFirst() - .orElse(null); +// return FACTORIES.stream() + return getFactoriesSynchronized().stream() + .filter(schematicBlockFactory -> schematicBlockFactory.name.equals(name)) + .findFirst() + .orElse(null); } } diff --git a/api/buildcraft/api/schematics/SchematicEntityContext.java b/api/buildcraft/api/schematics/SchematicEntityContext.java index b812556..92d3e03 100644 --- a/api/buildcraft/api/schematics/SchematicEntityContext.java +++ b/api/buildcraft/api/schematics/SchematicEntityContext.java @@ -1,11 +1,11 @@ package buildcraft.api.schematics; -import javax.annotation.Nonnull; - import net.minecraft.entity.Entity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class SchematicEntityContext { @Nonnull public final World world; diff --git a/api/buildcraft/api/schematics/SchematicEntityFactory.java b/api/buildcraft/api/schematics/SchematicEntityFactory.java index a81a52a..f3199b7 100644 --- a/api/buildcraft/api/schematics/SchematicEntityFactory.java +++ b/api/buildcraft/api/schematics/SchematicEntityFactory.java @@ -1,11 +1,10 @@ package buildcraft.api.schematics; -import java.util.function.Predicate; -import java.util.function.Supplier; +import net.minecraft.util.ResourceLocation; import javax.annotation.Nonnull; - -import net.minecraft.util.ResourceLocation; +import java.util.function.Predicate; +import java.util.function.Supplier; public class SchematicEntityFactory implements Comparable> { @Nonnull diff --git a/api/buildcraft/api/schematics/SchematicEntityFactoryRegistry.java b/api/buildcraft/api/schematics/SchematicEntityFactoryRegistry.java index a5525b1..3103b18 100644 --- a/api/buildcraft/api/schematics/SchematicEntityFactoryRegistry.java +++ b/api/buildcraft/api/schematics/SchematicEntityFactoryRegistry.java @@ -1,21 +1,17 @@ package buildcraft.api.schematics; +import buildcraft.api.core.BuildCraftAPI; +import com.google.common.collect.ImmutableList; +import net.minecraft.util.ResourceLocation; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.List; import java.util.Set; import java.util.TreeSet; import java.util.function.Predicate; import java.util.function.Supplier; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.google.common.collect.ImmutableList; - -import net.minecraft.entity.EntityList; -import net.minecraft.util.ResourceLocation; - -import buildcraft.api.core.BuildCraftAPI; - public class SchematicEntityFactoryRegistry { private static final Set> FACTORIES = new TreeSet<>(); @@ -24,22 +20,25 @@ public static void registerFactory(String name, Predicate predicate, Supplier supplier) { FACTORIES.add(new SchematicEntityFactory<>( - BuildCraftAPI.nameToResourceLocation(name), - priority, - predicate, - supplier + BuildCraftAPI.nameToResourceLocation(name), + priority, + predicate, + supplier )); } + // Calen no usage in 1.12.2 + // EntityList.class not present in 1.18.2 public static void registerFactory(String name, int priority, List entities, Supplier supplier) { registerFactory( - name, - priority, - context -> entities.contains(EntityList.getKey(context.entity)), - supplier + name, + priority, +// context -> entities.contains(EntityList.getKey(context.entity)), + context -> entities.contains(context.entity.getType().getRegistryName()), + supplier ); } @@ -51,16 +50,16 @@ public static List> getFactories() { public static SchematicEntityFactory getFactoryByInstance(S instance) { // noinspection unchecked return (SchematicEntityFactory) FACTORIES.stream() - .filter(schematicEntityFactory -> schematicEntityFactory.clazz == instance.getClass()) - .findFirst() - .orElseThrow(() -> new IllegalStateException("Didn't find a factory for " + instance.getClass())); + .filter(schematicEntityFactory -> schematicEntityFactory.clazz == instance.getClass()) + .findFirst() + .orElseThrow(() -> new IllegalStateException("Didn't find a factory for " + instance.getClass())); } @Nullable public static SchematicEntityFactory getFactoryByName(ResourceLocation name) { return FACTORIES.stream() - .filter(schematicEntityFactory -> schematicEntityFactory.name.equals(name)) - .findFirst() - .orElse(null); + .filter(schematicEntityFactory -> schematicEntityFactory.name.equals(name)) + .findFirst() + .orElse(null); } } diff --git a/api/buildcraft/api/statements/IAction.java b/api/buildcraft/api/statements/IAction.java index 2cd0c35..1af6d00 100644 --- a/api/buildcraft/api/statements/IAction.java +++ b/api/buildcraft/api/statements/IAction.java @@ -3,4 +3,5 @@ /** Marker interface that designates a class as being an action. Note that you *must* implement ONE of the following * interfaces to be recognised as an action: {@link IActionInternal}, {@link IActionInternalSided}, or * {@link IActionExternal} */ -public interface IAction extends IStatement {} +public interface IAction extends IStatement { +} diff --git a/api/buildcraft/api/statements/IActionExternal.java b/api/buildcraft/api/statements/IActionExternal.java index 9086612..0d1b7ae 100644 --- a/api/buildcraft/api/statements/IActionExternal.java +++ b/api/buildcraft/api/statements/IActionExternal.java @@ -5,8 +5,8 @@ package buildcraft.api.statements; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; public interface IActionExternal extends IAction { - void actionActivate(TileEntity target, EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); + void actionActivate(TileEntity target, Direction side, IStatementContainer source, IStatementParameter[] parameters); } diff --git a/api/buildcraft/api/statements/IActionInternalSided.java b/api/buildcraft/api/statements/IActionInternalSided.java index 0ae3d70..93c7e90 100644 --- a/api/buildcraft/api/statements/IActionInternalSided.java +++ b/api/buildcraft/api/statements/IActionInternalSided.java @@ -1,7 +1,7 @@ package buildcraft.api.statements; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; public interface IActionInternalSided extends IAction { - void actionActivate(EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); + void actionActivate(Direction side, IStatementContainer source, IStatementParameter[] parameters); } diff --git a/api/buildcraft/api/statements/IActionProvider.java b/api/buildcraft/api/statements/IActionProvider.java index fa550ff..fa1c472 100644 --- a/api/buildcraft/api/statements/IActionProvider.java +++ b/api/buildcraft/api/statements/IActionProvider.java @@ -4,17 +4,16 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; -import java.util.Collection; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; import javax.annotation.Nonnull; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import java.util.Collection; public interface IActionProvider { void addInternalActions(Collection actions, IStatementContainer container); - void addInternalSidedActions(Collection actions, IStatementContainer container, @Nonnull EnumFacing side); + void addInternalSidedActions(Collection actions, IStatementContainer container, @Nonnull Direction side); - void addExternalActions(Collection actions, @Nonnull EnumFacing side, TileEntity tile); + void addExternalActions(Collection actions, @Nonnull Direction side, TileEntity tile); } diff --git a/api/buildcraft/api/statements/IGuiSlot.java b/api/buildcraft/api/statements/IGuiSlot.java index f5cb3b2..57d6f17 100644 --- a/api/buildcraft/api/statements/IGuiSlot.java +++ b/api/buildcraft/api/statements/IGuiSlot.java @@ -1,16 +1,14 @@ package buildcraft.api.statements; -import java.util.List; - -import javax.annotation.Nullable; - -import com.google.common.collect.ImmutableList; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - import buildcraft.api.core.IConvertable; import buildcraft.api.core.render.ISprite; +import com.google.common.collect.ImmutableList; +import net.minecraft.util.text.ITextComponent; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +import javax.annotation.Nullable; +import java.util.List; public interface IGuiSlot extends IConvertable { /** Every statement needs a unique tag, it should be in the format of "<modid>:<name>". @@ -20,21 +18,39 @@ public interface IGuiSlot extends IConvertable { /** Return the description in the UI. Note that this should NEVER be called directly, instead this acts as a bridge * for {@link #getTooltip()}. (As such this might return null or throw an exception) */ - @SideOnly(Side.CLIENT) - String getDescription(); + @OnlyIn(Dist.CLIENT) +// String getDescription(); + ITextComponent getDescription(); + + // Calen + @OnlyIn(Dist.CLIENT) + String getDescriptionKey(); /** @return The full tooltip for the UI. */ - @SideOnly(Side.CLIENT) - default List getTooltip() { - String desc = getDescription(); + @OnlyIn(Dist.CLIENT) + default List getTooltip() { +// String desc = getDescription(); + ITextComponent desc = getDescription(); + if (desc == null) { + return ImmutableList.of(); + } +// return ImmutableList.of(new StringTextComponent(desc)); + return ImmutableList.of(desc); + } + + // Calen + @OnlyIn(Dist.CLIENT) + default List getTooltipKey() { + String desc = getDescriptionKey(); if (desc == null) { return ImmutableList.of(); } +// return ImmutableList.of(new StringTextComponent(desc)); return ImmutableList.of(desc); } /** @return A sprite to show in a GUI, or null if this should not render a sprite. */ - @SideOnly(Side.CLIENT) + @OnlyIn(Dist.CLIENT) @Nullable ISprite getSprite(); } diff --git a/api/buildcraft/api/statements/IStatement.java b/api/buildcraft/api/statements/IStatement.java index b8d61a9..361157a 100644 --- a/api/buildcraft/api/statements/IStatement.java +++ b/api/buildcraft/api/statements/IStatement.java @@ -21,7 +21,7 @@ public interface IStatement extends IGuiSlot { * this checks the classes of the old and new parameters, however it is sensible to override this check in case the * parameters given no longer match. For example if you return {@link StatementParameterItemStack} from * {@link #createParameter(int)} and require the stack to match a filter, but the incoming stack might not. - * + * * @param old * @param index * @return */ diff --git a/api/buildcraft/api/statements/IStatementContainer.java b/api/buildcraft/api/statements/IStatementContainer.java index e08a7e8..f755f7a 100644 --- a/api/buildcraft/api/statements/IStatementContainer.java +++ b/api/buildcraft/api/statements/IStatementContainer.java @@ -4,15 +4,15 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; -import javax.annotation.Nullable; - import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; + +import javax.annotation.Nullable; /** This is implemented by objects containing Statements, such as Gates and TileEntities. */ public interface IStatementContainer { TileEntity getTile(); @Nullable - TileEntity getNeighbourTile(EnumFacing side); + TileEntity getNeighbourTile(Direction side); } diff --git a/api/buildcraft/api/statements/IStatementParameter.java b/api/buildcraft/api/statements/IStatementParameter.java index d90b380..9224d08 100755 --- a/api/buildcraft/api/statements/IStatementParameter.java +++ b/api/buildcraft/api/statements/IStatementParameter.java @@ -4,14 +4,13 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; -import javax.annotation.Nonnull; - +import buildcraft.api.statements.StatementManager.IParamReaderBuf; +import buildcraft.api.statements.StatementManager.IParameterReader; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.PacketBuffer; -import buildcraft.api.statements.StatementManager.IParamReaderBuf; -import buildcraft.api.statements.StatementManager.IParameterReader; +import javax.annotation.Nonnull; public interface IStatementParameter extends IGuiSlot { @@ -26,25 +25,25 @@ default DrawType getDrawType() { /** Return a non-null value to be set as the statement parameter if you handled the mouse click and do not want all * possible values to be shown, or null if you did nothing and wish to show all possible values. - * + * * @see #getPossible(IStatementContainer) */ IStatementParameter onClick(IStatementContainer source, IStatement stmt, ItemStack stack, - StatementMouseClick mouse); + StatementMouseClick mouse); - void writeToNbt(NBTTagCompound nbt); + void writeToNbt(CompoundNBT nbt); /** Writes this parameter to the given {@link PacketBuffer}. The default implementation writes out the value of - * {@link #writeToNbt(NBTTagCompound)}, and that will be passed back into - * {@link IParameterReader#readFromNbt(NBTTagCompound)}. + * {@link #writeToNbt(CompoundNBT)}, and that will be passed back into + * {@link IParameterReader#readFromNbt(CompoundNBT)}. *

    * It is likely that implementors can write a more compact form of themselves, so they are encouraged to override * this and also register an {@link IParamReaderBuf} in * {@link StatementManager#registerParameter(String, IParamReaderBuf)} or * {@link StatementManager#registerParameter(IParameterReader, IParamReaderBuf)} */ default void writeToBuf(PacketBuffer buffer) { - NBTTagCompound nbt = new NBTTagCompound(); + CompoundNBT nbt = new CompoundNBT(); writeToNbt(nbt); - buffer.writeCompoundTag(nbt); + buffer.writeNbt(nbt); } /** This returns the parameter after a left rotation. Used in particular in blueprints orientation. */ diff --git a/api/buildcraft/api/statements/ITrigger.java b/api/buildcraft/api/statements/ITrigger.java index cdb65c9..46e31e7 100644 --- a/api/buildcraft/api/statements/ITrigger.java +++ b/api/buildcraft/api/statements/ITrigger.java @@ -3,4 +3,5 @@ /** Marker interface that designates a class as being a trigger. Note that you *must* implement ONE of the following * interfaces to be recognised as a trigger: {@link ITriggerInternal}, {@link ITriggerInternalSided}, or * {@link ITriggerExternal} */ -public interface ITrigger extends IStatement {} +public interface ITrigger extends IStatement { +} diff --git a/api/buildcraft/api/statements/ITriggerExternal.java b/api/buildcraft/api/statements/ITriggerExternal.java index 87a848f..f70d221 100644 --- a/api/buildcraft/api/statements/ITriggerExternal.java +++ b/api/buildcraft/api/statements/ITriggerExternal.java @@ -5,10 +5,10 @@ package buildcraft.api.statements; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; public interface ITriggerExternal extends ITrigger { - boolean isTriggerActive(TileEntity target, EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); + boolean isTriggerActive(TileEntity target, Direction side, IStatementContainer source, IStatementParameter[] parameters); } diff --git a/api/buildcraft/api/statements/ITriggerExternalOverride.java b/api/buildcraft/api/statements/ITriggerExternalOverride.java index 9b1fd1e..fc50049 100644 --- a/api/buildcraft/api/statements/ITriggerExternalOverride.java +++ b/api/buildcraft/api/statements/ITriggerExternalOverride.java @@ -1,6 +1,6 @@ package buildcraft.api.statements; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; /** This interface can be used by tiles to override external trigger behaviour. * @@ -12,5 +12,5 @@ enum Result { IGNORE } - Result override(EnumFacing side, IStatementContainer source, ITriggerExternal trigger, IStatementParameter[] parameters); + Result override(Direction side, IStatementContainer source, ITriggerExternal trigger, IStatementParameter[] parameters); } diff --git a/api/buildcraft/api/statements/ITriggerInternalSided.java b/api/buildcraft/api/statements/ITriggerInternalSided.java index 73459f0..a2d7206 100644 --- a/api/buildcraft/api/statements/ITriggerInternalSided.java +++ b/api/buildcraft/api/statements/ITriggerInternalSided.java @@ -1,7 +1,7 @@ package buildcraft.api.statements; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; public interface ITriggerInternalSided extends ITrigger { - boolean isTriggerActive(EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); + boolean isTriggerActive(Direction side, IStatementContainer source, IStatementParameter[] parameters); } diff --git a/api/buildcraft/api/statements/ITriggerProvider.java b/api/buildcraft/api/statements/ITriggerProvider.java index 8f3bf03..e9f7fae 100644 --- a/api/buildcraft/api/statements/ITriggerProvider.java +++ b/api/buildcraft/api/statements/ITriggerProvider.java @@ -4,18 +4,17 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; -import java.util.Collection; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; import javax.annotation.Nonnull; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import java.util.Collection; public interface ITriggerProvider { void addInternalTriggers(Collection triggers, IStatementContainer container); - void addInternalSidedTriggers(Collection triggers, IStatementContainer container, @Nonnull EnumFacing side); + void addInternalSidedTriggers(Collection triggers, IStatementContainer container, @Nonnull Direction side); /** Returns the list of triggers available to a gate next to the given block. */ - void addExternalTriggers(Collection triggers, @Nonnull EnumFacing side, TileEntity tile); + void addExternalTriggers(Collection triggers, @Nonnull Direction side, TileEntity tile); } diff --git a/api/buildcraft/api/statements/StatementManager.java b/api/buildcraft/api/statements/StatementManager.java index 49f0915..050a8aa 100644 --- a/api/buildcraft/api/statements/StatementManager.java +++ b/api/buildcraft/api/statements/StatementManager.java @@ -4,21 +4,15 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; -public final class StatementManager { +import java.io.IOException; +import java.util.*; +public final class StatementManager { public static Map statements = new HashMap<>(); public static Map parameters = new HashMap<>(); public static Map paramsBuf = new HashMap<>(); @@ -31,7 +25,7 @@ public final class StatementManager { @FunctionalInterface public interface IParameterReader { - IStatementParameter readFromNbt(NBTTagCompound nbt); + IStatementParameter readFromNbt(CompoundNBT nbt); } @FunctionalInterface @@ -40,7 +34,8 @@ public interface IParamReaderBuf { } /** Deactivate constructor */ - private StatementManager() {} + private StatementManager() { + } public static void registerTriggerProvider(ITriggerProvider provider) { if (provider != null && !triggerProviders.contains(provider)) { @@ -59,11 +54,11 @@ public static void registerStatement(IStatement statement) { } public static void registerParameter(IParameterReader reader) { - registerParameter(reader, buf -> reader.readFromNbt(buf.readCompoundTag())); + registerParameter(reader, buf -> reader.readFromNbt(buf.readNbt())); } public static void registerParameter(IParameterReader reader, IParamReaderBuf bufReader) { - String name = reader.readFromNbt(new NBTTagCompound()).getUniqueTag(); + String name = reader.readFromNbt(new CompoundNBT()).getUniqueTag(); registerParameter(name, reader); registerParameter(name, bufReader); } @@ -76,7 +71,7 @@ public static void registerParameter(String name, IParamReaderBuf reader) { paramsBuf.put(name, reader); } - public static List getExternalTriggers(EnumFacing side, TileEntity entity) { + public static List getExternalTriggers(Direction side, TileEntity entity) { if (entity instanceof IOverrideDefaultStatements) { List result = ((IOverrideDefaultStatements) entity).overrideTriggers(); if (result != null) { @@ -93,7 +88,7 @@ public static List getExternalTriggers(EnumFacing side, TileEn return new ArrayList<>(triggers); } - public static List getExternalActions(EnumFacing side, TileEntity entity) { + public static List getExternalActions(Direction side, TileEntity entity) { if (entity instanceof IOverrideDefaultStatements) { List result = ((IOverrideDefaultStatements) entity).overrideActions(); if (result != null) { @@ -130,7 +125,7 @@ public static List getInternalActions(IStatementContainer conta return new ArrayList<>(actions); } - public static List getInternalSidedTriggers(IStatementContainer container, EnumFacing side) { + public static List getInternalSidedTriggers(IStatementContainer container, Direction side) { LinkedHashSet triggers = new LinkedHashSet<>(); for (ITriggerProvider provider : triggerProviders) { @@ -140,7 +135,7 @@ public static List getInternalSidedTriggers(IStatementCon return new ArrayList<>(triggers); } - public static List getInternalSidedActions(IStatementContainer container, EnumFacing side) { + public static List getInternalSidedActions(IStatementContainer container, Direction side) { LinkedHashSet actions = new LinkedHashSet<>(); for (IActionProvider provider : actionProviders) { diff --git a/api/buildcraft/api/statements/StatementParameterItemStack.java b/api/buildcraft/api/statements/StatementParameterItemStack.java index 253bd46..8b1645e 100755 --- a/api/buildcraft/api/statements/StatementParameterItemStack.java +++ b/api/buildcraft/api/statements/StatementParameterItemStack.java @@ -1,25 +1,24 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.statements; -import java.util.List; -import java.util.Objects; - -import javax.annotation.Nonnull; - +import buildcraft.api.core.render.ISprite; import com.google.common.collect.ImmutableList; - import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import buildcraft.api.core.render.ISprite; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; public class StatementParameterItemStack implements IStatementParameter { // needed because ItemStack.EMPTY doesn't have @Nonnull applied to it :/ @@ -47,8 +46,8 @@ public StatementParameterItemStack(@Nonnull ItemStack stack) { this.stack = stack; } - public StatementParameterItemStack(NBTTagCompound nbt) { - ItemStack read = new ItemStack(nbt.getCompoundTag("stack")); + public StatementParameterItemStack(CompoundNBT nbt) { + ItemStack read = ItemStack.of(nbt.getCompound("stack")); if (read.isEmpty()) { stack = EMPTY_STACK; } else { @@ -57,11 +56,11 @@ public StatementParameterItemStack(NBTTagCompound nbt) { } @Override - public void writeToNbt(NBTTagCompound compound) { + public void writeToNbt(CompoundNBT compound) { if (!stack.isEmpty()) { - NBTTagCompound tagCompound = new NBTTagCompound(); - stack.writeToNBT(tagCompound); - compound.setTag("stack", tagCompound); + CompoundNBT tagCompound = new CompoundNBT(); + stack.save(tagCompound); + compound.put("stack", tagCompound); } } @@ -78,7 +77,7 @@ public ItemStack getItemStack() { @Override public StatementParameterItemStack onClick( - IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse + IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse ) { if (stack.isEmpty()) { return EMPTY; @@ -94,8 +93,7 @@ public boolean equals(Object object) { if (object instanceof StatementParameterItemStack) { StatementParameterItemStack param = (StatementParameterItemStack) object; - return ItemStack.areItemStacksEqual(stack, param.stack) - && ItemStack.areItemStackTagsEqual(stack, param.stack); + return ItemStack.matches(stack, param.stack); } else { return false; } @@ -107,27 +105,50 @@ public int hashCode() { } @Override - @SideOnly(Side.CLIENT) - public String getDescription() { + @OnlyIn(Dist.CLIENT) + public ITextComponent getDescription() { + throw new UnsupportedOperationException("Don't call getDescription directly!"); + } + + @Override + @OnlyIn(Dist.CLIENT) + public String getDescriptionKey() { throw new UnsupportedOperationException("Don't call getDescription directly!"); } @Override - @SideOnly(Side.CLIENT) - public List getTooltip() { + @OnlyIn(Dist.CLIENT) + public List getTooltip() { if (stack.isEmpty()) { return ImmutableList.of(); } - List tooltip = stack.getTooltip(null, ITooltipFlag.TooltipFlags.NORMAL); + List tooltip = stack.getTooltipLines(null, ITooltipFlag.TooltipFlags.NORMAL); if (!tooltip.isEmpty()) { - tooltip.set(0, stack.getRarity().rarityColor + tooltip.get(0)); + tooltip.set(0, new StringTextComponent(stack.getRarity().color.toString()).append(tooltip.get(0))); for (int i = 1; i < tooltip.size(); i++) { - tooltip.set(i, TextFormatting.GRAY + tooltip.get(i)); + tooltip.set(i, new StringTextComponent(TextFormatting.GRAY.toString()).append(tooltip.get(i))); } } return tooltip; } + @Override + @OnlyIn(Dist.CLIENT) + public List getTooltipKey() { + if (stack.isEmpty()) { + return ImmutableList.of(); + } + List tooltip = stack.getTooltipLines(null, ITooltipFlag.TooltipFlags.NORMAL); + List toolTipRet = new ArrayList<>(tooltip.size()); + if (!tooltip.isEmpty()) { + toolTipRet.set(0, new StringTextComponent(stack.getRarity().color.toString()).append(tooltip.get(0)).getString()); + for (int i = 1; i < tooltip.size(); i++) { + toolTipRet.set(i, new StringTextComponent(TextFormatting.GRAY.toString()).append(tooltip.get(i)).getString()); + } + } + return toolTipRet; + } + @Override public String getUniqueTag() { return "buildcraft:stack"; diff --git a/api/buildcraft/api/statements/StatementSlot.java b/api/buildcraft/api/statements/StatementSlot.java index b3306b4..55d117f 100755 --- a/api/buildcraft/api/statements/StatementSlot.java +++ b/api/buildcraft/api/statements/StatementSlot.java @@ -4,11 +4,11 @@ * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.statements; +import buildcraft.api.core.EnumPipePart; + import java.util.Arrays; import java.util.Objects; -import buildcraft.api.core.EnumPipePart; - public class StatementSlot { public IStatement statement; public IStatementParameter[] parameters; diff --git a/api/buildcraft/api/statements/containers/IFillerStatementContainer.java b/api/buildcraft/api/statements/containers/IFillerStatementContainer.java index 475a01d..0c39452 100644 --- a/api/buildcraft/api/statements/containers/IFillerStatementContainer.java +++ b/api/buildcraft/api/statements/containers/IFillerStatementContainer.java @@ -1,14 +1,13 @@ package buildcraft.api.statements.containers; -import javax.annotation.Nullable; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - import buildcraft.api.core.IBox; import buildcraft.api.filler.IFillerPattern; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import javax.annotation.Nullable; public interface IFillerStatementContainer extends IStatementContainer { diff --git a/api/buildcraft/api/statements/containers/IRedstoneStatementContainer.java b/api/buildcraft/api/statements/containers/IRedstoneStatementContainer.java index 1d7989a..41e9407 100644 --- a/api/buildcraft/api/statements/containers/IRedstoneStatementContainer.java +++ b/api/buildcraft/api/statements/containers/IRedstoneStatementContainer.java @@ -1,17 +1,17 @@ package buildcraft.api.statements.containers; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; public interface IRedstoneStatementContainer { /** Get the redstone input from a given side. - * + * * @param side The side - use "null" for maximum input. * @return The redstone input, from 0 to 15. */ - int getRedstoneInput(EnumFacing side); + int getRedstoneInput(Direction side); /** Set the redstone input for a given side. - * + * * @param side The side - use "null" for all sides. * @return Whether the set was successful. */ - boolean setRedstoneOutput(EnumFacing side, int value); + boolean setRedstoneOutput(Direction side, int value); } diff --git a/api/buildcraft/api/statements/containers/ISidedStatementContainer.java b/api/buildcraft/api/statements/containers/ISidedStatementContainer.java index b65ace4..3d90112 100644 --- a/api/buildcraft/api/statements/containers/ISidedStatementContainer.java +++ b/api/buildcraft/api/statements/containers/ISidedStatementContainer.java @@ -1,10 +1,9 @@ package buildcraft.api.statements.containers; -import net.minecraft.util.EnumFacing; - import buildcraft.api.statements.IStatementContainer; +import net.minecraft.util.Direction; /** Created by asie on 3/14/15. */ public interface ISidedStatementContainer extends IStatementContainer { - EnumFacing getSide(); + Direction getSide(); } diff --git a/api/buildcraft/api/statements/package-info.java b/api/buildcraft/api/statements/package-info.java index 64642d7..1cf5f34 100644 --- a/api/buildcraft/api/statements/package-info.java +++ b/api/buildcraft/api/statements/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.1", owner = "buildcraftapi_core", provides = "buildcraftapi_statements") +//@API(apiVersion = "1.1", owner = "buildcraftapi_core", provides = "buildcraftapi_statements") package buildcraft.api.statements; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/template/ITemplateHandler.java b/api/buildcraft/api/template/ITemplateHandler.java index e0dac1b..d477d43 100644 --- a/api/buildcraft/api/template/ITemplateHandler.java +++ b/api/buildcraft/api/template/ITemplateHandler.java @@ -6,11 +6,11 @@ package buildcraft.api.template; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public interface ITemplateHandler { - boolean handle(World world, BlockPos pos, EntityPlayer player, ItemStack stack); + boolean handle(World world, BlockPos pos, PlayerEntity player, ItemStack stack); } diff --git a/api/buildcraft/api/template/ITemplateRegistry.java b/api/buildcraft/api/template/ITemplateRegistry.java index ec6d250..8a69ad7 100644 --- a/api/buildcraft/api/template/ITemplateRegistry.java +++ b/api/buildcraft/api/template/ITemplateRegistry.java @@ -6,13 +6,12 @@ package buildcraft.api.template; -import net.minecraft.entity.player.EntityPlayer; +import buildcraft.api.core.EnumHandlerPriority; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import buildcraft.api.core.EnumHandlerPriority; - public interface ITemplateRegistry { /** Adds a handler with a {@link EnumHandlerPriority} of {@linkplain EnumHandlerPriority#NORMAL} */ default void addHandler(ITemplateHandler handler) { @@ -21,5 +20,5 @@ default void addHandler(ITemplateHandler handler) { void addHandler(ITemplateHandler handler, EnumHandlerPriority priority); - boolean handle(World world, BlockPos pos, EntityPlayer player, ItemStack stack); + boolean handle(World world, BlockPos pos, PlayerEntity player, ItemStack stack); } diff --git a/api/buildcraft/api/tiles/IBCTileMenuProvider.java b/api/buildcraft/api/tiles/IBCTileMenuProvider.java new file mode 100644 index 0000000..572b8fc --- /dev/null +++ b/api/buildcraft/api/tiles/IBCTileMenuProvider.java @@ -0,0 +1,9 @@ +package buildcraft.api.tiles; + +import buildcraft.api.net.IMessage; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.inventory.container.INamedContainerProvider; + +public interface IBCTileMenuProvider extends INamedContainerProvider { + public abstract IMessage onServerPlayerOpenNoSend(PlayerEntity player); +} diff --git a/api/buildcraft/api/tiles/IDebuggable.java b/api/buildcraft/api/tiles/IDebuggable.java index 8a9f2dc..110e323 100644 --- a/api/buildcraft/api/tiles/IDebuggable.java +++ b/api/buildcraft/api/tiles/IDebuggable.java @@ -1,23 +1,26 @@ package buildcraft.api.tiles; -import java.util.List; - -import net.minecraft.util.EnumFacing; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.Direction; +import net.minecraft.util.text.ITextComponent; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.List; public interface IDebuggable { /** Get the debug information from a tile entity as a list of strings, used for the F3 debug menu. The left and * right parameters correspond to the sides of the F3 screen. - * + * + * @param left {@link I18n} doesn't exist in Server Side, so we should use {@link ITextComponent}. * @param side The side the block was clicked on, may be null if we don't know, or is the "centre" side */ - void getDebugInfo(List left, List right, EnumFacing side); +// void getDebugInfo(List left, List right, Direction side); + void getDebugInfo(List left, List right, Direction side); - /** Same as {@link #getDebugInfo(List, List, EnumFacing)}, but only for client + /** Same as {@link #getDebugInfo(List, List, Direction)}, but only for client * - * @param side same as for {@link #getDebugInfo(List, List, EnumFacing)} */ - @SideOnly(Side.CLIENT) - default void getClientDebugInfo(List left, List right, EnumFacing side) { + * @param side same as for {@link #getDebugInfo(List, List, Direction)} */ + @OnlyIn(Dist.CLIENT) + default void getClientDebugInfo(List left, List right, Direction side) { } } diff --git a/api/buildcraft/api/tiles/IHasWork.java b/api/buildcraft/api/tiles/IHasWork.java index fa87196..5e3b57f 100644 --- a/api/buildcraft/api/tiles/IHasWork.java +++ b/api/buildcraft/api/tiles/IHasWork.java @@ -8,7 +8,7 @@ * cetera). */ public interface IHasWork { /** Check if the Tile Entity is currently doing any work. - * + * * @return True if the Tile Entity is doing work. */ boolean hasWork(); } diff --git a/api/buildcraft/api/tiles/IHeatable.java b/api/buildcraft/api/tiles/IHeatable.java index d789ab5..a9eb43c 100644 --- a/api/buildcraft/api/tiles/IHeatable.java +++ b/api/buildcraft/api/tiles/IHeatable.java @@ -19,7 +19,7 @@ public interface IHeatable { double getCurrentHeatValue(); /** Set the heat of the tile. - * + * * @param value Heat value, in degrees. * @return The heat the tile has after the set. */ double setHeatValue(double value); diff --git a/api/buildcraft/api/tiles/ITickable.java b/api/buildcraft/api/tiles/ITickable.java new file mode 100644 index 0000000..6aa7824 --- /dev/null +++ b/api/buildcraft/api/tiles/ITickable.java @@ -0,0 +1,46 @@ +package buildcraft.api.tiles; + +import net.minecraft.tileentity.ITickableTileEntity; +import net.minecraft.tileentity.TileEntity; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +// From 1.12.2 MC +public interface ITickable extends ITickableTileEntity { + @Override + default void tick() { + update(); + } + + /** Like the old updateEntity(), except more generic. */ + default void update() { + LinkedList taskOfCurrentTile = tasks.get(this); + if (taskOfCurrentTile != null && !taskOfCurrentTile.isEmpty()) { + taskOfCurrentTile.forEach(Runnable::run); + taskOfCurrentTile.clear(); + } + } + + static final Map> tasks = new ConcurrentHashMap<>(); + + // Calen + + /** + * When world loading, TileEntity#level may be null, or World#getBlockState may cause dead lock + * + * @param task + * @param forceDelay If true, the task will be delayed to next update() even if the world is not null. + */ + default void runWhenWorldNotNull(Runnable task, boolean forceDelay) { + // Calen: don't create abstract method getLevel() in ITickable, because it will not be renamed when reobf, ant will become a different method from TileEntity#getLevel. + if (forceDelay || ((TileEntity) this).getLevel() == null) { + List tasksOfCurrentTile = tasks.computeIfAbsent(this, k -> new LinkedList<>()); + tasksOfCurrentTile.add(task); + } else { + task.run(); + } + } +} diff --git a/api/buildcraft/api/tiles/ITileAreaProvider.java b/api/buildcraft/api/tiles/ITileAreaProvider.java index 89a7c14..031937f 100644 --- a/api/buildcraft/api/tiles/ITileAreaProvider.java +++ b/api/buildcraft/api/tiles/ITileAreaProvider.java @@ -1,8 +1,7 @@ package buildcraft.api.tiles; -import net.minecraft.util.math.BlockPos; - import buildcraft.api.core.IAreaProvider; +import net.minecraft.util.math.BlockPos; /** Used for more fine-grained control of whether or not a machine connects to the provider here. */ public interface ITileAreaProvider extends IAreaProvider { diff --git a/api/buildcraft/api/tiles/TilesAPI.java b/api/buildcraft/api/tiles/TilesAPI.java index abacf92..a7100b3 100644 --- a/api/buildcraft/api/tiles/TilesAPI.java +++ b/api/buildcraft/api/tiles/TilesAPI.java @@ -1,25 +1,25 @@ package buildcraft.api.tiles; -import javax.annotation.Nonnull; - +import buildcraft.api.core.CapabilitiesHelper; import net.minecraftforge.common.capabilities.Capability; -import buildcraft.api.core.CapabilitiesHelper; +import javax.annotation.Nonnull; public class TilesAPI { @Nonnull - public static final Capability CAP_CONTROLLABLE; + public static Capability CAP_CONTROLLABLE; @Nonnull - public static final Capability CAP_HAS_WORK; + public static Capability CAP_HAS_WORK; @Nonnull - public static final Capability CAP_HEATABLE; + public static Capability CAP_HEATABLE; @Nonnull - public static final Capability CAP_TILE_AREA_PROVIDER; + public static Capability CAP_TILE_AREA_PROVIDER; - static { + // static + public static void regCaps() { CAP_CONTROLLABLE = CapabilitiesHelper.registerCapability(IControllable.class); CAP_HAS_WORK = CapabilitiesHelper.registerCapability(IHasWork.class); CAP_HEATABLE = CapabilitiesHelper.registerCapability(IHeatable.class); diff --git a/api/buildcraft/api/tiles/package-info.java b/api/buildcraft/api/tiles/package-info.java index ad60078..53b1774 100644 --- a/api/buildcraft/api/tiles/package-info.java +++ b/api/buildcraft/api/tiles/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.2", owner = "buildcraftapi_core", provides = "buildcraftapi_tiles") +//@API(apiVersion = "1.2", owner = "buildcraftapi_core", provides = "buildcraftapi_tiles") package buildcraft.api.tiles; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/tools/IToolWrench.java b/api/buildcraft/api/tools/IToolWrench.java index 9201b55..e14e9d1 100644 --- a/api/buildcraft/api/tools/IToolWrench.java +++ b/api/buildcraft/api/tools/IToolWrench.java @@ -4,9 +4,9 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.tools; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumHand; +import net.minecraft.util.Hand; import net.minecraft.util.math.RayTraceResult; /*** Implement this interface on subclasses of Item to have that item work as a wrench for buildcraft */ @@ -20,7 +20,7 @@ public interface IToolWrench { * @param rayTrace - The object that is being wrenched * * @return true if wrenching is allowed, false if not */ - boolean canWrench(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace); + boolean canWrench(PlayerEntity player, Hand hand, ItemStack wrench, RayTraceResult rayTrace); /*** Callback after the wrench has been used. This can be used to decrease durability or for other purposes. * @@ -28,5 +28,5 @@ public interface IToolWrench { * @param hand - Which hand was holding the wrench * @param wrench - The item stack that holds the wrench * @param rayTrace - The object that is being wrenched */ - void wrenchUsed(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace); + void wrenchUsed(PlayerEntity player, Hand hand, ItemStack wrench, RayTraceResult rayTrace); } diff --git a/api/buildcraft/api/tools/package-info.java b/api/buildcraft/api/tools/package-info.java index f089abf..8b081c3 100644 --- a/api/buildcraft/api/tools/package-info.java +++ b/api/buildcraft/api/tools/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.0", owner = "buildcraftapi_core", provides = "buildcraftapi_tools") +//@API(apiVersion = "1.0", owner = "buildcraftapi_core", provides = "buildcraftapi_tools") package buildcraft.api.tools; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/transport/EnumWirePart.java b/api/buildcraft/api/transport/EnumWirePart.java index 687ba67..424c1f5 100644 --- a/api/buildcraft/api/transport/EnumWirePart.java +++ b/api/buildcraft/api/transport/EnumWirePart.java @@ -1,9 +1,10 @@ package buildcraft.api.transport; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumFacing.AxisDirection; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.vector.Vector3d; public enum EnumWirePart { EAST_UP_SOUTH(true, true, true), @@ -20,30 +21,36 @@ public enum EnumWirePart { public final AxisDirection x, y, z; /** The bounding box for rendering a wire or selecting an already-placed wire. */ - public final AxisAlignedBB boundingBox; + public final VoxelShape boundingBox; /** The bounding box that is used when adding pipe wire to a pipe */ - public final AxisAlignedBB boundingBoxPossible; + public final VoxelShape boundingBoxPossible; EnumWirePart(boolean x, boolean y, boolean z) { this.x = x ? AxisDirection.POSITIVE : AxisDirection.NEGATIVE; this.y = y ? AxisDirection.POSITIVE : AxisDirection.NEGATIVE; this.z = z ? AxisDirection.POSITIVE : AxisDirection.NEGATIVE; - double x1 = this.x.getOffset() * (5 / 16.0) + 0.5; - double y1 = this.y.getOffset() * (5 / 16.0) + 0.5; - double z1 = this.z.getOffset() * (5 / 16.0) + 0.5; - double x2 = this.x.getOffset() * (4 / 16.0) + 0.5; - double y2 = this.y.getOffset() * (4 / 16.0) + 0.5; - double z2 = this.z.getOffset() * (4 / 16.0) + 0.5; - this.boundingBox = new AxisAlignedBB(x1, y1, z1, x2, y2, z2); + double x1 = this.x.getStep() * (5 / 16.0) + 0.5; + double y1 = this.y.getStep() * (5 / 16.0) + 0.5; + double z1 = this.z.getStep() * (5 / 16.0) + 0.5; + double x2 = this.x.getStep() * (4 / 16.0) + 0.5; + double y2 = this.y.getStep() * (4 / 16.0) + 0.5; + double z2 = this.z.getStep() * (4 / 16.0) + 0.5; + this.boundingBox = VoxelShapes.box(Math.min(x1, x2), Math.min(y1, y2), Math.min(z1, z2), Math.max(x1, x2), Math.max(y1, y2), Math.max(z1, z2)); - Vec3d center = new Vec3d(0.5, 0.5, 0.5); - Vec3d edge = new Vec3d(x ? 0.75 : 0.25, y ? 0.75 : 0.25, z ? 0.75 : 0.25); - this.boundingBoxPossible = new AxisAlignedBB(center.x, center.y, center.z, edge.x, - edge.y, edge.z); + Vector3d center = new Vector3d(0.5, 0.5, 0.5); + Vector3d edge = new Vector3d(x ? 0.75 : 0.25, y ? 0.75 : 0.25, z ? 0.75 : 0.25); + this.boundingBoxPossible = VoxelShapes.box( + Math.min(center.x, edge.x), + Math.min(center.y, edge.y), + Math.min(center.z, edge.z), + Math.max(center.x, edge.x), + Math.max(center.y, edge.y), + Math.max(center.z, edge.z) + ); } - public AxisDirection getDirection(EnumFacing.Axis axis) { + public AxisDirection getDirection(Direction.Axis axis) { switch (axis) { case X: return x; diff --git a/api/buildcraft/api/transport/IInjectable.java b/api/buildcraft/api/transport/IInjectable.java index 2aeebd6..9ac6b40 100644 --- a/api/buildcraft/api/transport/IInjectable.java +++ b/api/buildcraft/api/transport/IInjectable.java @@ -1,16 +1,17 @@ package buildcraft.api.transport; +import net.minecraft.item.DyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Direction; + import javax.annotation.Nonnull; -import net.minecraft.item.EnumDyeColor; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; /** Interface for pipes to implement if they can accept items in a similar fashion to BC pipes. */ public interface IInjectable { /** Tests to see if this pipe can accept items from the given direction. Useless to call this if you are going to - * call {@link #injectItem(ItemStack, boolean, EnumFacing, EnumDyeColor, double)} straight after. */ - boolean canInjectItems(EnumFacing from); + * call {@link #injectItem(ItemStack, boolean, Direction, DyeColor, double)} straight after. */ + boolean canInjectItems(Direction from); /** Offers an ItemStack for addition to the pipe. Will be rejected if the pipe doesn't accept items from that side. * This should never be called on the client side! Implementors are free to throw an exception if be called on the @@ -23,5 +24,5 @@ public interface IInjectable { * @param speed The speed of the item to be added (in blocks per tick) or {@code <=0} if a default should be used. * @return The left over stack that was not accepted. */ @Nonnull - ItemStack injectItem(@Nonnull ItemStack stack, boolean doAdd, EnumFacing from, EnumDyeColor color, double speed); + ItemStack injectItem(@Nonnull ItemStack stack, boolean doAdd, Direction from, DyeColor color, double speed); } diff --git a/api/buildcraft/api/transport/IItemPluggable.java b/api/buildcraft/api/transport/IItemPluggable.java index a55a0c4..f9eb48f 100644 --- a/api/buildcraft/api/transport/IItemPluggable.java +++ b/api/buildcraft/api/transport/IItemPluggable.java @@ -1,27 +1,25 @@ package buildcraft.api.transport; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; - import buildcraft.api.transport.pipe.IPipeHolder; import buildcraft.api.transport.pluggable.PipePluggable; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Direction; +import net.minecraft.util.Hand; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** Designates an item that can be placed onto a pipe as a {@link PipePluggable}. */ public interface IItemPluggable { /** Called when this item is placed onto a pipe holder. This can return null if this item does not make a valid * pluggable. Note that if you return a non-null pluggable then it will *definitely* be added to the pipe, and you * are responsible for making all the effects yourself (like the sound effect). - * + * * @param stack The stack that holds this item * @param holder The pipe holder * @param side The side that the pluggable should be placed on * @return A pluggable to place onto the pipe */ @Nullable - PipePluggable onPlace(@Nonnull ItemStack stack, IPipeHolder holder, EnumFacing side, EntityPlayer player, - EnumHand hand); + PipePluggable onPlace(@Nonnull ItemStack stack, IPipeHolder holder, Direction side, PlayerEntity player, Hand hand); } diff --git a/api/buildcraft/api/transport/IStripesActivator.java b/api/buildcraft/api/transport/IStripesActivator.java index a0dd7c8..88f6591 100644 --- a/api/buildcraft/api/transport/IStripesActivator.java +++ b/api/buildcraft/api/transport/IStripesActivator.java @@ -4,13 +4,13 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; -import javax.annotation.Nonnull; - import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; + +import javax.annotation.Nonnull; public interface IStripesActivator { - boolean sendItem(@Nonnull ItemStack itemStack, EnumFacing from); + boolean sendItem(@Nonnull ItemStack itemStack, Direction from); - void dropItem(@Nonnull ItemStack itemStack, EnumFacing from); + void dropItem(@Nonnull ItemStack itemStack, Direction from); } diff --git a/api/buildcraft/api/transport/IStripesHandlerBlock.java b/api/buildcraft/api/transport/IStripesHandlerBlock.java index 888cac4..674eeba 100644 --- a/api/buildcraft/api/transport/IStripesHandlerBlock.java +++ b/api/buildcraft/api/transport/IStripesHandlerBlock.java @@ -1,7 +1,7 @@ package buildcraft.api.transport; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumFacing; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -14,5 +14,5 @@ public interface IStripesHandlerBlock { * @param activator * @return True if this broke a block, false otherwise (note that this handler MUST NOT return false if it has * changed the world in any way) */ - boolean handle(World world, BlockPos pos, EnumFacing direction, EntityPlayer player, IStripesActivator activator); + boolean handle(World world, BlockPos pos, Direction direction, PlayerEntity player, IStripesActivator activator); } diff --git a/api/buildcraft/api/transport/IStripesHandlerItem.java b/api/buildcraft/api/transport/IStripesHandlerItem.java index 6512be8..41b1aac 100644 --- a/api/buildcraft/api/transport/IStripesHandlerItem.java +++ b/api/buildcraft/api/transport/IStripesHandlerItem.java @@ -4,20 +4,20 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; +import net.minecraft.util.Direction; +import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public interface IStripesHandlerItem { /** Called to handle the given {@link ItemStack} within the world. Note that the player's inventory will be empty, - * except that the target stack will be set into its {@link EnumHand#MAIN_HAND}. Any items left in the players + * except that the target stack will be set into its {@link Hand#MAIN_HAND}. Any items left in the players * inventory will be returned back through the activator with - * {@link IStripesActivator#sendItem(ItemStack, EnumFacing)} - * + * {@link IStripesActivator#sendItem(ItemStack, Direction)} + * * @param world * @param pos * @param direction @@ -26,5 +26,5 @@ public interface IStripesHandlerItem { * @param activator * @return True if this used the item, false otherwise (note that this handler MUST NOT return false if it has * changed the world in any way) */ - boolean handle(World world, BlockPos pos, EnumFacing direction, ItemStack stack, EntityPlayer player, IStripesActivator activator); + boolean handle(World world, BlockPos pos, Direction direction, ItemStack stack, PlayerEntity player, IStripesActivator activator); } diff --git a/api/buildcraft/api/transport/IStripesRegistry.java b/api/buildcraft/api/transport/IStripesRegistry.java index ae69806..b452a43 100644 --- a/api/buildcraft/api/transport/IStripesRegistry.java +++ b/api/buildcraft/api/transport/IStripesRegistry.java @@ -1,13 +1,12 @@ package buildcraft.api.transport; -import net.minecraft.entity.player.EntityPlayer; +import buildcraft.api.core.EnumHandlerPriority; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import buildcraft.api.core.EnumHandlerPriority; - public interface IStripesRegistry { /** Adds a handler with a {@link EnumHandlerPriority} of {@linkplain EnumHandlerPriority#NORMAL} */ default void addHandler(IStripesHandlerItem handler) { @@ -27,15 +26,15 @@ default void addHandler(IStripesHandlerBlock handler) { * @return True if a handler handled the itemstack, false otherwise (and so nothing has been done) */ boolean handleItem(World world, BlockPos pos, - EnumFacing direction, + Direction direction, ItemStack stack, - EntityPlayer player, + PlayerEntity player, IStripesActivator activator); /** @return True if a handler broke a block, false otherwise (and so nothing has been done) */ boolean handleBlock(World world, BlockPos pos, - EnumFacing direction, - EntityPlayer player, + Direction direction, + PlayerEntity player, IStripesActivator activator); } diff --git a/api/buildcraft/api/transport/IWireEmitter.java b/api/buildcraft/api/transport/IWireEmitter.java index 4b480e2..13f64b6 100644 --- a/api/buildcraft/api/transport/IWireEmitter.java +++ b/api/buildcraft/api/transport/IWireEmitter.java @@ -6,13 +6,13 @@ package buildcraft.api.transport; -import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.DyeColor; public interface IWireEmitter { /** Checks to see if this wire emitter is currently emitting the given colour. Only used to check if a given emitter * is still active. */ - boolean isEmitting(EnumDyeColor colour); + boolean isEmitting(DyeColor colour); /** Emits the given wire colour this tick. */ - void emitWire(EnumDyeColor colour); + void emitWire(DyeColor colour); } diff --git a/api/buildcraft/api/transport/IWireManager.java b/api/buildcraft/api/transport/IWireManager.java index 942c3ab..3d79f71 100644 --- a/api/buildcraft/api/transport/IWireManager.java +++ b/api/buildcraft/api/transport/IWireManager.java @@ -1,8 +1,7 @@ package buildcraft.api.transport; -import net.minecraft.item.EnumDyeColor; - import buildcraft.api.transport.pipe.IPipeHolder; +import net.minecraft.item.DyeColor; public interface IWireManager { @@ -10,15 +9,15 @@ public interface IWireManager { void updateBetweens(boolean recursive); - EnumDyeColor getColorOfPart(EnumWirePart part); + DyeColor getColorOfPart(EnumWirePart part); - EnumDyeColor removePart(EnumWirePart part); + DyeColor removePart(EnumWirePart part); - boolean addPart(EnumWirePart part, EnumDyeColor colour); + boolean addPart(EnumWirePart part, DyeColor colour); - boolean hasPartOfColor(EnumDyeColor color); + boolean hasPartOfColor(DyeColor color); boolean isPowered(EnumWirePart part); - boolean isAnyPowered(EnumDyeColor color); + boolean isAnyPowered(DyeColor color); } diff --git a/api/buildcraft/api/transport/WireNode.java b/api/buildcraft/api/transport/WireNode.java index 5430b64..75efd02 100644 --- a/api/buildcraft/api/transport/WireNode.java +++ b/api/buildcraft/api/transport/WireNode.java @@ -1,12 +1,12 @@ package buildcraft.api.transport; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.math.BlockPos; + import java.util.EnumMap; import java.util.Map; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumFacing.AxisDirection; -import net.minecraft.util.math.BlockPos; - public class WireNode { public final BlockPos pos; public final EnumWirePart part; @@ -30,7 +30,7 @@ public boolean equals(Object obj) { if (getClass() != obj.getClass()) return false; WireNode other = (WireNode) obj; return part == other.part // - && pos.equals(other.pos); + && pos.equals(other.pos); } @Override @@ -38,22 +38,22 @@ public String toString() { return "(" + pos.getX() + ", " + pos.getY() + ", " + pos.getZ() + ", " + part + ")"; } - public WireNode offset(EnumFacing face) { - int nx = (part.x == AxisDirection.POSITIVE ? 1 : 0) + face.getFrontOffsetX(); - int ny = (part.y == AxisDirection.POSITIVE ? 1 : 0) + face.getFrontOffsetY(); - int nz = (part.z == AxisDirection.POSITIVE ? 1 : 0) + face.getFrontOffsetZ(); + public WireNode offset(Direction face) { + int nx = (part.x == AxisDirection.POSITIVE ? 1 : 0) + face.getStepX(); + int ny = (part.y == AxisDirection.POSITIVE ? 1 : 0) + face.getStepY(); + int nz = (part.z == AxisDirection.POSITIVE ? 1 : 0) + face.getStepZ(); EnumWirePart nPart = EnumWirePart.get(nx, ny, nz); if (nx < 0 || ny < 0 || nz < 0 || nx > 1 || ny > 1 || nz > 1) { - return new WireNode(pos.offset(face), nPart); + return new WireNode(pos.relative(face), nPart); } else { return new WireNode(pos, nPart); } } - public Map getAllPossibleConnections() { - Map map = new EnumMap<>(EnumFacing.class); + public Map getAllPossibleConnections() { + Map map = new EnumMap<>(Direction.class); - for (EnumFacing face : EnumFacing.VALUES) { + for (Direction face : Direction.values()) { map.put(face, offset(face)); } return map; diff --git a/api/buildcraft/api/transport/package-info.java b/api/buildcraft/api/transport/package-info.java index b9cd4de..ea4e143 100644 --- a/api/buildcraft/api/transport/package-info.java +++ b/api/buildcraft/api/transport/package-info.java @@ -2,7 +2,5 @@ * * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "5.0", owner = "buildcraftapi_core", provides = "buildcraftapi_transport") +//@API(apiVersion = "5.0", owner = "buildcraftapi_core", provides = "buildcraftapi_transport") package buildcraft.api.transport; - -import net.minecraftforge.fml.common.API; diff --git a/api/buildcraft/api/transport/pipe/ICustomPipeConnection.java b/api/buildcraft/api/transport/pipe/ICustomPipeConnection.java index d4ca9ab..20868a8 100644 --- a/api/buildcraft/api/transport/pipe/ICustomPipeConnection.java +++ b/api/buildcraft/api/transport/pipe/ICustomPipeConnection.java @@ -1,13 +1,13 @@ package buildcraft.api.transport.pipe; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; +import net.minecraft.block.BlockState; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public interface ICustomPipeConnection { /** @return How long the connecting pipe should extend for, in addition to its normal 4/16f connection. Values less * than or equal to -4 / 16.0f indicate that the pipe will not connect at all, and will render - * as it it was not connected. */ - float getExtension(World world, BlockPos pos, EnumFacing face, IBlockState state); + * as it was not connected. */ + float getExtension(World world, BlockPos pos, Direction face, BlockState state); } diff --git a/api/buildcraft/api/transport/pipe/IFlowFluid.java b/api/buildcraft/api/transport/pipe/IFlowFluid.java index 259736a..174fda5 100644 --- a/api/buildcraft/api/transport/pipe/IFlowFluid.java +++ b/api/buildcraft/api/transport/pipe/IFlowFluid.java @@ -1,24 +1,24 @@ package buildcraft.api.transport.pipe; -import javax.annotation.Nullable; - +import buildcraft.api.core.IFluidFilter; +import buildcraft.api.core.IFluidHandlerAdv; +import buildcraft.api.transport.pluggable.PipePluggable; import net.minecraft.util.ActionResult; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; - +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; -import buildcraft.api.core.IFluidFilter; -import buildcraft.api.core.IFluidHandlerAdv; -import buildcraft.api.transport.pluggable.PipePluggable; +import javax.annotation.Nullable; public interface IFlowFluid { /** @deprecated use the version below with a simulate paramater. */ @Nullable @Deprecated - default FluidStack tryExtractFluid(int millibuckets, EnumFacing from, FluidStack filter) { - return tryExtractFluid(millibuckets, from, filter, false); + default FluidStack tryExtractFluid(int millibuckets, Direction from, FluidStack filter) { +// return tryExtractFluid(millibuckets, from, filter, false); + return tryExtractFluid(millibuckets, from, filter, FluidAction.EXECUTE); } /** @param millibuckets @@ -26,41 +26,46 @@ default FluidStack tryExtractFluid(int millibuckets, EnumFacing from, FluidStack * @param filter The fluidstack that the extracted fluid must match, or null for any fluid. * @return The fluidstack extracted and inserted into the pipe. */ @Nullable - FluidStack tryExtractFluid(int millibuckets, EnumFacing from, FluidStack filter, boolean simulate); +// FluidStack tryExtractFluid(int millibuckets, Direction from, FluidStack filter, boolean simulate); + FluidStack tryExtractFluid(int millibuckets, Direction from, FluidStack filter, FluidAction action); /** @deprecated use the version below with a simulate paramater. */ @Deprecated - default ActionResult tryExtractFluidAdv(int millibuckets, EnumFacing from, IFluidFilter filter) { - return tryExtractFluidAdv(millibuckets, from, filter, false); + default ActionResult tryExtractFluidAdv(int millibuckets, Direction from, IFluidFilter filter) { +// return tryExtractFluidAdv(millibuckets, from, filter, false); + return tryExtractFluidAdv(millibuckets, from, filter, FluidAction.EXECUTE); } - /** Advanced version of {@link #tryExtractFluid(int, EnumFacing, FluidStack, boolean)}. Note that this only works for + /** Advanced version of {@link #tryExtractFluid(int, Direction, FluidStack, FluidAction)}. Note that this only works for * instances of {@link IFluidHandler} that ALSO extends {@link IFluidHandlerAdv} - * + * * @param millibuckets * @param from - * @param filter A filter to try and match fluids. - * @return The fluidstack extracted and inserted into the pipe. If {@link ActionResult#getType()} equals - * {@link EnumActionResult#PASS} then it means that the {@link IFluidHandler} didn't implement - * {@link IFluidHandlerAdv} and you should call the basic version, if you can. */ - ActionResult tryExtractFluidAdv(int millibuckets, EnumFacing from, IFluidFilter filter, boolean simulate); + * @param filter A filter to try and match fluids. + * @return The fluidstack extracted and inserted into the pipe. If {@link ActionResult#getResult()} equals + * {@link ActionResultType#PASS} then it means that the {@link IFluidHandler} didn't implement + * {@link IFluidHandlerAdv} and you should call the basic version, if you can. */ +// ActionResult tryExtractFluidAdv(int millibuckets, Direction from, IFluidFilter filter, boolean simulate); + ActionResult tryExtractFluidAdv(int millibuckets, Direction from, IFluidFilter filter, FluidAction action); /** Attempts to insert a fluid directly into the pipe. Note that this will fail if the pipe currently contains a * different fluid type. - * + * * @param from The side that the fluid should *not* go in, or null if the fluid may flow in any direction. * @return The amount of fluid that was accepted, or 0 if no fluid was accepted. */ - int insertFluidsForce(FluidStack fluid, @Nullable EnumFacing from, boolean simulate); +// int insertFluidsForce(FluidStack fluid, @Nullable EnumFacing from, boolean simulate); + int insertFluidsForce(FluidStack fluid, @Nullable Direction from, FluidAction action); /** Tries to extract fluids directly from the pipe. NOTE: This is intended for {@link PipeBehaviour} and * {@link PipePluggable} implementors ONLY! This will result in very buggy behaviour if external tiles try to use * this! - * + * * @param min The minimum amount of fluid to extract. If less than this amount is in the given center then nothing * will be extracted. * @param section The section to extract from. Null means the center. - * @param simulate + * @param action * @return */ @Nullable - FluidStack extractFluidsForce(int min, int max, @Nullable EnumFacing section, boolean simulate); +// FluidStack extractFluidsForce(int min, int max, @Nullable EnumFacing section, boolean simulate); + FluidStack extractFluidsForce(int min, int max, @Nullable Direction section, FluidAction action); } diff --git a/api/buildcraft/api/transport/pipe/IFlowItems.java b/api/buildcraft/api/transport/pipe/IFlowItems.java index bdedd38..da2d2a7 100644 --- a/api/buildcraft/api/transport/pipe/IFlowItems.java +++ b/api/buildcraft/api/transport/pipe/IFlowItems.java @@ -1,45 +1,44 @@ package buildcraft.api.transport.pipe; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import net.minecraft.item.EnumDyeColor; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; - import buildcraft.api.core.IStackFilter; import buildcraft.api.transport.IInjectable; +import net.minecraft.item.DyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Direction; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public interface IFlowItems extends IInjectable { /** @deprecated Use the version below with a simulate paramater. */ @Deprecated - default int tryExtractItems(int count, EnumFacing from, @Nullable EnumDyeColor colour, IStackFilter filter) { + default int tryExtractItems(int count, Direction from, @Nullable DyeColor colour, IStackFilter filter) { return tryExtractItems(count, from, colour, filter, false); } /** Attempts to extract items from the inventory connected to this pipe on the given side. - * + * * @param count The maximum number of items to extract * @param from The direction to extract from. * @param colour The colour that extracted items should be painted. * @param filter The filter to determine what can be extracted. * @param simulate If true then only simulate the extraction. * @return The number of items extracted. */ - int tryExtractItems(int count, EnumFacing from, @Nullable EnumDyeColor colour, IStackFilter filter, boolean simulate); + int tryExtractItems(int count, Direction from, @Nullable DyeColor colour, IStackFilter filter, boolean simulate); /** Inserts an item directly into the centre of this pipe, going in the given direction. This should ONLY be called * from an instance of {@link PipeBehaviour}, as otherwise it can lead to problems. (For example crashing if a pipe * contains an item that the pipe behaviour doesn't expect). - * + * * @param stack ItemStack offered for addition. Do not manipulate this! * @param from Orientation the ItemStack should pretend to be coming from. * @param colour The colour of the item to be added to the pipe, or null for no colour. * @param speed The speed of the item to be added (in blocks per tick) or {@code <=0} if a default should be * used. */ - void insertItemsForce(@Nonnull ItemStack stack, EnumFacing from, @Nullable EnumDyeColor colour, double speed); + void insertItemsForce(@Nonnull ItemStack stack, Direction from, @Nullable DyeColor colour, double speed); /** Sends a phantom (fake) item from the given facing, to the other facing. If from is null then it will start at * the center, or if to is null then it will end at the center. */ - void sendPhantomItem(@Nonnull ItemStack stack, @Nullable EnumFacing from, @Nullable EnumFacing to, @Nullable EnumDyeColor colour); + void sendPhantomItem(@Nonnull ItemStack stack, @Nullable Direction from, @Nullable Direction to, @Nullable DyeColor colour); } diff --git a/api/buildcraft/api/transport/pipe/IFlowPower.java b/api/buildcraft/api/transport/pipe/IFlowPower.java index 051d0ad..b97bb54 100644 --- a/api/buildcraft/api/transport/pipe/IFlowPower.java +++ b/api/buildcraft/api/transport/pipe/IFlowPower.java @@ -1,17 +1,16 @@ package buildcraft.api.transport.pipe; -import net.minecraft.util.EnumFacing; - import buildcraft.api.mj.IMjPassiveProvider; +import net.minecraft.util.Direction; public interface IFlowPower { /** Makes this pipe reconfigure itself, possibly due to the addition of new modules. */ void reconfigure(); /** Attempts to extract power from the {@link IMjPassiveProvider} connected to this pipe on the given side. - * + * * @param maxPower The Maximum amount of power that can be extracted. * @param from The side (of this pipe) to take power from. * @return The amount of power extracted. */ - long tryExtractPower(long maxPower, EnumFacing from); + long tryExtractPower(long maxPower, Direction from); } diff --git a/api/buildcraft/api/transport/pipe/IItemPipe.java b/api/buildcraft/api/transport/pipe/IItemPipe.java index 1d2d377..37425ec 100644 --- a/api/buildcraft/api/transport/pipe/IItemPipe.java +++ b/api/buildcraft/api/transport/pipe/IItemPipe.java @@ -1,7 +1,14 @@ package buildcraft.api.transport.pipe; +import net.minecraft.item.DyeColor; + +import javax.annotation.Nullable; + /** To be implemented by the real item pipe in Transport mod, but leaves knowledge for classes that do not have direct * dependency on transport. */ public interface IItemPipe { PipeDefinition getDefinition(); + + @Nullable + DyeColor getColour(); } diff --git a/api/buildcraft/api/transport/pipe/IPipe.java b/api/buildcraft/api/transport/pipe/IPipe.java index 8f3d51e..c5d0dcc 100644 --- a/api/buildcraft/api/transport/pipe/IPipe.java +++ b/api/buildcraft/api/transport/pipe/IPipe.java @@ -1,9 +1,8 @@ package buildcraft.api.transport.pipe; -import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.DyeColor; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - +import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.ICapabilityProvider; public interface IPipe extends ICapabilityProvider { @@ -15,19 +14,19 @@ public interface IPipe extends ICapabilityProvider { PipeFlow getFlow(); - EnumDyeColor getColour(); + DyeColor getColour(); - void setColour(EnumDyeColor colour); + void setColour(DyeColor colour); void markForUpdate(); - TileEntity getConnectedTile(EnumFacing side); + TileEntity getConnectedTile(Direction side); - IPipe getConnectedPipe(EnumFacing side); + IPipe getConnectedPipe(Direction side); - boolean isConnected(EnumFacing side); + boolean isConnected(Direction side); - ConnectedType getConnectedType(EnumFacing side); + ConnectedType getConnectedType(Direction side); enum ConnectedType { TILE, diff --git a/api/buildcraft/api/transport/pipe/IPipeBehaviourBaker.java b/api/buildcraft/api/transport/pipe/IPipeBehaviourBaker.java index f5c50cb..11b5a77 100644 --- a/api/buildcraft/api/transport/pipe/IPipeBehaviourBaker.java +++ b/api/buildcraft/api/transport/pipe/IPipeBehaviourBaker.java @@ -1,8 +1,8 @@ package buildcraft.api.transport.pipe; -import java.util.List; +import net.minecraft.client.renderer.model.BakedQuad; -import net.minecraft.client.renderer.block.model.BakedQuad; +import java.util.List; public interface IPipeBehaviourBaker { List bake(B behaviour); diff --git a/api/buildcraft/api/transport/pipe/IPipeBehaviourRenderer.java b/api/buildcraft/api/transport/pipe/IPipeBehaviourRenderer.java index 5b00179..b870cb2 100644 --- a/api/buildcraft/api/transport/pipe/IPipeBehaviourRenderer.java +++ b/api/buildcraft/api/transport/pipe/IPipeBehaviourRenderer.java @@ -1,12 +1,12 @@ package buildcraft.api.transport.pipe; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.IVertexBuilder; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraft.client.renderer.BufferBuilder; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) +@OnlyIn(Dist.CLIENT) public interface IPipeBehaviourRenderer { - void render(B behaviour, double x, double y, double z, float partialTicks, BufferBuilder bb); + // void render(B behaviour, double x, double y, double z, float partialTicks, BufferBuilder bb); + public void render(B gate, float partialTicks, MatrixStack poseStack, IVertexBuilder vertexConsumer, int combinedLight, int combinedOverlay); } diff --git a/api/buildcraft/api/transport/pipe/IPipeConnection.java b/api/buildcraft/api/transport/pipe/IPipeConnection.java index 55a5142..faa8dca 100644 --- a/api/buildcraft/api/transport/pipe/IPipeConnection.java +++ b/api/buildcraft/api/transport/pipe/IPipeConnection.java @@ -4,7 +4,7 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport.pipe; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; @Deprecated // TODO: Test to see if this is necessary! (Or perhaps make it a capability) @@ -22,5 +22,5 @@ enum ConnectOverride { * @param type * @param with * @return CONNECT to force a connection, DISCONNECT to force no connection, and DEFAULT to let the pipe decide. */ - ConnectOverride overridePipeConnection(Object/*IPipeTile.PipeType*/ type, EnumFacing with); + ConnectOverride overridePipeConnection(Object/*IPipeTile.PipeType*/ type, Direction with); } diff --git a/api/buildcraft/api/transport/pipe/IPipeExtensionManager.java b/api/buildcraft/api/transport/pipe/IPipeExtensionManager.java index eaf6628..98fab8a 100644 --- a/api/buildcraft/api/transport/pipe/IPipeExtensionManager.java +++ b/api/buildcraft/api/transport/pipe/IPipeExtensionManager.java @@ -4,13 +4,12 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport.pipe; +import buildcraft.api.transport.IStripesActivator; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import buildcraft.api.transport.IStripesActivator; - public interface IPipeExtensionManager { /** @@ -26,7 +25,7 @@ public interface IPipeExtensionManager { * @param stack the pipe stack to use (Note: only uses one item and sends the rest back) * @return true on success, false otherwise */ - boolean requestPipeExtension(World world, BlockPos pos, EnumFacing dir, IStripesActivator stripes, ItemStack stack); + boolean requestPipeExtension(World world, BlockPos pos, Direction dir, IStripesActivator stripes, ItemStack stack); /** * Registers a pipe as a retraction trigger for pipe extension requests diff --git a/api/buildcraft/api/transport/pipe/IPipeFlowBaker.java b/api/buildcraft/api/transport/pipe/IPipeFlowBaker.java index 97bcf98..4117bbf 100644 --- a/api/buildcraft/api/transport/pipe/IPipeFlowBaker.java +++ b/api/buildcraft/api/transport/pipe/IPipeFlowBaker.java @@ -1,8 +1,8 @@ package buildcraft.api.transport.pipe; -import java.util.List; +import net.minecraft.client.renderer.model.BakedQuad; -import net.minecraft.client.renderer.block.model.BakedQuad; +import java.util.List; public interface IPipeFlowBaker { List bake(F flow); diff --git a/api/buildcraft/api/transport/pipe/IPipeFlowRenderer.java b/api/buildcraft/api/transport/pipe/IPipeFlowRenderer.java index 7ce7636..23d9ffc 100644 --- a/api/buildcraft/api/transport/pipe/IPipeFlowRenderer.java +++ b/api/buildcraft/api/transport/pipe/IPipeFlowRenderer.java @@ -1,12 +1,11 @@ package buildcraft.api.transport.pipe; -import net.minecraft.client.renderer.BufferBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.IVertexBuilder; public interface IPipeFlowRenderer { /** @param flow The flow to render - * @param x - * @param y - * @param z * @param bufferBuilder The (optional) vertex buffer that you can render into. Note that you can still do GL stuff. */ - void render(F flow, double x, double y, double z, float partialTicks, BufferBuilder bufferBuilder); +// void render(F flow, double x, double y, double z, float partialTicks, BufferBuilder bufferBuilder); + void render(F flow, float partialTicks, MatrixStack poseStack, IVertexBuilder bufferBuilder, int combinedLight, int combinedOverlay); } diff --git a/api/buildcraft/api/transport/pipe/IPipeHolder.java b/api/buildcraft/api/transport/pipe/IPipeHolder.java index ef00690..2042dab 100644 --- a/api/buildcraft/api/transport/pipe/IPipeHolder.java +++ b/api/buildcraft/api/transport/pipe/IPipeHolder.java @@ -1,25 +1,24 @@ package buildcraft.api.transport.pipe; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import buildcraft.api.statements.containers.IRedstoneStatementContainer; +import buildcraft.api.tiles.IBCTileMenuProvider; +import buildcraft.api.tiles.ITickable; +import buildcraft.api.transport.IWireManager; +import buildcraft.api.transport.pluggable.PipePluggable; import com.mojang.authlib.GameProfile; - -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; - import net.minecraftforge.common.capabilities.Capability; -import buildcraft.api.statements.containers.IRedstoneStatementContainer; -import buildcraft.api.transport.IWireManager; -import buildcraft.api.transport.pluggable.PipePluggable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** Designates a tile that can contain a pipe, up to 6 sided pluggables. */ -public interface IPipeHolder extends IRedstoneStatementContainer { +public interface IPipeHolder extends IRedstoneStatementContainer, IBCTileMenuProvider, ITickable { World getPipeWorld(); BlockPos getPipePos(); @@ -30,21 +29,21 @@ public interface IPipeHolder extends IRedstoneStatementContainer { /** @return true if the player should be able to interact with the pipe holder in GUI form. Implementors should * generally check to ensure they are still present in-world. */ - boolean canPlayerInteract(EntityPlayer player); + boolean canPlayerInteract(PlayerEntity player); @Nullable - PipePluggable getPluggable(EnumFacing side); + PipePluggable getPluggable(Direction side); @Nullable - TileEntity getNeighbourTile(EnumFacing side); + TileEntity getNeighbourTile(Direction side); @Nullable - IPipe getNeighbourPipe(EnumFacing side); + IPipe getNeighbourPipe(Direction side); /** Gets the given capability going outwards from the pipe. This will test the * {@link PipePluggable#getInternalCapability(Capability)} first, and the look at the neighbouring tile. */ @Nullable - T getCapabilityFromPipe(EnumFacing side, @Nonnull Capability capability); + T getCapabilityFromPipe(Direction side, @Nonnull Capability capability); IWireManager getWireManager(); @@ -60,7 +59,7 @@ public interface IPipeHolder extends IRedstoneStatementContainer { /** Schedules a GUI network update, that is only the players who currently have a pipe element open in a GUI will be * updated. - * + * * @param parts The parts that want to send a network update. */ void scheduleNetworkGuiUpdate(PipeMessageReceiver... parts); @@ -71,20 +70,25 @@ public interface IPipeHolder extends IRedstoneStatementContainer { void sendGuiMessage(PipeMessageReceiver to, IWriter writer); /** Called on the server whenever a gui container object is opened. */ - void onPlayerOpen(EntityPlayer player); + void onPlayerOpen(PlayerEntity player); + + @Override + default void update() { + ITickable.super.update(); + } /** Called on the server whenever a gui container object is closed. */ - void onPlayerClose(EntityPlayer player); + void onPlayerClose(PlayerEntity player); enum PipeMessageReceiver { BEHAVIOUR(null), FLOW(null), - PLUGGABLE_DOWN(EnumFacing.DOWN), - PLUGGABLE_UP(EnumFacing.UP), - PLUGGABLE_NORTH(EnumFacing.NORTH), - PLUGGABLE_SOUTH(EnumFacing.SOUTH), - PLUGGABLE_WEST(EnumFacing.WEST), - PLUGGABLE_EAST(EnumFacing.EAST), + PLUGGABLE_DOWN(Direction.DOWN), + PLUGGABLE_UP(Direction.UP), + PLUGGABLE_NORTH(Direction.NORTH), + PLUGGABLE_SOUTH(Direction.SOUTH), + PLUGGABLE_WEST(Direction.WEST), + PLUGGABLE_EAST(Direction.EAST), WIRES(null); // Wires are updated differently (they never use this API) @@ -99,9 +103,9 @@ enum PipeMessageReceiver { } } - public final EnumFacing face; + public final Direction face; - PipeMessageReceiver(EnumFacing face) { + PipeMessageReceiver(Direction face) { this.face = face; } } diff --git a/api/buildcraft/api/transport/pipe/IPipeRegistry.java b/api/buildcraft/api/transport/pipe/IPipeRegistry.java index e4ead26..6a6c187 100644 --- a/api/buildcraft/api/transport/pipe/IPipeRegistry.java +++ b/api/buildcraft/api/transport/pipe/IPipeRegistry.java @@ -1,12 +1,10 @@ package buildcraft.api.transport.pipe; -import java.util.Map; -import java.util.function.Consumer; - -import javax.annotation.Nullable; - -import net.minecraft.item.Item; +import net.minecraft.item.DyeColor; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.RegistryObject; + +import java.util.Map; public interface IPipeRegistry { PipeDefinition getDefinition(ResourceLocation identifier); @@ -15,22 +13,26 @@ public interface IPipeRegistry { /** Maps the given {@link PipeDefinition} to an {@link IItemPipe}. This acts exactly akin to * {@link Map#put(Object, Object)}. */ - void setItemForPipe(PipeDefinition definition, @Nullable IItemPipe item); +// void setItemForPipe(PipeDefinition definition, @Nullable IItemPipe item); + void setItemForPipe(PipeDefinition definition, Map> item); - IItemPipe getItemForPipe(PipeDefinition definition); + /** Creates a pipe item with a single colour */ + // IItemPipe getItemForPipe(PipeDefinition definition); + IItemPipe getItemForPipe(PipeDefinition definition, DyeColor colour); /** Creates an {@link IItemPipe} for the given {@link PipeDefinition}. If the {@link PipeDefinition} has been * registered with {@link #registerPipe(PipeDefinition)} then it will also be registered with - * {@link #setItemForPipe(PipeDefinition, IItemPipe)}. The returned item will be automatically registered with + * {@link #setItemForPipe(PipeDefinition, Map)}. The returned item will be automatically registered with * forge. */ - IItemPipe createItemForPipe(PipeDefinition definition); - - /** Identical to {@link #createItemForPipe(PipeDefinition)}, but doesn't require registering tags with buildcraft - * lib in order to register. - * - * @param postCreate A function to call in order to setup the {@link Item#setRegistryName(ResourceLocation)} and - * {@link Item#setUnlocalizedName(String)}. */ - IItemPipe createUnnamedItemForPipe(PipeDefinition definition, Consumer postCreate); +// IItemPipe createItemForPipe(PipeDefinition definition); + Map> createItemForPipe(PipeDefinition definition); + +// /** Identical to {@link #createItemForPipe(PipeDefinition)}, but doesn't require registering tags with buildcraftcore +// * lib in order to register. +// * +// * @param postCreate A function to call in order to setup the {@link Item#setRegistryName(ResourceLocation)} and +// * {@link Item#setUnlocalizedName(String)}. */ +// IItemPipe createUnnamedItemForPipe(PipeDefinition definition, Consumer postCreate); Iterable getAllRegisteredPipes(); } diff --git a/api/buildcraft/api/transport/pipe/PipeApi.java b/api/buildcraft/api/transport/pipe/PipeApi.java index cc9997c..fdd35b5 100644 --- a/api/buildcraft/api/transport/pipe/PipeApi.java +++ b/api/buildcraft/api/transport/pipe/PipeApi.java @@ -1,18 +1,16 @@ package buildcraft.api.transport.pipe; -import java.util.IdentityHashMap; -import java.util.Map; - -import javax.annotation.Nonnull; - -import net.minecraftforge.common.capabilities.Capability; - import buildcraft.api.core.CapabilitiesHelper; import buildcraft.api.mj.MjAPI; import buildcraft.api.transport.IInjectable; import buildcraft.api.transport.IStripesRegistry; import buildcraft.api.transport.pluggable.IPluggableRegistry; import buildcraft.api.transport.pluggable.PipePluggable; +import net.minecraftforge.common.capabilities.Capability; + +import javax.annotation.Nonnull; +import java.util.IdentityHashMap; +import java.util.Map; /** The central holding class for all pipe related registers and methods. */ public final class PipeApi { @@ -37,16 +35,16 @@ public final class PipeApi { public static final Map powerTransferData = new IdentityHashMap<>(); @Nonnull - public static final Capability CAP_PIPE_HOLDER; + public static Capability CAP_PIPE_HOLDER; @Nonnull - public static final Capability CAP_PIPE; + public static Capability CAP_PIPE; @Nonnull - public static final Capability CAP_PLUG; + public static Capability CAP_PLUG; @Nonnull - public static final Capability CAP_INJECTABLE; + public static Capability CAP_INJECTABLE; public static FluidTransferInfo getFluidTransferInfo(PipeDefinition def) { FluidTransferInfo info = fluidTransferData.get(def); @@ -93,7 +91,7 @@ public static class PowerTransferInfo { public final boolean isReceiver; /** Sets resistancePerTick to be equal to lossPerTick when full power is being transferred, scaling down to 0. - * + * * @param transferPerTick * @param lossPerTick * @param isReceiver */ @@ -102,7 +100,7 @@ public static PowerTransferInfo createFromLoss(long transferPerTick, long lossPe } /** Sets lossPerTick to be equal to resistancePerTick when full power is being transferred. - * + * * @param transferPerTick * @param resistancePerTick * @param isReceiver */ @@ -123,7 +121,8 @@ public PowerTransferInfo(long transferPerTick, long lossPerTick, long resistance // Internals - static { + // static + public static void regCaps() { CAP_PIPE = CapabilitiesHelper.registerCapability(IPipe.class); CAP_PLUG = CapabilitiesHelper.registerCapability(PipePluggable.class); CAP_PIPE_HOLDER = CapabilitiesHelper.registerCapability(IPipeHolder.class); diff --git a/api/buildcraft/api/transport/pipe/PipeApiClient.java b/api/buildcraft/api/transport/pipe/PipeApiClient.java index ebcd9e6..461c2da 100644 --- a/api/buildcraft/api/transport/pipe/PipeApiClient.java +++ b/api/buildcraft/api/transport/pipe/PipeApiClient.java @@ -1,14 +1,13 @@ package buildcraft.api.transport.pipe; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - import buildcraft.api.transport.pluggable.IPlugDynamicRenderer; import buildcraft.api.transport.pluggable.IPluggableStaticBaker; import buildcraft.api.transport.pluggable.PipePluggable; import buildcraft.api.transport.pluggable.PluggableModelKey; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -@SideOnly(Side.CLIENT) +@OnlyIn(Dist.CLIENT) public enum PipeApiClient { INSTANCE; @@ -22,12 +21,10 @@ public interface IClientRegistry { /** Registers a dynamic renderer for the given pipe behaviour. Most {@link PipeBehaviour} types will have no use * for this. */ - void registerRenderer(Class behaviourClass, - IPipeBehaviourRenderer renderer); + void registerRenderer(Class behaviourClass, IPipeBehaviourRenderer renderer);

    void registerRenderer(Class plugClass, IPlugDynamicRenderer

    renderer); -

    void registerBaker(Class keyClass, - IPluggableStaticBaker

    renderer); +

    void registerBaker(Class keyClass, IPluggableStaticBaker

    renderer); } } diff --git a/api/buildcraft/api/transport/pipe/PipeBehaviour.java b/api/buildcraft/api/transport/pipe/PipeBehaviour.java index e4622bc..b9a33d6 100644 --- a/api/buildcraft/api/transport/pipe/PipeBehaviour.java +++ b/api/buildcraft/api/transport/pipe/PipeBehaviour.java @@ -1,25 +1,24 @@ package buildcraft.api.transport.pipe; -import java.io.IOException; - -import javax.annotation.Nonnull; - +import buildcraft.api.core.EnumPipePart; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; import net.minecraft.util.NonNullList; import net.minecraft.util.math.RayTraceResult; - +import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; -import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fml.network.NetworkDirection; +import net.minecraftforge.fml.network.NetworkEvent; -import buildcraft.api.core.EnumPipePart; +import javax.annotation.Nonnull; +import java.io.IOException; public abstract class PipeBehaviour implements ICapabilityProvider { public final IPipe pipe; @@ -28,63 +27,70 @@ public PipeBehaviour(IPipe pipe) { this.pipe = pipe; } - public PipeBehaviour(IPipe pipe, NBTTagCompound nbt) { + public PipeBehaviour(IPipe pipe, CompoundNBT nbt) { this.pipe = pipe; } - public NBTTagCompound writeToNbt() { - NBTTagCompound nbt = new NBTTagCompound(); + public CompoundNBT writeToNbt() { + CompoundNBT nbt = new CompoundNBT(); return nbt; } - public void writePayload(PacketBuffer buffer, Side side) {} + public void writePayload(PacketBuffer buffer, Dist side) { + } - public void readPayload(PacketBuffer buffer, Side side, MessageContext ctx) throws IOException {} + // public void readPayload(PacketBuffer buffer, Dist side, MessageContext ctx) throws IOException {} + public void readPayload(PacketBuffer buffer, NetworkDirection side, NetworkEvent.Context ctx) throws IOException { + } - /** @deprecated Replaced by {@link #getTextureData(EnumFacing)}. */ + /** @deprecated Replaced by {@link #getTextureData(Direction)}. */ @Deprecated - public int getTextureIndex(EnumFacing face) { + public int getTextureIndex(Direction face) { return 0; } - public PipeFaceTex getTextureData(EnumFacing face) { + public PipeFaceTex getTextureData(Direction face) { return PipeFaceTex.get(getTextureIndex(face)); } // Event handling - public boolean canConnect(EnumFacing face, PipeBehaviour other) { + public boolean canConnect(Direction face, PipeBehaviour other) { return true; } - public boolean canConnect(EnumFacing face, TileEntity oTile) { + public boolean canConnect(Direction face, TileEntity oTile) { return true; } /** Used to force a connection to a given tile, even if the {@link PipeFlow} wouldn't normally connect to it. */ - public boolean shouldForceConnection(EnumFacing face, TileEntity oTile) { + public boolean shouldForceConnection(Direction face, TileEntity oTile) { return false; } - public boolean onPipeActivate(EntityPlayer player, RayTraceResult trace, float hitX, float hitY, float hitZ, - EnumPipePart part) { + public boolean onPipeActivate(PlayerEntity player, RayTraceResult trace, float hitX, float hitY, float hitZ, EnumPipePart part) { return false; } - public void onEntityCollide(Entity entity) {} - - public void onTick() {} + public void onEntityCollide(Entity entity) { + } - @Override - public boolean hasCapability(@Nonnull Capability capability, EnumFacing facing) { - return getCapability(capability, facing) != null; + public void onTick() { } + // 1.18.2: getCapability().isPresent() +// @Override +// public boolean hasCapability(@Nonnull Capability capability, EnumFacing facing) { +// return getCapability(capability, facing) != null; +// } + + @Nonnull @Override - public T getCapability(@Nonnull Capability capability, EnumFacing facing) { - return null; + public LazyOptional getCapability(@Nonnull Capability capability, Direction facing) { + return LazyOptional.empty(); } - public void addDrops(NonNullList toDrop, int fortune) {} + public void addDrops(NonNullList toDrop, int fortune) { + } } diff --git a/api/buildcraft/api/transport/pipe/PipeConnectionAPI.java b/api/buildcraft/api/transport/pipe/PipeConnectionAPI.java index 9872034..8431032 100644 --- a/api/buildcraft/api/transport/pipe/PipeConnectionAPI.java +++ b/api/buildcraft/api/transport/pipe/PipeConnectionAPI.java @@ -1,11 +1,10 @@ package buildcraft.api.transport.pipe; -import java.util.Map; - import com.google.common.collect.Maps; - import net.minecraft.block.Block; +import java.util.Map; + /** Use this class to register blocks with custom block sizes so that pipes can connect to them properly. Note that you * do not need to register a custom pipe connection if your block implements ICustomPipeConnection. The registered * version does not override your own implementation. */ @@ -15,7 +14,7 @@ public final class PipeConnectionAPI { /** Register a block with a custom connection. Useful if you don't own the block class or are adding it for some-one * else. - * + * * @param block The block instance * @param connection The connection instance */ public static void registerConnection(Block block, ICustomPipeConnection connection) { diff --git a/api/buildcraft/api/transport/pipe/PipeDefinition.java b/api/buildcraft/api/transport/pipe/PipeDefinition.java index cfd3e68..547d53c 100644 --- a/api/buildcraft/api/transport/pipe/PipeDefinition.java +++ b/api/buildcraft/api/transport/pipe/PipeDefinition.java @@ -1,15 +1,17 @@ package buildcraft.api.transport.pipe; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.item.Item; +import net.minecraft.item.Rarity; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.ModContainer; +import net.minecraftforge.fml.ModLoadingContext; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModContainer; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public final class PipeDefinition { + public final Item.Properties properties; public final ResourceLocation identifier; public final IPipeCreator logicConstructor; public final IPipeLoader logicLoader; @@ -23,6 +25,7 @@ public final class PipeDefinition { private EnumPipeColourType colourType; public PipeDefinition(PipeDefinitionBuilder builder) { + this.properties = builder.properties; this.identifier = builder.identifier; this.textures = new String[builder.textureSuffixes.length]; for (int i = 0; i < textures.length; i++) { @@ -63,10 +66,14 @@ public interface IPipeCreator { @FunctionalInterface public interface IPipeLoader { - PipeBehaviour loadBehaviour(IPipe t, NBTTagCompound u); + PipeBehaviour loadBehaviour(IPipe t, CompoundNBT u); } public static class PipeDefinitionBuilder { + public Item.Properties properties = new Item.Properties() + .rarity(Rarity.COMMON) + .durability(0) + .stacksTo(64); public ResourceLocation identifier; public String texturePrefix; public String[] textureSuffixes = { "" }; @@ -81,10 +88,11 @@ public static class PipeDefinitionBuilder { public boolean canBeColoured; public EnumPipeColourType colourType; - public PipeDefinitionBuilder() {} + public PipeDefinitionBuilder() { + } public PipeDefinitionBuilder(ResourceLocation identifier, IPipeCreator logicConstructor, - IPipeLoader logicLoader, PipeFlowType flowType) { + IPipeLoader logicLoader, PipeFlowType flowType) { this.identifier = identifier; this.logicConstructor = logicConstructor; this.logicLoader = logicLoader; @@ -100,10 +108,10 @@ public PipeDefinitionBuilder idTex(String both) { } private static String getActiveModId() { - ModContainer mod = Loader.instance().activeModContainer(); + ModContainer mod = ModLoadingContext.get().getActiveContainer(); if (mod == null) { throw new IllegalStateException( - "Cannot interact with PipeDefinition outside of an actively scoped mod!"); + "Cannot interact with PipeDefinition outside of an actively scoped mod!"); } return mod.getModId(); } @@ -119,7 +127,7 @@ public PipeDefinitionBuilder tex(String prefix, String... suffixes) { /** Sets the texture prefix to be: [current_mod_id]:pipes/[prefix] where [current_mod_id] is the * modid of the currently loaded mod, and [prefix] is the string parameter given. - * + * * @return this */ public PipeDefinitionBuilder texPrefix(String prefix) { return texPrefixDirect(getActiveModId() + ":pipes/" + prefix); @@ -127,7 +135,7 @@ public PipeDefinitionBuilder texPrefix(String prefix) { /** Sets the {@link #texturePrefix} to the input string, without any additions or changes (unlike * {@link #texPrefix(String)}) - * + * * @return this */ public PipeDefinitionBuilder texPrefixDirect(String prefix) { texturePrefix = prefix; @@ -136,7 +144,7 @@ public PipeDefinitionBuilder texPrefixDirect(String prefix) { /** Sets {@link #textureSuffixes} to the given array, or to {""} if the argument list is empty or * null. - * + * * @return this. */ public PipeDefinitionBuilder texSuffixes(String... suffixes) { if (suffixes == null || suffixes.length == 0) { diff --git a/api/buildcraft/api/transport/pipe/PipeEventConnectionChange.java b/api/buildcraft/api/transport/pipe/PipeEventConnectionChange.java index fe529dd..3f26407 100644 --- a/api/buildcraft/api/transport/pipe/PipeEventConnectionChange.java +++ b/api/buildcraft/api/transport/pipe/PipeEventConnectionChange.java @@ -1,14 +1,14 @@ package buildcraft.api.transport.pipe; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; /** Fired whenever a connection change is picked up by an {@link IPipe}. This even doesn't include the new value - * (boolean isConnected) as it can be accessed via {@link IPipe#isConnected(EnumFacing)}. */ + * (boolean isConnected) as it can be accessed via {@link IPipe#isConnected(Direction)}. */ public class PipeEventConnectionChange extends PipeEvent { - public final EnumFacing direction; + public final Direction direction; - public PipeEventConnectionChange(IPipeHolder holder, EnumFacing direction) { + public PipeEventConnectionChange(IPipeHolder holder, Direction direction) { super(holder); this.direction = direction; } diff --git a/api/buildcraft/api/transport/pipe/PipeEventFluid.java b/api/buildcraft/api/transport/pipe/PipeEventFluid.java index e057122..f052c32 100644 --- a/api/buildcraft/api/transport/pipe/PipeEventFluid.java +++ b/api/buildcraft/api/transport/pipe/PipeEventFluid.java @@ -1,15 +1,13 @@ package buildcraft.api.transport.pipe; +import net.minecraft.util.Direction; +import net.minecraftforge.fluids.FluidStack; + +import javax.annotation.Nonnull; import java.util.Arrays; import java.util.Collection; import java.util.EnumSet; -import javax.annotation.Nonnull; - -import net.minecraft.util.EnumFacing; - -import net.minecraftforge.fluids.FluidStack; - public abstract class PipeEventFluid extends PipeEvent { public final IFlowFluid flow; @@ -27,12 +25,12 @@ protected PipeEventFluid(boolean canBeCancelled, IPipeHolder holder, IFlowFluid } public static class TryInsert extends PipeEventFluid { - public final EnumFacing from; + public final Direction from; /** The incoming fluidstack. Currently changing this does nothing. */ @Nonnull public final FluidStack fluid; - public TryInsert(IPipeHolder holder, IFlowFluid flow, EnumFacing from, @Nonnull FluidStack fluid) { + public TryInsert(IPipeHolder holder, IFlowFluid flow, Direction from, @Nonnull FluidStack fluid) { super(true, holder, flow); this.from = from; this.fluid = fluid; @@ -48,19 +46,19 @@ public static class PreMoveToCentre extends PipeEventFluid { /** The maximum amount of fluid that the centre pipe could accept. */ public final int totalAcceptable; - /** Array of {@link EnumFacing#getIndex()} to the maximum amount of fluid that a given side can offer. DO NOT + /** Array of {@link Direction#get3DDataValue()} to the maximum amount of fluid that a given side can offer. DO NOT * CHANGE THIS! */ public final int[] totalOffered; // Used for checking the state private final int[] totalOfferedCheck; - /** Array of {@link EnumFacing#getIndex()} to the amount of fluid that the given side will actually offer to the + /** Array of {@link Direction#get3DDataValue()} to the amount of fluid that the given side will actually offer to the * centre. This should *never* be larger than */ public final int[] actuallyOffered; public PreMoveToCentre(IPipeHolder holder, IFlowFluid flow, FluidStack fluid, int totalAcceptable, - int[] totalOffered, int[] actuallyOffered) { + int[] totalOffered, int[] actuallyOffered) { super(holder, flow); this.fluid = fluid; this.totalAcceptable = totalAcceptable; @@ -77,7 +75,7 @@ public String checkStateForErrors() { } if (actuallyOffered[i] > totalOffered[i]) { return "actuallyOffered[" + i + "](=" + actuallyOffered[i] - + ") shouldn't be greater than totalOffered[" + i + "](=" + totalOffered[i] + ")"; + + ") shouldn't be greater than totalOffered[" + i + "](=" + totalOffered[i] + ")"; } } return super.checkStateForErrors(); @@ -97,7 +95,7 @@ public static class OnMoveToCentre extends PipeEventFluid { private final int[] fluidLeaveCheck, fluidEnterCheck; public OnMoveToCentre(IPipeHolder holder, IFlowFluid flow, FluidStack fluid, int[] fluidLeavingSide, - int[] fluidEnteringCentre) { + int[] fluidEnteringCentre) { super(holder, flow); this.fluid = fluid; this.fluidLeavingSide = fluidLeavingSide; @@ -111,15 +109,15 @@ public String checkStateForErrors() { for (int i = 0; i < fluidLeavingSide.length; i++) { if (fluidLeavingSide[i] > fluidLeaveCheck[i]) { return "fluidLeavingSide[" + i + "](=" + fluidLeavingSide[i] - + ") shouldn't be bigger than its original value!(=" + fluidLeaveCheck[i] + ")"; + + ") shouldn't be bigger than its original value!(=" + fluidLeaveCheck[i] + ")"; } if (fluidEnteringCentre[i] > fluidEnterCheck[i]) { return "fluidEnteringCentre[" + i + "](=" + fluidEnteringCentre[i] - + ") shouldn't be bigger than its original value!(=" + fluidEnterCheck[i] + ")"; + + ") shouldn't be bigger than its original value!(=" + fluidEnterCheck[i] + ")"; } if (fluidEnteringCentre[i] > fluidLeavingSide[i]) { return "fluidEnteringCentre[" + i + "](=" + fluidEnteringCentre[i] - + ") shouldn't be bigger than fluidLeavingSide[" + i + "](=" + fluidLeavingSide[i] + ")"; + + ") shouldn't be bigger than fluidLeavingSide[" + i + "](=" + fluidLeavingSide[i] + ")"; } } return super.checkStateForErrors(); @@ -132,7 +130,7 @@ public static class SideCheck extends PipeEventFluid { /** The priorities of each side. Stored inversely to the values given, so a higher priority will have a lower * value than a lower priority. */ private final int[] priority = new int[6]; - private final EnumSet allowed = EnumSet.allOf(EnumFacing.class); + private final EnumSet allowed = EnumSet.allOf(Direction.class); public SideCheck(IPipeHolder holder, IFlowFluid flow, FluidStack fluid) { super(holder, flow); @@ -142,23 +140,23 @@ public SideCheck(IPipeHolder holder, IFlowFluid flow, FluidStack fluid) { /** Checks to see if a side if allowed. Note that this may return true even though a later handler might * disallow a side, so you should only use this to skip checking a side (for example a diamond pipe might not * check the filters for a specific side if its already been disallowed) */ - public boolean isAllowed(EnumFacing side) { + public boolean isAllowed(Direction side) { return allowed.contains(side); } /** Disallows the specific side(s) from being a destination for the item. If no sides are allowed, then the * fluid will stay in the current pipe section. */ - public void disallow(EnumFacing... sides) { - for (EnumFacing side : sides) { + public void disallow(Direction... sides) { + for (Direction side : sides) { allowed.remove(side); } } - public void disallowAll(Collection sides) { + public void disallowAll(Collection sides) { allowed.removeAll(sides); } - public void disallowAllExcept(EnumFacing side) { + public void disallowAllExcept(Direction side) { if (allowed.contains(side)) { allowed.clear(); allowed.add(side); @@ -167,7 +165,7 @@ public void disallowAllExcept(EnumFacing side) { } } - public void disallowAllExcept(EnumFacing... sides) { + public void disallowAllExcept(Direction... sides) { switch (sides.length) { case 0: { allowed.clear(); @@ -190,8 +188,8 @@ public void disallowAllExcept(EnumFacing... sides) { return; } default: { - EnumSet except = EnumSet.noneOf(EnumFacing.class); - for (EnumFacing face : sides) { + EnumSet except = EnumSet.noneOf(Direction.class); + for (Direction face : sides) { except.add(face); } this.allowed.retainAll(except); @@ -200,7 +198,7 @@ public void disallowAllExcept(EnumFacing... sides) { } } - public void disallowAllExcept(Collection sides) { + public void disallowAllExcept(Collection sides) { allowed.retainAll(sides); } @@ -208,30 +206,31 @@ public void disallowAll() { allowed.clear(); } - public void increasePriority(EnumFacing side) { + public void increasePriority(Direction side) { increasePriority(side, 1); } - public void increasePriority(EnumFacing side, int by) { + public void increasePriority(Direction side, int by) { priority[side.ordinal()] -= by; } - public void decreasePriority(EnumFacing side) { + public void decreasePriority(Direction side) { decreasePriority(side, 1); } - public void decreasePriority(EnumFacing side, int by) { + public void decreasePriority(Direction side, int by) { increasePriority(side, -by); } - public EnumSet getOrder() { + public EnumSet getOrder() { if (allowed.isEmpty()) { - return EnumSet.noneOf(EnumFacing.class); + return EnumSet.noneOf(Direction.class); } if (allowed.size() == 1) { return allowed; } - priority_search: { + priority_search: + { int val = priority[0]; for (int i = 1; i < priority.length; i++) { if (priority[i] != val) { @@ -251,8 +250,8 @@ public EnumSet getOrder() { continue; } last = current; - EnumSet set = EnumSet.noneOf(EnumFacing.class); - for (EnumFacing face : EnumFacing.VALUES) { + EnumSet set = EnumSet.noneOf(Direction.class); + for (Direction face : Direction.values()) { if (allowed.contains(face)) { if (priority[face.ordinal()] == current) { set.add(face); @@ -263,7 +262,7 @@ public EnumSet getOrder() { return set; } } - return EnumSet.noneOf(EnumFacing.class); + return EnumSet.noneOf(Direction.class); } } } diff --git a/api/buildcraft/api/transport/pipe/PipeEventHandler.java b/api/buildcraft/api/transport/pipe/PipeEventHandler.java index 15eaeca..44d9424 100644 --- a/api/buildcraft/api/transport/pipe/PipeEventHandler.java +++ b/api/buildcraft/api/transport/pipe/PipeEventHandler.java @@ -9,11 +9,11 @@ * extends {@link PipeEvent}.
    * An example is:
    * - @PipeEventHandler
    - public void sideCheck(PipeEventItem.SideCheck sideCheck) {
    - // Logic omitted
    - } - * + @PipeEventHandler
    + public void sideCheck(PipeEventItem.SideCheck sideCheck) {
    + // Logic omitted
    + } + * *
    */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) diff --git a/api/buildcraft/api/transport/pipe/PipeEventItem.java b/api/buildcraft/api/transport/pipe/PipeEventItem.java index e049029..f60fd24 100644 --- a/api/buildcraft/api/transport/pipe/PipeEventItem.java +++ b/api/buildcraft/api/transport/pipe/PipeEventItem.java @@ -1,23 +1,16 @@ package buildcraft.api.transport.pipe; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.EnumDyeColor; +import net.minecraft.entity.item.ItemEntity; +import net.minecraft.item.DyeColor; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.*; public abstract class PipeEventItem extends PipeEvent { @@ -44,8 +37,8 @@ protected PipeEventItem(boolean canBeCancelled, IPipeHolder holder, IFlowItems f /** Fires whenever item insertion is attempted. The item might have been extracted by the pipe behaviour, inserted * by another pipe or even a different kind of tile. Note that you have no way of telling what caused this event. */ public static class TryInsert extends PipeEventItem { - public final EnumDyeColor colour; - public final EnumFacing from; + public final DyeColor colour; + public final Direction from; /** The itemstack that is attempting to be inserted. NEVER CHANGE THIS! */ @Nonnull public final ItemStack attempting; @@ -53,8 +46,8 @@ public static class TryInsert extends PipeEventItem { * {@link #attempting} */ public int accepted; - public TryInsert(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, EnumFacing from, - @Nonnull ItemStack attempting) { + public TryInsert(IPipeHolder holder, IFlowItems flow, DyeColor colour, Direction from, + @Nonnull ItemStack attempting) { super(true, holder, flow); this.colour = colour; this.from = from; @@ -70,11 +63,11 @@ public void cancel() { } public static abstract class ReachDest extends PipeEventItem { - public EnumDyeColor colour; + public DyeColor colour; @Nonnull private ItemStack stack; - public ReachDest(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, @Nonnull ItemStack stack) { + public ReachDest(IPipeHolder holder, IFlowItems flow, DyeColor colour, @Nonnull ItemStack stack) { super(holder, flow); this.colour = colour; this.stack = stack; @@ -96,10 +89,10 @@ public void setStack(ItemStack stack) { /** Fired after {@link TryInsert} (if some items were allowed in) to modify the incoming itemstack or its colour. */ public static class OnInsert extends ReachDest { - public final EnumFacing from; + public final Direction from; - public OnInsert(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, @Nonnull ItemStack stack, - EnumFacing from) { + public OnInsert(IPipeHolder holder, IFlowItems flow, DyeColor colour, @Nonnull ItemStack stack, + Direction from) { super(holder, flow, colour, stack); this.from = from; } @@ -107,10 +100,10 @@ public OnInsert(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, @Nonnu /** Fired whenever an item reaches the centre of a pipe. Note that you *can* change the itemstack or the colour. */ public static class ReachCenter extends ReachDest { - public final EnumFacing from; + public final Direction from; - public ReachCenter(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, @Nonnull ItemStack stack, - EnumFacing from) { + public ReachCenter(IPipeHolder holder, IFlowItems flow, DyeColor colour, @Nonnull ItemStack stack, + Direction from) { super(holder, flow, colour, stack); this.from = from; } @@ -118,10 +111,10 @@ public ReachCenter(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, @No /** Fired whenever an item reaches the end of a pipe. Note that you *can* change the itemstack or the colour. */ public static class ReachEnd extends ReachDest { - public final EnumFacing to; + public final Direction to; - public ReachEnd(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, @Nonnull ItemStack stack, - EnumFacing to) { + public ReachEnd(IPipeHolder holder, IFlowItems flow, DyeColor colour, @Nonnull ItemStack stack, + Direction to) { super(holder, flow, colour, stack); this.to = to; } @@ -139,9 +132,9 @@ public static abstract class Ejected extends PipeEventItem { private ItemStack excess; /** The side that the item has been ejected to. */ - public final EnumFacing to; + public final Direction to; - protected Ejected(IPipeHolder holder, IFlowItems flow, ItemStack inserted, ItemStack excess, EnumFacing to) { + protected Ejected(IPipeHolder holder, IFlowItems flow, ItemStack inserted, ItemStack excess, Direction to) { super(holder, flow); this.inserted = inserted; this.excess = excess; @@ -165,8 +158,8 @@ public void setExcess(ItemStack stack) { public static class IntoPipe extends Ejected { public final IFlowItems otherPipe; - public IntoPipe(IPipeHolder holder, IFlowItems flow, ItemStack inserted, ItemStack excess, EnumFacing to, - IFlowItems otherPipe) { + public IntoPipe(IPipeHolder holder, IFlowItems flow, ItemStack inserted, ItemStack excess, Direction to, + IFlowItems otherPipe) { super(holder, flow, inserted, excess, to); this.otherPipe = otherPipe; } @@ -176,8 +169,8 @@ public IntoPipe(IPipeHolder holder, IFlowItems flow, ItemStack inserted, ItemSta public static class IntoTile extends Ejected { public final TileEntity tile; - public IntoTile(IPipeHolder holder, IFlowItems flow, ItemStack inserted, ItemStack excess, EnumFacing to, - TileEntity tile) { + public IntoTile(IPipeHolder holder, IFlowItems flow, ItemStack inserted, ItemStack excess, Direction to, + TileEntity tile) { super(holder, flow, inserted, excess, to); this.tile = tile; } @@ -193,18 +186,18 @@ public IntoTile(IPipeHolder holder, IFlowItems flow, ItemStack inserted, ItemSta /** Fired after {@link ReachCenter} to determine what sides are the items NOT allowed to go to, and the order of * priority for the allowed sides. */ public static class SideCheck extends PipeEventItem { - public final EnumDyeColor colour; - public final EnumFacing from; + public final DyeColor colour; + public final Direction from; @Nonnull public final ItemStack stack; /** The priorities of each side. Stored inversely to the values given, so a higher priority will have a lower * value than a lower priority. */ private final int[] priority = new int[6]; - private final EnumSet allowed = EnumSet.allOf(EnumFacing.class); + private final EnumSet allowed = EnumSet.allOf(Direction.class); - public SideCheck(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, EnumFacing from, - @Nonnull ItemStack stack) { + public SideCheck(IPipeHolder holder, IFlowItems flow, DyeColor colour, Direction from, + @Nonnull ItemStack stack) { super(holder, flow); this.colour = colour; this.from = from; @@ -214,23 +207,23 @@ public SideCheck(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, EnumF /** Checks to see if a side if allowed. Note that this may return true even though a later handler might * disallow a side, so you should only use this to skip checking a side (for example a diamond pipe might not * check the filters for a specific side if its already been disallowed) */ - public boolean isAllowed(EnumFacing side) { + public boolean isAllowed(Direction side) { return allowed.contains(side); } /** Disallows the specific side(s) from being a destination for the item. If no sides are allowed, then * {@link TryBounce} will be fired to test if the item can bounce back. */ - public void disallow(EnumFacing... sides) { - for (EnumFacing side : sides) { + public void disallow(Direction... sides) { + for (Direction side : sides) { allowed.remove(side); } } - public void disallowAll(Collection sides) { + public void disallowAll(Collection sides) { allowed.removeAll(sides); } - public void disallowAllExcept(EnumFacing... sides) { + public void disallowAllExcept(Direction... sides) { allowed.retainAll(Lists.newArrayList(sides)); } @@ -238,23 +231,23 @@ public void disallowAll() { allowed.clear(); } - public void increasePriority(EnumFacing side) { + public void increasePriority(Direction side) { increasePriority(side, 1); } - public void increasePriority(EnumFacing side, int by) { + public void increasePriority(Direction side, int by) { priority[side.ordinal()] -= by; } - public void decreasePriority(EnumFacing side) { + public void decreasePriority(Direction side) { decreasePriority(side, 1); } - public void decreasePriority(EnumFacing side, int by) { + public void decreasePriority(Direction side, int by) { increasePriority(side, -by); } - public List> getOrder() { + public List> getOrder() { // Skip the calculations if the size is simple switch (allowed.size()) { case 0: @@ -263,7 +256,8 @@ public List> getOrder() { return ImmutableList.of(allowed); default: } - priority_search: { + priority_search: + { int val = priority[0]; for (int i = 1; i < priority.length; i++) { if (priority[i] != val) { @@ -277,15 +271,15 @@ public List> getOrder() { int[] ordered = Arrays.copyOf(priority, 6); Arrays.sort(ordered); int last = 0; - List> list = Lists.newArrayList(); + List> list = Lists.newArrayList(); for (int i = 0; i < 6; i++) { int current = ordered[i]; if (i != 0 && current == last) { continue; } last = current; - EnumSet set = EnumSet.noneOf(EnumFacing.class); - for (EnumFacing face : EnumFacing.VALUES) { + EnumSet set = EnumSet.noneOf(Direction.class); + for (Direction face : Direction.values()) { if (allowed.contains(face)) { if (priority[face.ordinal()] == current) { set.add(face); @@ -303,14 +297,14 @@ public List> getOrder() { /** Fired after {@link SideCheck} (if all sides were disallowed) to see if the item is allowed to bounce back to * where it was inserted. */ public static class TryBounce extends PipeEventItem { - public final EnumDyeColor colour; - public final EnumFacing from; + public final DyeColor colour; + public final Direction from; @Nonnull public final ItemStack stack; public boolean canBounce = false; - public TryBounce(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, EnumFacing from, - @Nonnull ItemStack stack) { + public TryBounce(IPipeHolder holder, IFlowItems flow, DyeColor colour, Direction from, + @Nonnull ItemStack stack) { super(holder, flow); this.colour = colour; this.from = from; @@ -319,9 +313,9 @@ public TryBounce(IPipeHolder holder, IFlowItems flow, EnumDyeColor colour, EnumF } public static class Drop extends PipeEventItem { - private final EntityItem entity; + private final ItemEntity entity; - public Drop(IPipeHolder holder, IFlowItems flow, EntityItem entity) { + public Drop(IPipeHolder holder, IFlowItems flow, ItemEntity entity) { super(holder, flow); this.entity = entity; } @@ -342,32 +336,32 @@ public void setStack(ItemStack stack) { } } - public EntityItem getEntity() { + public ItemEntity getEntity() { return this.entity; } } /** Base class for {@link Split} and {@link FindDest}. Do not listen to this directly! */ public static abstract class OrderedEvent extends PipeEventItem { - public final List> orderedDestinations; + public final List> orderedDestinations; - public OrderedEvent(IPipeHolder holder, IFlowItems flow, List> orderedDestinations) { + public OrderedEvent(IPipeHolder holder, IFlowItems flow, List> orderedDestinations) { super(holder, flow); this.orderedDestinations = orderedDestinations; } - public EnumSet getAllPossibleDestinations() { - EnumSet set = EnumSet.noneOf(EnumFacing.class); - for (EnumSet e : orderedDestinations) { + public EnumSet getAllPossibleDestinations() { + EnumSet set = EnumSet.noneOf(Direction.class); + for (EnumSet e : orderedDestinations) { set.addAll(e); } return set; } - public ImmutableList generateRandomOrder() { - ImmutableList.Builder builder = ImmutableList.builder(); - for (EnumSet set : orderedDestinations) { - List faces = new ArrayList<>(set); + public ImmutableList generateRandomOrder() { + ImmutableList.Builder builder = ImmutableList.builder(); + for (EnumSet set : orderedDestinations) { + List faces = new ArrayList<>(set); Collections.shuffle(faces); builder.addAll(faces); } @@ -382,7 +376,7 @@ public ImmutableList generateRandomOrder() { public static class Split extends OrderedEvent { public final List items = new ArrayList<>(); - public Split(IPipeHolder holder, IFlowItems flow, List> order, ItemEntry toSplit) { + public Split(IPipeHolder holder, IFlowItems flow, List> order, ItemEntry toSplit) { super(holder, flow, order); items.add(toSplit); } @@ -394,8 +388,8 @@ public Split(IPipeHolder holder, IFlowItems flow, List> orde public static class FindDest extends OrderedEvent { public final ImmutableList items; - public FindDest(IPipeHolder holder, IFlowItems flow, List> orderedDestinations, - ImmutableList items) { + public FindDest(IPipeHolder holder, IFlowItems flow, List> orderedDestinations, + ImmutableList items) { super(holder, flow, orderedDestinations); this.items = items; } @@ -422,15 +416,15 @@ public void modifyTo(double target, double maxDelta) { /** Mostly immutable holding class for item stacks. */ public static class ItemEntry { - public final EnumDyeColor colour; + public final DyeColor colour; @Nonnull public final ItemStack stack; - public final EnumFacing from; + public final Direction from; /** The list of the destinations to try, in order. */ @Nullable - public List to; + public List to; - public ItemEntry(EnumDyeColor colour, @Nonnull ItemStack stack, EnumFacing from) { + public ItemEntry(DyeColor colour, @Nonnull ItemStack stack, Direction from) { this.colour = colour; this.stack = stack; this.from = from; diff --git a/api/buildcraft/api/transport/pipe/PipeEventPower.java b/api/buildcraft/api/transport/pipe/PipeEventPower.java index 4e356eb..6b3db58 100644 --- a/api/buildcraft/api/transport/pipe/PipeEventPower.java +++ b/api/buildcraft/api/transport/pipe/PipeEventPower.java @@ -1,8 +1,7 @@ package buildcraft.api.transport.pipe; -import net.minecraft.util.EnumFacing; - import buildcraft.api.mj.MjAPI; +import net.minecraft.util.Direction; public abstract class PipeEventPower extends PipeEvent { public final IFlowPower flow; @@ -74,18 +73,18 @@ public void setReceiver(boolean receiver) { } public static class PrimaryDirection extends PipeEventPower { - private EnumFacing facing; + private Direction facing; - public PrimaryDirection(IPipeHolder holder, IFlowPower flow, EnumFacing facing) { + public PrimaryDirection(IPipeHolder holder, IFlowPower flow, Direction facing) { super(holder, flow); this.facing = facing; } - public EnumFacing getFacing() { + public Direction getFacing() { return facing; } - public void setFacing(EnumFacing facing) { + public void setFacing(Direction facing) { this.facing = facing; } } diff --git a/api/buildcraft/api/transport/pipe/PipeEventStatement.java b/api/buildcraft/api/transport/pipe/PipeEventStatement.java index 5d96caf..c40ede6 100644 --- a/api/buildcraft/api/transport/pipe/PipeEventStatement.java +++ b/api/buildcraft/api/transport/pipe/PipeEventStatement.java @@ -1,15 +1,13 @@ package buildcraft.api.transport.pipe; -import java.util.Collection; - -import javax.annotation.Nonnull; - -import net.minecraft.util.EnumFacing; - import buildcraft.api.statements.IActionInternal; import buildcraft.api.statements.IActionInternalSided; import buildcraft.api.statements.ITriggerInternal; import buildcraft.api.statements.ITriggerInternalSided; +import net.minecraft.util.Direction; + +import javax.annotation.Nonnull; +import java.util.Collection; public abstract class PipeEventStatement extends PipeEvent { public PipeEventStatement(IPipeHolder holder) { @@ -31,9 +29,9 @@ public static class AddTriggerInternalSided extends PipeEventStatement { public final Collection triggers; @Nonnull - public final EnumFacing side; + public final Direction side; - public AddTriggerInternalSided(IPipeHolder holder, Collection triggers, @Nonnull EnumFacing side) { + public AddTriggerInternalSided(IPipeHolder holder, Collection triggers, @Nonnull Direction side) { super(holder); this.triggers = triggers; this.side = side; @@ -55,9 +53,9 @@ public static class AddActionInternalSided extends PipeEventStatement { public final Collection actions; @Nonnull - public final EnumFacing side; + public final Direction side; - public AddActionInternalSided(IPipeHolder holder, Collection actions, @Nonnull EnumFacing side) { + public AddActionInternalSided(IPipeHolder holder, Collection actions, @Nonnull Direction side) { super(holder); this.actions = actions; this.side = side; diff --git a/api/buildcraft/api/transport/pipe/PipeEventTileState.java b/api/buildcraft/api/transport/pipe/PipeEventTileState.java index 1847561..b05b00c 100644 --- a/api/buildcraft/api/transport/pipe/PipeEventTileState.java +++ b/api/buildcraft/api/transport/pipe/PipeEventTileState.java @@ -8,21 +8,21 @@ public abstract class PipeEventTileState extends PipeEvent { super(holder); } - /** Fired in {@link TileEntity#invalidate()} */ + /** Fired in {@link TileEntity#setRemoved()} */ public static class Invalidate extends PipeEventTileState { public Invalidate(IPipeHolder holder) { super(holder); } } - /** Fired in {@link TileEntity#validate()} */ + /** Fired in {@link TileEntity#clearRemoved()} */ public static class Validate extends PipeEventTileState { public Validate(IPipeHolder holder) { super(holder); } } - /** Fired in {@link TileEntity#onChunkUnload()} */ + /** Fired in {@link TileEntity#onChunkUnloaded()} */ public static class ChunkUnload extends PipeEventTileState { public ChunkUnload(IPipeHolder holder) { super(holder); diff --git a/api/buildcraft/api/transport/pipe/PipeFaceTex.java b/api/buildcraft/api/transport/pipe/PipeFaceTex.java index 2c90354..af557ae 100644 --- a/api/buildcraft/api/transport/pipe/PipeFaceTex.java +++ b/api/buildcraft/api/transport/pipe/PipeFaceTex.java @@ -120,7 +120,7 @@ public boolean equals(Object obj) { if (!Arrays.equals(textures, other.textures)) { return false; } - for (int i = textures.length; i > 0;) { + for (int i = textures.length; i > 0; ) { i--; if (getColour(i) != other.getColour(i)) { return false; diff --git a/api/buildcraft/api/transport/pipe/PipeFlow.java b/api/buildcraft/api/transport/pipe/PipeFlow.java index 3ec2117..ee7c48b 100644 --- a/api/buildcraft/api/transport/pipe/PipeFlow.java +++ b/api/buildcraft/api/transport/pipe/PipeFlow.java @@ -1,25 +1,24 @@ package buildcraft.api.transport.pipe; -import java.io.IOException; - -import javax.annotation.Nonnull; - -import net.minecraft.entity.player.EntityPlayer; +import buildcraft.api.core.EnumPipePart; +import buildcraft.api.transport.pipe.IPipeHolder.IWriter; +import buildcraft.api.transport.pipe.IPipeHolder.PipeMessageReceiver; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; import net.minecraft.util.NonNullList; import net.minecraft.util.math.RayTraceResult; - +import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fml.network.NetworkDirection; -import buildcraft.api.core.EnumPipePart; -import buildcraft.api.transport.pipe.IPipeHolder.IWriter; -import buildcraft.api.transport.pipe.IPipeHolder.PipeMessageReceiver; +import javax.annotation.Nonnull; +import java.io.IOException; public abstract class PipeFlow implements ICapabilityProvider { /** The ID for completely refreshing the state of this flow. */ @@ -34,59 +33,64 @@ public PipeFlow(IPipe pipe) { this.pipe = pipe; } - public PipeFlow(IPipe pipe, NBTTagCompound nbt) { + public PipeFlow(IPipe pipe, CompoundNBT nbt) { this.pipe = pipe; } - public NBTTagCompound writeToNbt() { - return new NBTTagCompound(); + public CompoundNBT writeToNbt() { + return new CompoundNBT(); } /** Writes a payload with the specified id. Standard ID's are NET_ID_FULL_STATE and NET_ID_UPDATE. */ - public void writePayload(int id, PacketBuffer buffer, Side side) {} + public void writePayload(int id, PacketBuffer buffer, Dist side) { + } /** Reads a payload with the specified id. Standard ID's are NET_ID_FULL_STATE and NET_ID_UPDATE. */ - public void readPayload(int id, PacketBuffer buffer, Side side) throws IOException {} + public void readPayload(int id, PacketBuffer buffer, NetworkDirection side) throws IOException { + } public void sendPayload(int id) { - final Side side = pipe.getHolder().getPipeWorld().isRemote ? Side.CLIENT : Side.SERVER; + final Dist side = pipe.getHolder().getPipeWorld().isClientSide ? Dist.CLIENT : Dist.DEDICATED_SERVER; sendCustomPayload(id, (buf) -> writePayload(id, buf, side)); } public final void sendCustomPayload(int id, IWriter writer) { - pipe.getHolder().sendMessage(PipeMessageReceiver.FLOW, buffer -> { + pipe.getHolder().sendMessage(PipeMessageReceiver.FLOW, buffer -> + { buffer.writeBoolean(true); buffer.writeShort(id); writer.write(buffer); }); } - public abstract boolean canConnect(EnumFacing face, PipeFlow other); + public abstract boolean canConnect(Direction face, PipeFlow other); - public abstract boolean canConnect(EnumFacing face, TileEntity oTile); + public abstract boolean canConnect(Direction face, TileEntity oTile); /** Used to force a connection to a given tile, even if the {@link PipeBehaviour} wouldn't normally connect to * it. */ - public boolean shouldForceConnection(EnumFacing face, TileEntity oTile) { + public boolean shouldForceConnection(Direction face, TileEntity oTile) { return false; } - public void onTick() {} + public void onTick() { + } - public void addDrops(NonNullList toDrop, int fortune) {} + public void addDrops(NonNullList toDrop, int fortune) { + } - public boolean onFlowActivate(EntityPlayer player, RayTraceResult trace, float hitX, float hitY, float hitZ, - EnumPipePart part) { + public boolean onFlowActivate(PlayerEntity player, RayTraceResult trace, float hitX, float hitY, float hitZ, + EnumPipePart part) { return false; } - @Override - public final boolean hasCapability(@Nonnull Capability capability, EnumFacing facing) { - return getCapability(capability, facing) != null; - } +// @Override +// public final boolean hasCapability(@Nonnull Capability capability, EnumFacing facing) { +// return getCapability(capability, facing) != null; +// } @Override - public T getCapability(@Nonnull Capability capability, EnumFacing facing) { - return null; + public LazyOptional getCapability(@Nonnull Capability capability, Direction facing) { + return LazyOptional.empty(); } } diff --git a/api/buildcraft/api/transport/pipe/PipeFlowType.java b/api/buildcraft/api/transport/pipe/PipeFlowType.java index fb79d40..eeeccc8 100644 --- a/api/buildcraft/api/transport/pipe/PipeFlowType.java +++ b/api/buildcraft/api/transport/pipe/PipeFlowType.java @@ -1,6 +1,6 @@ package buildcraft.api.transport.pipe; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; public final class PipeFlowType { public final IFlowCreator creator; @@ -27,6 +27,6 @@ public interface IFlowCreator { @FunctionalInterface public interface IFlowLoader { - PipeFlow loadFlow(IPipe t, NBTTagCompound u); + PipeFlow loadFlow(IPipe t, CompoundNBT u); } } diff --git a/api/buildcraft/api/transport/pluggable/IPlugDynamicRenderer.java b/api/buildcraft/api/transport/pluggable/IPlugDynamicRenderer.java index 1a71aa3..c94454a 100644 --- a/api/buildcraft/api/transport/pluggable/IPlugDynamicRenderer.java +++ b/api/buildcraft/api/transport/pluggable/IPlugDynamicRenderer.java @@ -1,8 +1,9 @@ package buildcraft.api.transport.pluggable; - -import net.minecraft.client.renderer.BufferBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.IVertexBuilder; public interface IPlugDynamicRenderer

    { - void render(P plug, double x, double y, double z, float partialTicks, BufferBuilder bb); + // void render(P plug, double x, double y, double z, float partialTicks, BufferBuilder bb); + void render(P gate, float partialTicks, MatrixStack poseStack, IVertexBuilder vertexConsumer, int combinedLight, int combinedOverlay); } diff --git a/api/buildcraft/api/transport/pluggable/IPluggableStaticBaker.java b/api/buildcraft/api/transport/pluggable/IPluggableStaticBaker.java index a3f0012..bd5fca8 100644 --- a/api/buildcraft/api/transport/pluggable/IPluggableStaticBaker.java +++ b/api/buildcraft/api/transport/pluggable/IPluggableStaticBaker.java @@ -1,13 +1,12 @@ package buildcraft.api.transport.pluggable; -import java.util.List; - -import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.List; -@SideOnly(Side.CLIENT) +@OnlyIn(Dist.CLIENT) public interface IPluggableStaticBaker { List bake(K key); } diff --git a/api/buildcraft/api/transport/pluggable/PipePluggable.java b/api/buildcraft/api/transport/pluggable/PipePluggable.java index 73d22b6..a9f0d90 100644 --- a/api/buildcraft/api/transport/pluggable/PipePluggable.java +++ b/api/buildcraft/api/transport/pluggable/PipePluggable.java @@ -1,75 +1,74 @@ package buildcraft.api.transport.pluggable; -import java.io.IOException; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import buildcraft.api.transport.pipe.IPipeHolder; import net.minecraft.block.Block; -import net.minecraft.block.state.BlockFaceShape; +import net.minecraft.block.BlockState; +import net.minecraft.client.renderer.RenderType; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.PacketBuffer; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; import net.minecraft.util.NonNullList; -import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.Explosion; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorld; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fml.network.NetworkDirection; +import net.minecraftforge.fml.network.NetworkEvent; -import buildcraft.api.transport.pipe.IPipeHolder; -import buildcraft.api.transport.pipe.IPipeHolder.PipeMessageReceiver; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.io.IOException; public abstract class PipePluggable { public final PluggableDefinition definition; public final IPipeHolder holder; - public final EnumFacing side; + public final Direction side; - public PipePluggable(PluggableDefinition definition, IPipeHolder holder, EnumFacing side) { + public PipePluggable(PluggableDefinition definition, IPipeHolder holder, Direction side) { this.definition = definition; this.holder = holder; this.side = side; } - public NBTTagCompound writeToNbt() { - NBTTagCompound nbt = new NBTTagCompound(); + public CompoundNBT writeToNbt() { + CompoundNBT nbt = new CompoundNBT(); return nbt; } /** Writes the payload that will be passed into - * {@link PluggableDefinition#loadFromBuffer(IPipeHolder, EnumFacing, PacketBuffer)} on the client. (This is called + * {@link PluggableDefinition#loadFromBuffer(IPipeHolder, Direction, PacketBuffer)} on the client. (This is called * on the server and sent to the client). Note that this will be called *instead* of write and read payload. */ public void writeCreationPayload(PacketBuffer buffer) { } - public void writePayload(PacketBuffer buffer, Side side) { + public void writePayload(PacketBuffer buffer, Dist side) { } - public void readPayload(PacketBuffer buffer, Side side, MessageContext ctx) throws IOException { + public void readPayload(PacketBuffer buffer, NetworkDirection side, NetworkEvent.Context ctx) throws IOException { } public final void scheduleNetworkUpdate() { - holder.scheduleNetworkUpdate(PipeMessageReceiver.PLUGGABLES[side.ordinal()]); + holder.scheduleNetworkUpdate(IPipeHolder.PipeMessageReceiver.PLUGGABLES[side.ordinal()]); } - public void onTick() {} + public void onTick() { + } /** @return A bounding box that will be used for collisions and raytracing. */ - public abstract AxisAlignedBB getBoundingBox(); + public abstract VoxelShape getBoundingBox(); /** @return True if the pipe cannot connect outwards (it is blocked), or False if this does not block the pipe. */ public boolean isBlocking() { @@ -78,14 +77,14 @@ public boolean isBlocking() { /** Gets the value of a specified capability key, or null if the given capability is not supported at the call time. * This is effectively {@link ICapabilityProvider}, but where - * {@link ICapabilityProvider#hasCapability(Capability, EnumFacing)} will return true when this returns a non-null + * {@link ICapabilityProvider#getCapability(Capability, Direction)#isPresent()} will return true when this returns a non-null * value. */ - public T getCapability(@Nonnull Capability cap) { - return null; + public LazyOptional getCapability(@Nonnull Capability cap) { + return LazyOptional.empty(); } /** Gets the {@link Capability} that is accessible from the pipe that this is attached to. - * + * * @param cap * @return */ public T getInternalCapability(@Nonnull Capability cap) { @@ -93,7 +92,8 @@ public T getInternalCapability(@Nonnull Capability cap) { } /** Called whenever this pluggable is removed from the pipe. */ - public void onRemove() {} + public void onRemove() { + } /** @param toDrop A list containing all the items to drop (so you should add your items to this list) */ public void addDrops(NonNullList toDrop, int fortune) { @@ -104,58 +104,61 @@ public void addDrops(NonNullList toDrop, int fortune) { } /** Called whenever this pluggable is picked by the player (similar to Block.getPickBlock) - * + * * @return The stack that should be picked, or ItemStack.EMPTY if no stack can be picked from this pluggable. */ public ItemStack getPickStack() { return ItemStack.EMPTY; } - public boolean onPluggableActivate(EntityPlayer player, RayTraceResult trace, float hitX, float hitY, float hitZ) { + public boolean onPluggableActivate(PlayerEntity player, RayTraceResult trace, float hitX, float hitY, float hitZ) { return false; } + @OnlyIn(Dist.CLIENT) @Nullable - public PluggableModelKey getModelRenderKey(BlockRenderLayer layer) { + public PluggableModelKey getModelRenderKey(RenderType layer) { return null; } /** Called if the {@link IPluggableStaticBaker} returns quads with tint indexes set to * data * 6 + key.side.ordinal(). "data" is passed in here as "tintIndex". - * + * * @return The tint index to render the quad with, or -1 for default. */ - @SideOnly(Side.CLIENT) + @OnlyIn(Dist.CLIENT) public int getBlockColor(int tintIndex) { return -1; } /** PipePluggable version of - * {@link Block#canBeConnectedTo(net.minecraft.world.IBlockAccess, net.minecraft.util.math.BlockPos, EnumFacing)}. */ + * {@link Block#canBeConnectedTo(IWorld, BlockPos, Direction)}. */ public boolean canBeConnected() { return false; } /** PipePluggable version of - * {@link net.minecraft.block.state.IBlockState#isSideSolid(IBlockAccess, BlockPos, EnumFacing)} */ + * {@link BlockState#isSideSolid(IBlockAccess, BlockPos, Direction)} */ public boolean isSideSolid() { return false; } - /** PipePluggable version of {@link Block#getExplosionResistance(World, BlockPos, Entity, Explosion)} */ - public float getExplosionResistance(@Nullable Entity exploder, Explosion explosion) { + /** PipePluggable version of {@link Block#getExplosionResistance(BlockState, IBlockReader, BlockPos, Explosion)} */ +// public float getExplosionResistance(@Nullable Entity exploder, Explosion explosion) + public float getExplosionResistance(@Nonnull Entity exploder, Explosion explosion) { return 0; } - public boolean canConnectToRedstone(@Nullable EnumFacing to) { + public boolean canConnectToRedstone(@Nullable Direction to) { return false; } - /** PipePluggable version of - * {@link net.minecraft.block.state.IBlockState#getBlockFaceShape(IBlockAccess, BlockPos, EnumFacing)} */ - public BlockFaceShape getBlockFaceShape() { - return BlockFaceShape.UNDEFINED; - } + // Calen: seems use block Shape in 1.18.2 +// /** PipePluggable version of +// * {@link net.minecraft.block.state.IBlockState#getBlockFaceShape(IBlockAccess, BlockPos, EnumFacing)} */ +// public BlockFaceShape getBlockFaceShape() { +// return BlockFaceShape.UNDEFINED; +// } - public void onPlacedBy(EntityPlayer player) { + public void onPlacedBy(PlayerEntity player) { } } diff --git a/api/buildcraft/api/transport/pluggable/PluggableDefinition.java b/api/buildcraft/api/transport/pluggable/PluggableDefinition.java index 4d7fdaa..968e6d4 100644 --- a/api/buildcraft/api/transport/pluggable/PluggableDefinition.java +++ b/api/buildcraft/api/transport/pluggable/PluggableDefinition.java @@ -1,14 +1,13 @@ package buildcraft.api.transport.pluggable; -import javax.annotation.Nullable; - -import net.minecraft.nbt.NBTTagCompound; +import buildcraft.api.core.InvalidInputDataException; +import buildcraft.api.transport.pipe.IPipeHolder; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.PacketBuffer; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; -import buildcraft.api.core.InvalidInputDataException; -import buildcraft.api.transport.pipe.IPipeHolder; +import javax.annotation.Nullable; public final class PluggableDefinition { public final ResourceLocation identifier; @@ -33,12 +32,12 @@ public PluggableDefinition(ResourceLocation identifier, @Nullable IPluggableCrea this.creator = creator; } - public PipePluggable readFromNbt(IPipeHolder holder, EnumFacing side, NBTTagCompound nbt) { + public PipePluggable readFromNbt(IPipeHolder holder, Direction side, CompoundNBT nbt) { return reader.readFromNbt(this, holder, side, nbt); } - public PipePluggable loadFromBuffer(IPipeHolder holder, EnumFacing side, PacketBuffer buffer) - throws InvalidInputDataException { + public PipePluggable loadFromBuffer(IPipeHolder holder, Direction side, PacketBuffer buffer) + throws InvalidInputDataException { return loader.loadFromBuffer(this, holder, side, buffer); } @@ -47,30 +46,26 @@ public interface IPluggableNbtReader { /** Reads the pipe pluggable from NBT. Unlike {@link IPluggableNetLoader} (which is allowed to fail and throw an * exception if the wrong data is given) this should make a best effort to read the pluggable from nbt, or fall * back to sensible defaults. */ - PipePluggable readFromNbt(PluggableDefinition definition, IPipeHolder holder, EnumFacing side, - NBTTagCompound nbt); + PipePluggable readFromNbt(PluggableDefinition definition, IPipeHolder holder, Direction side, CompoundNBT nbt); } @FunctionalInterface public interface IPluggableNetLoader { - PipePluggable loadFromBuffer(PluggableDefinition definition, IPipeHolder holder, EnumFacing side, - PacketBuffer buffer) throws InvalidInputDataException; + PipePluggable loadFromBuffer(PluggableDefinition definition, IPipeHolder holder, Direction side, PacketBuffer buffer) throws InvalidInputDataException; } @FunctionalInterface public interface IPluggableCreator extends IPluggableNbtReader, IPluggableNetLoader { @Override - default PipePluggable loadFromBuffer(PluggableDefinition definition, IPipeHolder holder, EnumFacing side, - PacketBuffer buffer) { + default PipePluggable loadFromBuffer(PluggableDefinition definition, IPipeHolder holder, Direction side, PacketBuffer buffer) { return createSimplePluggable(definition, holder, side); } @Override - default PipePluggable readFromNbt(PluggableDefinition definition, IPipeHolder holder, EnumFacing side, - NBTTagCompound nbt) { + default PipePluggable readFromNbt(PluggableDefinition definition, IPipeHolder holder, Direction side, CompoundNBT nbt) { return createSimplePluggable(definition, holder, side); } - PipePluggable createSimplePluggable(PluggableDefinition definition, IPipeHolder holder, EnumFacing side); + PipePluggable createSimplePluggable(PluggableDefinition definition, IPipeHolder holder, Direction side); } } diff --git a/api/buildcraft/api/transport/pluggable/PluggableModelKey.java b/api/buildcraft/api/transport/pluggable/PluggableModelKey.java index 7c832c1..336f6e8 100644 --- a/api/buildcraft/api/transport/pluggable/PluggableModelKey.java +++ b/api/buildcraft/api/transport/pluggable/PluggableModelKey.java @@ -1,17 +1,17 @@ package buildcraft.api.transport.pluggable; -import java.util.Objects; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.util.Direction; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; +import java.util.Objects; public abstract class PluggableModelKey { - public final BlockRenderLayer layer; - public final EnumFacing side; + public final RenderType layer; + public final Direction side; private final int hash; - public PluggableModelKey(BlockRenderLayer layer, EnumFacing side) { - if (layer != BlockRenderLayer.CUTOUT && layer != BlockRenderLayer.TRANSLUCENT) { + public PluggableModelKey(RenderType layer, Direction side) { + if (layer != RenderType.cutout() && layer != RenderType.translucent()) { throw new IllegalArgumentException("Can only use CUTOUT or TRANSLUCENT at the moment (was " + layer + ")"); } if (side == null) throw new NullPointerException("side"); diff --git a/build.gradle b/build.gradle index 0efb16f..716d404 100644 --- a/build.gradle +++ b/build.gradle @@ -1,22 +1,23 @@ - -// For those who want the bleeding edge buildscript { repositories { - jcenter() - maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" - } + maven { url = 'https://maven.minecraftforge.net' } + mavenCentral() } dependencies { - classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT" + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true + + classpath 'org.spongepowered:mixingradle:0.7.+' + classpath 'javax.vecmath:vecmath:1.5.2' } } -apply plugin: "net.minecraftforge.gradle.forge" - -if (gradle.startParameter.taskNames.contains("checkstyle")) { - apply plugin: "checkstyle" +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. +plugins { + id 'eclipse' + id 'maven-publish' } +apply plugin: 'net.minecraftforge.gradle' +// Mixin +apply plugin: 'org.spongepowered.mixin' ext.configFile = file "build.properties" configFile.withReader { @@ -27,25 +28,110 @@ configFile.withReader { } version = config.mod_version -group= "com.mod-buildcraft.api" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +group= "com.mod-buildcraft.api" archivesBaseName = "buildcraft-api" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8. +println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { - version = config.mc_version + "-" + config.forge_version - runDir = "run" - - // the mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD snapshot are built nightly. - // stable_# stables are built at the discretion of the MCP team. + // The mappings can be changed at any time, and must be in the following format. + // Channel: Version: + // snapshot YYYYMMDD Snapshot are built nightly. + // stable # Stables are built at the discretion of the MCP team. + // official MCVersion Official field/method names from Mojang mapping files + // + // You must be aware of the Mojang license when using the 'official' mappings. + // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md + // // Use non-default mappings at your own risk. they may not always work. - // simply re-run your setup task after changing the mappings to update your workspace. - mappings = config.mappings_version + // Simply re-run your setup task after changing the mappings to update your workspace. + mappings channel: config.mappings_channel, version: config.mappings_version // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. + + accessTransformer = file('buildcraft_resources/META-INF/accesstransformer.cfg') + + // Default run configurations. + // These can be tweaked, removed, or duplicated as needed. + runs { + client { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + // The markers can be changed as needed. + // "SCAN": For mods scan. + // "REGISTRIES": For firing of registry events. + // "REGISTRYDUMP": For getting the contents of all registries. + property 'forge.logging.markers', 'REGISTRIES' + + // Recommended logging level for the console + // You can set various levels here. + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels + property 'forge.logging.console.level', 'debug' + + // Mixin + arg "-mixin.config=mixins.buildcraft.json" + + mods { + buildcraftcore { + source sourceSets.main + } + } + } + + server { + workingDirectory project.file('run_server') + + // Recommended logging data for a userdev environment + // The markers can be changed as needed. + // "SCAN": For mods scan. + // "REGISTRIES": For firing of registry events. + // "REGISTRYDUMP": For getting the contents of all registries. + property 'forge.logging.markers', 'REGISTRIES' + + // Recommended logging level for the console + // You can set various levels here. + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels + property 'forge.logging.console.level', 'debug' + + // Mixin + arg "-mixin.config=mixins.buildcraft.json" + + mods { + buildcraftcore { + source sourceSets.main + } + } + } + + data { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + // The markers can be changed as needed. + // "SCAN": For mods scan. + // "REGISTRIES": For firing of registry events. + // "REGISTRYDUMP": For getting the contents of all registries. + property 'forge.logging.markers', 'REGISTRIES' + + // Recommended logging level for the console + // You can set various levels here. + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels + property 'forge.logging.console.level', 'debug' + + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. + args '--mod', 'buildcraftcore', '--all', '--output', file('buildcraft_resources_generated/'), '--existing', file('buildcraft_resources/') + + mods { + buildcraftcore { + source sourceSets.main + } + } + } + } } +// Include resources generated by data generators. sourceSets { main { java { @@ -54,58 +140,86 @@ sourceSets { } } -if (gradle.startParameter.taskNames.contains("checkstyle")) { - checkstyle { - configFile = file("guidelines/buildcraft.checkstyle") - } +repositories { + // Put repositories for dependencies here + // ForgeGradle automatically adds the Forge maven and Maven Central for you - task checkstyle {} - tasks["checkstyle"].dependsOn checkstyleApi - tasks["checkstyle"].dependsOn checkstyleMain + // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: + flatDir { + dir 'libs' + } - tasks["checkstyleApi"].enabled = gradle.startParameter.taskNames.contains("checkstyle") - tasks["checkstyleMain"].enabled = gradle.startParameter.taskNames.contains("checkstyle") + maven { + name 'CurseMaven' + url 'https://www.cursemaven.com' + content { + includeGroup 'curse.maven' + } + } } -processResources -{ - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version +dependencies { + // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed + // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. + // The userdev artifact is a special name and will get all sorts of transformations applied to it. + minecraft 'net.minecraftforge:forge:1.16.5-36.2.34' - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' + // Examples using mod jars from ./libs - // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version - } + compileOnly("javax.vecmath:vecmath:1.5.2") + runtimeOnly("javax.vecmath:vecmath:1.5.2") + compileOnly("net.sf.trove4j:trove4j:3.0.3") + runtimeOnly("net.sf.trove4j:trove4j:3.0.3") - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + jarJar(group: 'net.sf.trove4j', name: 'trove4j', version: '[3.0.3,)') { + jarJar.pin(it, '3.0.3') + } + jarJar(group: 'javax.vecmath', name: 'vecmath', version: '[1.5.2,)') { + jarJar.pin(it, '1.5.2') } -} -compileJava { - options.compilerArgs << "-Xmaxerrs" << "2000" - options.compilerArgs << "-Xmaxwarns" << "2" - options.compilerArgs << "-Xlint:all" - options.compilerArgs << "-Xdiags:verbose" - options.compilerArgs << "-encoding" << "UTF-8" -} + // Testing + testImplementation "junit:junit:4.12" + testImplementation 'org.hamcrest:hamcrest:2.2' +// compileOnly "junit:junit:4.12" -javadoc { - options.setUse(true) - options.addStringsOption("Xmaxerrs").setValue(["2000"]) - options.addStringsOption("Xmaxwarns").setValue(["2"]) + annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' } -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir +// Example for how to get properties into the manifest for reading by the runtime.. +jar { + manifest { + attributes([ + "Specification-Title": "BuildCraft", + "Specification-Vendor": "BuildCraft Team", + "Specification-Version": project.version, + "Implementation-Title": project.name, + "Implementation-Version": project.jar.archiveVersion, + "Implementation-Vendor" :"BuildCraft Team", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "MixinConfigs" : "mixins.buildcraft.json" + ]) + } + include '**/**/**/libs/*' } -artifacts { - archives javadocJar +// Example configuration to allow publishing using the maven-publish task +// This is the preferred method to reobfuscate your jar file +jar.finalizedBy('reobfJar') +// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing +//publish.dependsOn('reobfJar') + +publishing { + publications { + mavenJava(MavenPublication) { + artifact jar + } + } + repositories { + maven { + url "file:///${project.projectDir}/mcmodsrepo" + } + } } + +jar.enabled = true diff --git a/build.properties b/build.properties index d21cfb0..0b89600 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,5 @@ -mc_version=1.12.2 -forge_version=14.23.0.2532 -mappings_version=snapshot_20170629 +mc_version=1.16.5 +forge_version=36.2.34 +mappings_channel=official +mappings_version=1.16.5 mod_version=7.99 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 30d399d8d2bf522ff5de94bf434a7cc43a9a74b5..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f 100644 GIT binary patch literal 59203 zcma&O1CT9Y(k9%tZQHhO+qUh#ZQHhO+qmuS+qP|E@9xZO?0h@l{(r>DQ>P;GjjD{w zH}lENr;dU&FbEU?00aa80D$0M0RRB{U*7-#kbjS|qAG&4l5%47zyJ#WrfA#1$1Ctx zf&Z_d{GW=lf^w2#qRJ|CvSJUi(^E3iv~=^Z(zH}F)3Z%V3`@+rNB7gTVU{Bb~90p|f+0(v;nz01EG7yDMX9@S~__vVgv%rS$+?IH+oZ03D5zYrv|^ zC1J)SruYHmCki$jLBlTaE5&dFG9-kq3!^i>^UQL`%gn6)jz54$WDmeYdsBE9;PqZ_ zoGd=P4+|(-u4U1dbAVQrFWoNgNd;0nrghPFbQrJctO>nwDdI`Q^i0XJDUYm|T|RWc zZ3^Qgo_Qk$%Fvjj-G}1NB#ZJqIkh;kX%V{THPqOyiq)d)0+(r9o(qKlSp*hmK#iIY zA^)Vr$-Hz<#SF=0@tL@;dCQsm`V9s1vYNq}K1B)!XSK?=I1)tX+bUV52$YQu*0%fnWEukW>mxkz+%3-S!oguE8u#MGzST8_Dy^#U?fA@S#K$S@9msUiX!gd_ow>08w5)nX{-KxqMOo7d?k2&?Vf z&diGDtZr(0cwPe9z9FAUSD9KC)7(n^lMWuayCfxzy8EZsns%OEblHFSzP=cL6}?J| z0U$H!4S_TVjj<`6dy^2j`V`)mC;c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X&Yk5Ybqnd5 z6{OV1e&TJ`i%i*?w5$C|LIWO+5DO4mz`OqH*QZi5c2-jYXynC!ClT=co&^B7)&2h? z13=A-KV$&d`bGEu2`D-kFi$u%GzdO$(>;**zq0p0^YHyZ200S?_ET0&Nr+xbP8_&X z|JPz&pmmGibc>XLC;GSl{C?#5e*0YfZ!uXRIVo{5MWtu5;*Sx&6#!0k|2cru-S-0- zE8h zKm$d8EgbEE8_UE^EsTT=42c7XPc_ z`L2vjD!__^0DI?~$@p>9_}*ds5&gNf@&D|FQM-dM3}B#%6|l|U_C@_TYJ6V&%)x*XiFW>LwkUonE*6Q zzuqTahCiYSTU$GP%e!GCt7mEjbh`e`w()ofbczuVi2(0WE#_Z26ModS##e^*kI>(T zfS8Msf#ZMW(;uS-;O3Q70a1m49Z2&7@;}X=;{PM+Uk}B1>~EF+b4NVRaQg$g#&=Ze zkGS8v^?#Y4$0-hf;t{;~Bi=8!{(mJreB2w4)93wUp?vvAmj7*W{**Q6C!Dv&e`n9{ z2KbLN=-=!2O>gFL(wm=vD4PE}17FHlHU&C$p3zPo5#?#ere@54V%Y>A7_#I zQM|@iW2al;9OU?hJdTaDgRR2SG{xSSx&Get}{Ko$T z|NTzkB1KdE%B{{_`wo%Vlq*JJ(4pCo>E|AOS7)hr*k=&{`2PqGfje&+o?LU+wvS%=vh)_D{~E(EpqB&*tiJQ0-65Stm4}a^s|D!>Voy|XKl52jW`5Wx_2K{yU2iy19>-ZD@r0!qf|8F1U p \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -30,6 +64,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,33 +75,14 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -90,7 +106,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -110,11 +126,13 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" @@ -138,27 +156,30 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index aec9973..ac1b06f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -8,20 +24,23 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,34 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell From 9281a0aa6e8e1882b5de6031ed379d1a6a669810 Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Sun, 13 Oct 2024 15:30:39 +0800 Subject: [PATCH 2/7] Fix: license --- api/buildcraft/api/core/BuildCraftAPI.java | 4 ++-- api/buildcraft/api/core/IFakePlayerProvider.java | 10 ++++++---- api/buildcraft/api/fuels/ICoolant.java | 4 ++++ api/buildcraft/api/fuels/ICoolantManager.java | 4 ++-- api/buildcraft/api/fuels/IFluidCoolant.java | 4 ++-- api/buildcraft/api/fuels/IFuel.java | 4 ++-- api/buildcraft/api/fuels/IFuelManager.java | 4 ++-- api/buildcraft/api/fuels/ISolidCoolant.java | 4 ++-- 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/api/buildcraft/api/core/BuildCraftAPI.java b/api/buildcraft/api/core/BuildCraftAPI.java index 2f765ea..2c60c7d 100644 --- a/api/buildcraft/api/core/BuildCraftAPI.java +++ b/api/buildcraft/api/core/BuildCraftAPI.java @@ -1,7 +1,7 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents - * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; import com.google.common.collect.Maps; diff --git a/api/buildcraft/api/core/IFakePlayerProvider.java b/api/buildcraft/api/core/IFakePlayerProvider.java index c028d3f..8db25ce 100755 --- a/api/buildcraft/api/core/IFakePlayerProvider.java +++ b/api/buildcraft/api/core/IFakePlayerProvider.java @@ -1,7 +1,9 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents - * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ +/** + * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + *

    + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. + */ package buildcraft.api.core; import com.mojang.authlib.GameProfile; diff --git a/api/buildcraft/api/fuels/ICoolant.java b/api/buildcraft/api/fuels/ICoolant.java index 026fc34..e2a5397 100644 --- a/api/buildcraft/api/fuels/ICoolant.java +++ b/api/buildcraft/api/fuels/ICoolant.java @@ -1,3 +1,7 @@ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + * + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.fuels; import buildcraft.api.BCModules; diff --git a/api/buildcraft/api/fuels/ICoolantManager.java b/api/buildcraft/api/fuels/ICoolantManager.java index f2f952f..c73ff2f 100644 --- a/api/buildcraft/api/fuels/ICoolantManager.java +++ b/api/buildcraft/api/fuels/ICoolantManager.java @@ -1,7 +1,7 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents - * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.fuels; import net.minecraft.fluid.Fluid; diff --git a/api/buildcraft/api/fuels/IFluidCoolant.java b/api/buildcraft/api/fuels/IFluidCoolant.java index b0fee8d..44a83af 100644 --- a/api/buildcraft/api/fuels/IFluidCoolant.java +++ b/api/buildcraft/api/fuels/IFluidCoolant.java @@ -1,7 +1,7 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents - * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.fuels; import net.minecraftforge.fluids.FluidStack; diff --git a/api/buildcraft/api/fuels/IFuel.java b/api/buildcraft/api/fuels/IFuel.java index 9f370e0..60c6583 100644 --- a/api/buildcraft/api/fuels/IFuel.java +++ b/api/buildcraft/api/fuels/IFuel.java @@ -1,7 +1,7 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents - * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.fuels; import buildcraft.api.BCModules; diff --git a/api/buildcraft/api/fuels/IFuelManager.java b/api/buildcraft/api/fuels/IFuelManager.java index abc0b32..0d4fc41 100644 --- a/api/buildcraft/api/fuels/IFuelManager.java +++ b/api/buildcraft/api/fuels/IFuelManager.java @@ -1,7 +1,7 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents - * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.fuels; import net.minecraft.fluid.Fluid; diff --git a/api/buildcraft/api/fuels/ISolidCoolant.java b/api/buildcraft/api/fuels/ISolidCoolant.java index a9c1ff0..22f34cd 100644 --- a/api/buildcraft/api/fuels/ISolidCoolant.java +++ b/api/buildcraft/api/fuels/ISolidCoolant.java @@ -1,7 +1,7 @@ /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents - * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.fuels; import net.minecraft.item.ItemStack; From ee1977da43c7d39676b9845e79e670be76956946 Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Mon, 21 Apr 2025 09:46:58 +0800 Subject: [PATCH 3/7] Robotics! --- .../api/boards/RedstoneBoardNBT.java | 27 +++++-- .../api/boards/RedstoneBoardRegistry.java | 14 +++- .../api/boards/RedstoneBoardRobotNBT.java | 4 + api/buildcraft/api/core/BuildCraftAPI.java | 36 ++++----- api/buildcraft/api/core/IBlockFilter.java | 13 ++++ api/buildcraft/api/core/IEntityFilter.java | 13 ++++ api/buildcraft/api/core/IInvSlot.java | 6 +- api/buildcraft/api/crops/CropManager.java | 14 +++- api/buildcraft/api/crops/ICropHandler.java | 6 +- api/buildcraft/api/gates/IGateProvider.java | 6 ++ api/buildcraft/api/mj/IMjContainerItem.java | 13 ++++ api/buildcraft/api/mj/MjBattery.java | 6 +- .../api/recipes/BuildcraftRecipeRegistry.java | 1 + .../recipes/IIntegrationRecipeProvider.java | 7 +- .../recipes/IIntegrationRecipeRegistry.java | 5 +- .../api/recipes/IProgrammingRecipe.java | 78 +++++++++++++++++++ .../recipes/IProgrammingRecipeManager.java | 29 +++++++ .../api/recipes/IntegrationRecipe.java | 69 +++++++++++++--- .../api/registry/EventBuildCraftReload.java | 10 ++- .../api/robots/EntityRobotBase.java | 12 +-- .../api/robots/IRequestProvider.java | 4 + .../api/robots/IRobotOverlayItem.java | 4 +- api/buildcraft/api/robots/IStationFilter.java | 10 +++ .../api/statements/ActionState.java | 10 +++ .../api/statements/IStatementParameter.java | 6 +- .../api/transport/IStripesRegistry.java | 8 ++ .../api/transport/pipe/IPipeFlowRenderer.java | 2 +- .../transport/pluggable/ActionIterator.java | 69 ++++++++++++++++ build.gradle | 2 +- resources/accesstransformer.cfg | 1 + 30 files changed, 416 insertions(+), 69 deletions(-) create mode 100644 api/buildcraft/api/core/IBlockFilter.java create mode 100644 api/buildcraft/api/core/IEntityFilter.java create mode 100644 api/buildcraft/api/gates/IGateProvider.java create mode 100644 api/buildcraft/api/mj/IMjContainerItem.java create mode 100644 api/buildcraft/api/recipes/IProgrammingRecipe.java create mode 100644 api/buildcraft/api/recipes/IProgrammingRecipeManager.java create mode 100644 api/buildcraft/api/robots/IStationFilter.java create mode 100644 api/buildcraft/api/statements/ActionState.java create mode 100644 api/buildcraft/api/transport/pluggable/ActionIterator.java create mode 100644 resources/accesstransformer.cfg diff --git a/api/buildcraft/api/boards/RedstoneBoardNBT.java b/api/buildcraft/api/boards/RedstoneBoardNBT.java index ea859e7..9796662 100755 --- a/api/buildcraft/api/boards/RedstoneBoardNBT.java +++ b/api/buildcraft/api/boards/RedstoneBoardNBT.java @@ -4,11 +4,15 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.boards; -import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; +import javax.annotation.Nullable; import java.util.List; import java.util.Random; @@ -16,19 +20,26 @@ public abstract class RedstoneBoardNBT { private static Random rand = new Random(); - public abstract String getID(); + public abstract ResourceLocation getID(); - public abstract void addInformation(ItemStack stack, PlayerEntity player, List list, boolean advanced); + // public abstract void addInformation(ItemStack stack, Player player, List list, boolean advanced); + public abstract void addInformation(ItemStack stack, @Nullable World world, List list, ITooltipFlag flag); - public abstract String getDisplayName(); + // public abstract String getDisplayName(); + public final String getDisplayName() { + return getDisplayNameComponent().getString(); + } + + public abstract ITextComponent getDisplayNameComponent(); public abstract IRedstoneBoard create(CompoundNBT nbt, T object); - public abstract String getItemModelLocation(); + // public abstract String getItemModelLocation(); + public abstract String getBoardTexture(); - public void createBoard(CompoundNBT nbt) { - nbt.putString("id", getID()); - } +// public void createBoard(CompoundTag nbt) { +// nbt.putString("id", getID().toString()); +// } public int getParameterNumber(CompoundNBT nbt) { if (!nbt.contains("parameters")) { diff --git a/api/buildcraft/api/boards/RedstoneBoardRegistry.java b/api/buildcraft/api/boards/RedstoneBoardRegistry.java index 769ebba..94d12ee 100755 --- a/api/buildcraft/api/boards/RedstoneBoardRegistry.java +++ b/api/buildcraft/api/boards/RedstoneBoardRegistry.java @@ -4,9 +4,13 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.boards; +import net.minecraft.item.Item; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.RegistryObject; -import java.util.Collection; +import java.util.List; +import java.util.Map; public abstract class RedstoneBoardRegistry { @@ -24,9 +28,13 @@ public abstract class RedstoneBoardRegistry { public abstract RedstoneBoardNBT getRedstoneBoard(CompoundNBT nbt); - public abstract RedstoneBoardNBT getRedstoneBoard(String id); + // public abstract RedstoneBoardNBT getRedstoneBoard(String id); + public abstract RedstoneBoardNBT getRedstoneBoard(ResourceLocation id); - public abstract Collection> getAllBoardNBTs(); + // public abstract Collection> getAllBoardNBTs(); + public abstract List> getAllBoardNBTs(); + + public abstract Map, RegistryObject> getBoardNBTItemMap(); public abstract long getPowerCost(RedstoneBoardNBT board); } diff --git a/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java b/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java index ecd3d2e..6dcf59c 100755 --- a/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java +++ b/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java @@ -19,4 +19,8 @@ public RedstoneBoardRobot create(CompoundNBT nbt, EntityRobotBase robot) { public abstract ResourceLocation getRobotTexture(); + // Calen 1.18.2 + public abstract ResourceLocation getRobotTextureFullLocation(); + + public abstract ResourceLocation getRobotId(); } diff --git a/api/buildcraft/api/core/BuildCraftAPI.java b/api/buildcraft/api/core/BuildCraftAPI.java index 2c60c7d..c75ec23 100644 --- a/api/buildcraft/api/core/BuildCraftAPI.java +++ b/api/buildcraft/api/core/BuildCraftAPI.java @@ -4,24 +4,16 @@ * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; -import net.minecraft.block.Block; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; import net.minecraftforge.fml.ModContainer; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.ModLoadingContext; -import java.util.HashMap; -import java.util.Set; - public final class BuildCraftAPI { public static IFakePlayerProvider fakePlayerProvider; - public static final Set softBlocks = Sets.newHashSet(); - public static final HashMap worldProperties = Maps.newHashMap(); + // public static final Set softBlocks = Sets.newHashSet(); + // public static final HashMap worldProperties = Maps.newHashMap(); /** Deactivate constructor */ private BuildCraftAPI() { @@ -35,20 +27,20 @@ public static String getVersion() { return "UNKNOWN VERSION"; } - public static IWorldProperty getWorldProperty(String name) { - return worldProperties.get(name); - } +// public static IWorldProperty getWorldProperty(String name) { +// return worldProperties.get(name); +// } - public static void registerWorldProperty(String name, IWorldProperty property) { - if (worldProperties.containsKey(name)) { - BCLog.logger.warn("The WorldProperty key '" + name + "' is being overridden with " + property.getClass().getSimpleName() + "!"); - } - worldProperties.put(name, property); - } +// public static void registerWorldProperty(String name, IWorldProperty property) { +// if (worldProperties.containsKey(name)) { +// BCLog.logger.warn("The WorldProperty key '" + name + "' is being overridden with " + property.getClass().getSimpleName() + "!"); +// } +// worldProperties.put(name, property); +// } - public static boolean isSoftBlock(World world, BlockPos pos) { - return worldProperties.get("soft").get(world, pos); - } +// public static boolean isSoftBlock(World world, BlockPos pos) { +// return worldProperties.get("soft").get(world, pos); +// } public static ResourceLocation nameToResourceLocation(String name) { if (name.indexOf(':') > 0) return new ResourceLocation(name); diff --git a/api/buildcraft/api/core/IBlockFilter.java b/api/buildcraft/api/core/IBlockFilter.java new file mode 100644 index 0000000..2f3eb58 --- /dev/null +++ b/api/buildcraft/api/core/IBlockFilter.java @@ -0,0 +1,13 @@ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + *

    + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ +package buildcraft.api.core; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +// Calen 1.18.2 from 1.8.9 +public interface IBlockFilter { + boolean matches(World world, BlockPos pos); +} diff --git a/api/buildcraft/api/core/IEntityFilter.java b/api/buildcraft/api/core/IEntityFilter.java new file mode 100644 index 0000000..ffd0445 --- /dev/null +++ b/api/buildcraft/api/core/IEntityFilter.java @@ -0,0 +1,13 @@ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + *

    + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ +package buildcraft.api.core; + +import net.minecraft.entity.Entity; + +public interface IEntityFilter { + + boolean matches(Entity entity); + +} diff --git a/api/buildcraft/api/core/IInvSlot.java b/api/buildcraft/api/core/IInvSlot.java index a047a2f..613aef3 100644 --- a/api/buildcraft/api/core/IInvSlot.java +++ b/api/buildcraft/api/core/IInvSlot.java @@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + public interface IInvSlot { /** Returns the slot number of the underlying Inventory. * @@ -18,9 +20,11 @@ public interface IInvSlot { boolean isItemValidForSlot(ItemStack stack); + @Nonnull ItemStack decreaseStackInSlot(int amount); + @Nonnull ItemStack getStackInSlot(); - void setStackInSlot(ItemStack stack); + void setStackInSlot(@Nonnull ItemStack stack); } diff --git a/api/buildcraft/api/crops/CropManager.java b/api/buildcraft/api/crops/CropManager.java index 6cc470b..2c10b1f 100644 --- a/api/buildcraft/api/crops/CropManager.java +++ b/api/buildcraft/api/crops/CropManager.java @@ -12,6 +12,12 @@ import java.util.List; public final class CropManager { + public enum HarvestResult { + SUCCESS, + FAIL, + PROGRESS; + } + private static List handlers = new ArrayList<>(); private static ICropHandler defaultHandler; @@ -73,13 +79,15 @@ public static boolean isMature(IWorld blockAccess, BlockState state, BlockPos po return defaultHandler.isMature(blockAccess, state, pos); } - public static boolean harvestCrop(World world, BlockPos pos, NonNullList drops) { + // public static boolean harvestCrop(World world, BlockPos pos, NonNullList drops) + public static HarvestResult harvestCrop(World world, BlockPos pos, ItemStack tool, NonNullList drops) { BlockState state = world.getBlockState(pos); for (ICropHandler cropHandler : handlers) { if (cropHandler.isMature(world, state, pos)) { - return cropHandler.harvestCrop(world, pos, drops); + return cropHandler.harvestCrop(world, pos, tool, drops); } } - return defaultHandler.isMature(world, state, pos) && defaultHandler.harvestCrop(world, pos, drops); + // return defaultHandler.isMature(world, state, pos) && defaultHandler.harvestCrop(world, pos, drops); + return defaultHandler.isMature(world, state, pos) ? defaultHandler.harvestCrop(world, pos, tool, drops) : HarvestResult.FAIL; } } diff --git a/api/buildcraft/api/crops/ICropHandler.java b/api/buildcraft/api/crops/ICropHandler.java index 07d155e..6fe46e9 100644 --- a/api/buildcraft/api/crops/ICropHandler.java +++ b/api/buildcraft/api/crops/ICropHandler.java @@ -8,6 +8,8 @@ import net.minecraft.world.IWorld; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public interface ICropHandler { /** Check if an item is a seed. @@ -46,8 +48,10 @@ public interface ICropHandler { * * @param world * @param pos + * @param tool * @param drops a list to return the harvest's drops. * @return true if the block was successfully harvested. */ - boolean harvestCrop(World world, BlockPos pos, NonNullList drops); + // boolean harvestCrop(World world, BlockPos pos, NonNullList drops); + CropManager.HarvestResult harvestCrop(World world, BlockPos pos, @Nonnull ItemStack tool, NonNullList drops); } diff --git a/api/buildcraft/api/gates/IGateProvider.java b/api/buildcraft/api/gates/IGateProvider.java new file mode 100644 index 0000000..6e8f3bd --- /dev/null +++ b/api/buildcraft/api/gates/IGateProvider.java @@ -0,0 +1,6 @@ +package buildcraft.api.gates; + +// Calen 1.18.2 +public interface IGateProvider { + IGate getGate(); +} diff --git a/api/buildcraft/api/mj/IMjContainerItem.java b/api/buildcraft/api/mj/IMjContainerItem.java new file mode 100644 index 0000000..1ad84b9 --- /dev/null +++ b/api/buildcraft/api/mj/IMjContainerItem.java @@ -0,0 +1,13 @@ +package buildcraft.api.mj; + +import net.minecraft.item.ItemStack; + +public interface IMjContainerItem { + long receivePower(ItemStack container, long maxReceive, boolean simulate); + + long extractPower(ItemStack container, long maxExtract, boolean simulate); + + long getPowerStored(ItemStack container); + + long getMaxPowerStored(ItemStack container); +} diff --git a/api/buildcraft/api/mj/MjBattery.java b/api/buildcraft/api/mj/MjBattery.java index 18bb878..9751ef1 100644 --- a/api/buildcraft/api/mj/MjBattery.java +++ b/api/buildcraft/api/mj/MjBattery.java @@ -10,6 +10,8 @@ /** Provides a basic implementation of a simple battery. Note that you should call {@link #tick(World, BlockPos)} or * {@link #tick(World, Vector3d)} every tick to allow for losing excess power. */ public class MjBattery implements INBTSerializable { + public static final String NBT_STORED = "stored"; + private final long capacity; private long microJoules = 0; @@ -20,13 +22,13 @@ public MjBattery(long capacity) { @Override public CompoundNBT serializeNBT() { CompoundNBT nbt = new CompoundNBT(); - nbt.putLong("stored", microJoules); + nbt.putLong(NBT_STORED, microJoules); return nbt; } @Override public void deserializeNBT(CompoundNBT nbt) { - microJoules = nbt.getLong("stored"); + microJoules = nbt.getLong(NBT_STORED); } public void writeToBuffer(ByteBuf buffer) { diff --git a/api/buildcraft/api/recipes/BuildcraftRecipeRegistry.java b/api/buildcraft/api/recipes/BuildcraftRecipeRegistry.java index 6174520..6e6218f 100644 --- a/api/buildcraft/api/recipes/BuildcraftRecipeRegistry.java +++ b/api/buildcraft/api/recipes/BuildcraftRecipeRegistry.java @@ -8,6 +8,7 @@ public final class BuildcraftRecipeRegistry { public static IIntegrationRecipeRegistry integrationRecipes; public static IRefineryRecipeManager refineryRecipes; + public static IProgrammingRecipeManager programmingRecipes; private BuildcraftRecipeRegistry() { } diff --git a/api/buildcraft/api/recipes/IIntegrationRecipeProvider.java b/api/buildcraft/api/recipes/IIntegrationRecipeProvider.java index b24d0ae..68d4308 100644 --- a/api/buildcraft/api/recipes/IIntegrationRecipeProvider.java +++ b/api/buildcraft/api/recipes/IIntegrationRecipeProvider.java @@ -3,6 +3,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -17,10 +18,12 @@ public interface IIntegrationRecipeProvider { * @param toIntegrate A list of stacks to try to integrate to the * @return */ @Nullable - IntegrationRecipe getRecipeFor(@Nonnull ItemStack target, @Nonnull NonNullList toIntegrate); + // IntegrationRecipe getRecipeFor(@Nonnull ItemStack target, @Nonnull NonNullList toIntegrate); + IntegrationRecipe getRecipeFor(@Nonnull ItemStack target, @Nonnull NonNullList toIntegrate, World world); /** * Returns recipe by it's name */ - IntegrationRecipe getRecipe(@Nonnull ResourceLocation name); + // IntegrationRecipe getRecipe(@Nonnull ResourceLocation name); + IntegrationRecipe getRecipe(@Nonnull ResourceLocation name, World world); } diff --git a/api/buildcraft/api/recipes/IIntegrationRecipeRegistry.java b/api/buildcraft/api/recipes/IIntegrationRecipeRegistry.java index d4bd8ee..7e18c5d 100644 --- a/api/buildcraft/api/recipes/IIntegrationRecipeRegistry.java +++ b/api/buildcraft/api/recipes/IIntegrationRecipeRegistry.java @@ -1,5 +1,7 @@ package buildcraft.api.recipes; +import net.minecraft.world.World; + import java.util.Iterator; public interface IIntegrationRecipeRegistry extends IIntegrationRecipeProvider { @@ -9,6 +11,7 @@ public interface IIntegrationRecipeRegistry extends IIntegrationRecipeProvider { * Gets all of the simple recipes that are registered. Note that you *can* use the returned iterator's * {@link Iterator#remove()} method to remove recipes from this registry. */ - Iterable getAllRecipes(); + // Iterable getAllRecipes(); + Iterable getAllRecipes(World world); } diff --git a/api/buildcraft/api/recipes/IProgrammingRecipe.java b/api/buildcraft/api/recipes/IProgrammingRecipe.java new file mode 100644 index 0000000..e6e73ef --- /dev/null +++ b/api/buildcraft/api/recipes/IProgrammingRecipe.java @@ -0,0 +1,78 @@ +package buildcraft.api.recipes; + +import buildcraft.api.BCModules; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +// public interface IProgrammingRecipe +public interface IProgrammingRecipe extends IRecipe { + public static final ResourceLocation TYPE_ID = new ResourceLocation(BCModules.SILICON.getModId(), "programming"); + + public static final IRecipeType TYPE = IRecipeType.register(TYPE_ID.toString()); + + @Override + default IRecipeType getType() { + return TYPE; + } + + ResourceLocation getId(); + +// /** Get a list (size at least width*height) of ItemStacks representing options. +// * +// * @param width The width of the Programming Table panel. +// * @param height The height of the Programming Table panel. +// * @return */ +// List getOptions(int width, int height); + + /** Get the energy cost of a given option ItemStack. + * + * @return */ + // int getEnergyCost(ItemStack option); + long getEnergyCost(); + + /** @param input The input stack. + * @return Whether this recipe applies to the given input stack. */ + boolean canCraft(ItemStack input); + + /** Craft the input ItemStack with the given option into an output ItemStack. + * + * @param input + * @return The output ItemStack. */ + // ItemStack craft(ItemStack input, ItemStack option); + ItemStack craft(ItemStack input); + + IngredientStack getInput(); + + ItemStack getOutput(); + + // Recipe + + @Override + public default boolean matches(IInventory inv, World world) { + return false; + } + + @Override + default ItemStack assemble(IInventory inv) { + return ItemStack.EMPTY; + } + + @Override + public default boolean canCraftInDimensions(int width, int height) { + return true; + } + + @Override + default ItemStack getResultItem() { + return ItemStack.EMPTY; + } + + @Override + public default boolean isSpecial() { + return true; + } +} diff --git a/api/buildcraft/api/recipes/IProgrammingRecipeManager.java b/api/buildcraft/api/recipes/IProgrammingRecipeManager.java new file mode 100644 index 0000000..4b926ff --- /dev/null +++ b/api/buildcraft/api/recipes/IProgrammingRecipeManager.java @@ -0,0 +1,29 @@ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + * + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ +package buildcraft.api.recipes; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import java.util.Collection; +import java.util.List; + +public interface IProgrammingRecipeManager { + void addRecipe(IProgrammingRecipe recipe); + + // void removeRecipe(String id); + void removeRecipe(ResourceLocation id); + + void removeRecipe(IProgrammingRecipe recipe); + + // IProgrammingRecipe getRecipe(String id); + IProgrammingRecipe getRecipe(World world, ResourceLocation id); + + // Collection getRecipes(); + Collection getRecipes(World world); + + // Calen 1.18.2 + List getOptions(List recipes, int width, int height); +} diff --git a/api/buildcraft/api/recipes/IntegrationRecipe.java b/api/buildcraft/api/recipes/IntegrationRecipe.java index 5d175c6..6fb79f8 100644 --- a/api/buildcraft/api/recipes/IntegrationRecipe.java +++ b/api/buildcraft/api/recipes/IntegrationRecipe.java @@ -1,17 +1,31 @@ package buildcraft.api.recipes; +import buildcraft.api.BCModules; import com.google.common.collect.ImmutableList; +import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeType; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import javax.annotation.Nonnull; -public abstract class IntegrationRecipe { +public abstract class IntegrationRecipe implements IRecipe { + public static final ResourceLocation TYPE_ID = new ResourceLocation(BCModules.SILICON.getModId(), "integration"); + + public static final IRecipeType TYPE = IRecipeType.register(TYPE_ID.toString()); + public final ResourceLocation name; - public IntegrationRecipe(ResourceLocation name) { + private final long energyCost; + private final int maxExpansionCount; + + public IntegrationRecipe(ResourceLocation name, long energyCost, int maxExpansionCount) { this.name = name; + this.energyCost = energyCost; + this.maxExpansionCount = maxExpansionCount; } /** @@ -22,27 +36,30 @@ public IntegrationRecipe(ResourceLocation name) { */ public abstract ItemStack getOutput(@Nonnull ItemStack target, NonNullList toIntegrate); + // Calen 1.18.2 + public abstract ItemStack getExampleOutput(); + /** * Determines the components to use when crafting finishes - * @param output The generated outputted, determined by getOutput * @return The components to use up */ - public abstract ImmutableList getRequirements(@Nonnull ItemStack output); - - // Calen + // public abstract ImmutableList getRequirements(@Nonnull ItemStack output); public abstract ImmutableList getRequirements(); /** * Determines the amount of MJ required to integrate - * @param output The output that would be generated * @return The powercost in microjoules */ - public abstract long getRequiredMicroJoules(ItemStack output); + // public abstract long getRequiredMicroJoules(ItemStack output); + public final long getRequiredMicroJoules() { + return energyCost; + } public abstract IngredientStack getCenterStack(); - // Calen - public abstract ItemStack getOutput(); + public int getMaxExpansionCount() { + return maxExpansionCount; + } @Override public boolean equals(Object o) { @@ -62,4 +79,36 @@ public boolean equals(Object o) { public int hashCode() { return name.hashCode(); } + + // Recipe + + @Override + public boolean matches(IInventory inv, World world) { + return false; + } + + @Override + public ItemStack assemble(IInventory inv) { + return ItemStack.EMPTY; + } + + @Override + public boolean canCraftInDimensions(int width, int height) { + return true; + } + + @Override + public ItemStack getResultItem() { + return ItemStack.EMPTY; + } + + @Override + public boolean isSpecial() { + return true; + } + + @Override + public IRecipeType getType() { + return TYPE; + } } diff --git a/api/buildcraft/api/registry/EventBuildCraftReload.java b/api/buildcraft/api/registry/EventBuildCraftReload.java index 2c46636..2cd6ad4 100644 --- a/api/buildcraft/api/registry/EventBuildCraftReload.java +++ b/api/buildcraft/api/registry/EventBuildCraftReload.java @@ -5,11 +5,13 @@ import net.minecraft.item.crafting.Ingredient; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.event.lifecycle.IModBusEvent; import javax.annotation.Nullable; import java.util.Set; -public abstract class EventBuildCraftReload extends Event { +// public abstract class EventBuildCraftReload extends Event +public abstract class EventBuildCraftReload extends Event implements IModBusEvent { /** The manager that is being reloaded. */ public final IReloadableRegistryManager manager; @@ -26,7 +28,7 @@ public EventBuildCraftReload(IReloadableRegistryManager manager, Set> reloadingRegistries) { + @Nullable Set> reloadingRegistries) { super(manager, reloadingRegistries); } } @@ -47,7 +49,7 @@ public static class PopulateGson extends EventBuildCraftReload { public final GsonBuilder gsonBuilder; public PopulateGson(IReloadableRegistryManager manager, - @Nullable Set> reloadingRegistries, GsonBuilder gsonBuilder) { + @Nullable Set> reloadingRegistries, GsonBuilder gsonBuilder) { super(manager, reloadingRegistries); this.gsonBuilder = gsonBuilder; } @@ -65,7 +67,7 @@ public PostLoad(IReloadableRegistryManager manager, @Nullable Set> reloadingRegistries) { + @Nullable Set> reloadingRegistries) { super(manager, reloadingRegistries); } } diff --git a/api/buildcraft/api/robots/EntityRobotBase.java b/api/buildcraft/api/robots/EntityRobotBase.java index a3894a5..47d12ac 100755 --- a/api/buildcraft/api/robots/EntityRobotBase.java +++ b/api/buildcraft/api/robots/EntityRobotBase.java @@ -5,7 +5,6 @@ package buildcraft.api.robots; import buildcraft.api.boards.RedstoneBoardRobot; -import buildcraft.api.core.IFluidHandlerAdv; import buildcraft.api.core.IZone; import buildcraft.api.mj.MjAPI; import buildcraft.api.mj.MjBattery; @@ -16,20 +15,21 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.items.IItemHandler; -public abstract class EntityRobotBase extends LivingEntity implements IItemHandler, IFluidHandlerAdv { +import javax.annotation.Nonnull; + +public abstract class EntityRobotBase extends LivingEntity { public static final long MAX_POWER = 5000 * MjAPI.MJ; public static final long SAFETY_POWER = MAX_POWER / 5; public static final long SHUTDOWN_POWER = 0; public static final long NULL_ROBOT_ID = Long.MAX_VALUE; - public EntityRobotBase(EntityType entityType, World par1World) { - super(entityType, par1World); + public EntityRobotBase(EntityType entityType, World world) { + super(entityType, world); } - public abstract void setItemInUse(ItemStack stack); + public abstract void setItemInUse(@Nonnull ItemStack stack); public abstract void setItemActive(boolean b); diff --git a/api/buildcraft/api/robots/IRequestProvider.java b/api/buildcraft/api/robots/IRequestProvider.java index 2e56148..3567e1e 100755 --- a/api/buildcraft/api/robots/IRequestProvider.java +++ b/api/buildcraft/api/robots/IRequestProvider.java @@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + /** Provide requests of items that need to be fulfilled. * * Requests are organized as an linear array, where null entries mark slots without a requests. A request in a slot, or @@ -21,6 +23,7 @@ public interface IRequestProvider { * * @param slot * @return the request in the slot, or null if there's no request. */ + @Nonnull ItemStack getRequest(int slot); /** Fulfill the request in slot with the stack given and return any excess. @@ -28,5 +31,6 @@ public interface IRequestProvider { * @param slot * @param stack * @return any excess that was not used to fulfill the request. */ + @Nonnull ItemStack offerItem(int slot, ItemStack stack); } diff --git a/api/buildcraft/api/robots/IRobotOverlayItem.java b/api/buildcraft/api/robots/IRobotOverlayItem.java index 25cb2cf..853d118 100644 --- a/api/buildcraft/api/robots/IRobotOverlayItem.java +++ b/api/buildcraft/api/robots/IRobotOverlayItem.java @@ -1,6 +1,5 @@ package buildcraft.api.robots; -import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -9,5 +8,6 @@ public interface IRobotOverlayItem { boolean isValidRobotOverlay(ItemStack stack); @OnlyIn(Dist.CLIENT) - void renderRobotOverlay(ItemStack stack, TextureManager textureManager); + // void renderRobotOverlay(ItemStack stack, TextureManager textureManager); + void renderRobotOverlay(ItemStack stack); } diff --git a/api/buildcraft/api/robots/IStationFilter.java b/api/buildcraft/api/robots/IStationFilter.java new file mode 100644 index 0000000..809c08d --- /dev/null +++ b/api/buildcraft/api/robots/IStationFilter.java @@ -0,0 +1,10 @@ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + *

    + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ +package buildcraft.api.robots; + +public interface IStationFilter { + + boolean matches(DockingStation station); +} diff --git a/api/buildcraft/api/statements/ActionState.java b/api/buildcraft/api/statements/ActionState.java new file mode 100644 index 0000000..b4c364c --- /dev/null +++ b/api/buildcraft/api/statements/ActionState.java @@ -0,0 +1,10 @@ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + * + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ +package buildcraft.api.statements; + +// Calen 1.18.2: from 1.8.9 +public class ActionState { + +} diff --git a/api/buildcraft/api/statements/IStatementParameter.java b/api/buildcraft/api/statements/IStatementParameter.java index 9224d08..d2f9495 100755 --- a/api/buildcraft/api/statements/IStatementParameter.java +++ b/api/buildcraft/api/statements/IStatementParameter.java @@ -27,8 +27,10 @@ default DrawType getDrawType() { * possible values to be shown, or null if you did nothing and wish to show all possible values. * * @see #getPossible(IStatementContainer) */ - IStatementParameter onClick(IStatementContainer source, IStatement stmt, ItemStack stack, - StatementMouseClick mouse); + IStatementParameter onClick(IStatementContainer source, IStatement stmt, @Nonnull ItemStack stack, StatementMouseClick mouse); + + // Calen 1.18.2 + default IStatementParameter onScroll(IStatementContainer source, IStatement stmt, @Nonnull ItemStack stack, double delta) {return this;} void writeToNbt(CompoundNBT nbt); diff --git a/api/buildcraft/api/transport/IStripesRegistry.java b/api/buildcraft/api/transport/IStripesRegistry.java index b452a43..35fee3e 100644 --- a/api/buildcraft/api/transport/IStripesRegistry.java +++ b/api/buildcraft/api/transport/IStripesRegistry.java @@ -7,6 +7,9 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import java.util.EnumMap; +import java.util.List; + public interface IStripesRegistry { /** Adds a handler with a {@link EnumHandlerPriority} of {@linkplain EnumHandlerPriority#NORMAL} */ default void addHandler(IStripesHandlerItem handler) { @@ -37,4 +40,9 @@ boolean handleBlock(World world, Direction direction, PlayerEntity player, IStripesActivator activator); + + // Calen 1.18.2 + public EnumMap> getItemHandlers(); + + public EnumMap> getBlockHandlers(); } diff --git a/api/buildcraft/api/transport/pipe/IPipeFlowRenderer.java b/api/buildcraft/api/transport/pipe/IPipeFlowRenderer.java index 23d9ffc..278861c 100644 --- a/api/buildcraft/api/transport/pipe/IPipeFlowRenderer.java +++ b/api/buildcraft/api/transport/pipe/IPipeFlowRenderer.java @@ -5,7 +5,7 @@ public interface IPipeFlowRenderer { /** @param flow The flow to render - * @param bufferBuilder The (optional) vertex buffer that you can render into. Note that you can still do GL stuff. */ + * @param bufferSource The buffer source of (optional) vertex buffer that you can render into. Note that you can still do GL stuff. */ // void render(F flow, double x, double y, double z, float partialTicks, BufferBuilder bufferBuilder); void render(F flow, float partialTicks, MatrixStack poseStack, IVertexBuilder bufferBuilder, int combinedLight, int combinedOverlay); } diff --git a/api/buildcraft/api/transport/pluggable/ActionIterator.java b/api/buildcraft/api/transport/pluggable/ActionIterator.java new file mode 100644 index 0000000..a85ac6e --- /dev/null +++ b/api/buildcraft/api/transport/pluggable/ActionIterator.java @@ -0,0 +1,69 @@ +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com + *

    + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ +package buildcraft.api.transport.pluggable; + +import buildcraft.api.gates.IGateProvider; +import buildcraft.api.statements.StatementSlot; +import buildcraft.api.transport.pipe.IPipe; +import net.minecraft.util.Direction; + +import java.util.Iterator; +import java.util.List; + +public class ActionIterator implements Iterable { + private final IPipe pipe; + + public ActionIterator(IPipe iPipe) { + pipe = iPipe; + } + + @Override + public Iterator iterator() { + return new It(); + } + + private class It implements Iterator { + + private Direction curDir = Direction.values()[0]; + private int index = 0; + + @Override + public boolean hasNext() { + return getNext(false) != null; + } + + @Override + public StatementSlot next() { + return getNext(true); + } + + private StatementSlot getNext(boolean advance) { + Direction curDir = this.curDir; + int index = this.index; + while (true) { + // List lst = pipe.hasGate(curDir) ? pipe.getGate(curDir).getActiveActions() : null; + List lst = pipe.getHolder().getPluggable(curDir) instanceof IGateProvider ? ((IGateProvider) pipe.getHolder().getPluggable(curDir)).getGate().getActiveActions() : null; + if (lst == null || index >= lst.size()) { + if (curDir.ordinal() == 5) { + return null; + } + curDir = Direction.values()[curDir.ordinal() + 1]; + } else { + index++; + if (advance) { + this.curDir = curDir; + this.index = index; + } + return lst.get(index - 1); + } + } + } + + @Override + public void remove() { + throw new UnsupportedOperationException("Remove not supported."); + } + } +} diff --git a/build.gradle b/build.gradle index 716d404..e9716a2 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ minecraft { mappings channel: config.mappings_channel, version: config.mappings_version // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. - accessTransformer = file('buildcraft_resources/META-INF/accesstransformer.cfg') + accessTransformer = file('resources/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. diff --git a/resources/accesstransformer.cfg b/resources/accesstransformer.cfg new file mode 100644 index 0000000..6568ea1 --- /dev/null +++ b/resources/accesstransformer.cfg @@ -0,0 +1 @@ +public net.minecraft.util.Direction field_176754_o # BY_2D_DATA From 061e77ead18adda47598ea45b70e6635b49b8b61 Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Thu, 24 Apr 2025 12:33:13 +0800 Subject: [PATCH 4/7] Update from latest commits of 1.12.2: Engine Pipe RF --- api/buildcraft/api/enums/EnumEngineType.java | 1 + api/buildcraft/api/mj/IMjToRfStatus.java | 43 ++++ api/buildcraft/api/mj/MjAPI.java | 8 + api/buildcraft/api/mj/MjCapabilityHelper.java | 119 +++++++++++ api/buildcraft/api/mj/MjRfConversion.java | 46 +++++ .../api/mj/MjToRfAutoConvertor.java | 192 ++++++++++++++++++ .../api/transport/pipe/IFlowPower.java | 3 +- .../api/transport/pipe/IFlowPowerLike.java | 6 + .../api/transport/pipe/IFlowRedstoneFlux.java | 18 ++ .../api/transport/pipe/PipeApi.java | 25 +++ .../api/transport/pipe/PipeEventPower.java | 9 + .../transport/pipe/PipeEventRedstoneFlux.java | 69 +++++++ .../api/transport/pipe/PipeFlow.java | 8 +- 13 files changed, 542 insertions(+), 5 deletions(-) create mode 100644 api/buildcraft/api/mj/IMjToRfStatus.java create mode 100644 api/buildcraft/api/mj/MjRfConversion.java create mode 100644 api/buildcraft/api/mj/MjToRfAutoConvertor.java create mode 100644 api/buildcraft/api/transport/pipe/IFlowPowerLike.java create mode 100644 api/buildcraft/api/transport/pipe/IFlowRedstoneFlux.java create mode 100644 api/buildcraft/api/transport/pipe/PipeEventRedstoneFlux.java diff --git a/api/buildcraft/api/enums/EnumEngineType.java b/api/buildcraft/api/enums/EnumEngineType.java index 80ae246..6705978 100644 --- a/api/buildcraft/api/enums/EnumEngineType.java +++ b/api/buildcraft/api/enums/EnumEngineType.java @@ -9,6 +9,7 @@ public enum EnumEngineType implements IStringSerializable, IEngineType { IRON("energy", "iron"), // CREATIVE("energy", "creative"), CREATIVE("core", "creative"), + RF("energy", "rf"), ; public final String unlocalizedTag; diff --git a/api/buildcraft/api/mj/IMjToRfStatus.java b/api/buildcraft/api/mj/IMjToRfStatus.java new file mode 100644 index 0000000..525bf2c --- /dev/null +++ b/api/buildcraft/api/mj/IMjToRfStatus.java @@ -0,0 +1,43 @@ +package buildcraft.api.mj; + +import buildcraft.api.BCModules; + +public interface IMjToRfStatus { + + public static IMjToRfStatus get() { + return MjToRfStatusHolder.STATUS; + } + + MjRfConversion getConversion(); + + boolean isAutoconvertEnabled(); +} + +final class MjToRfStatusHolder implements IMjToRfStatus { + + static final IMjToRfStatus STATUS = get0(); + + private static IMjToRfStatus get0() { + if (BCModules.LIB.isLoaded()) { + try { + return (IMjToRfStatus) Class.forName("buildcraft.lib.BCLibConfig$MjToRfStatus").newInstance(); + } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + throw new Error(e); + } + } else { + return new MjToRfStatusHolder(); + } + } + + private final MjRfConversion defaultConversion = MjRfConversion.createDefault(); + + @Override + public MjRfConversion getConversion() { + return defaultConversion; + } + + @Override + public boolean isAutoconvertEnabled() { + return false; + } +} diff --git a/api/buildcraft/api/mj/MjAPI.java b/api/buildcraft/api/mj/MjAPI.java index c1344d8..930e392 100644 --- a/api/buildcraft/api/mj/MjAPI.java +++ b/api/buildcraft/api/mj/MjAPI.java @@ -42,6 +42,14 @@ private static String formatMjInternal(double val) { return MJ_DISPLAY_FORMAT.format(val); } + public static MjRfConversion getRfConversion() { + return IMjToRfStatus.get().getConversion(); + } + + public static boolean isRfAutoConversionEnabled() { + return IMjToRfStatus.get().isAutoconvertEnabled(); + } + // ######################################## // // Null based classes diff --git a/api/buildcraft/api/mj/MjCapabilityHelper.java b/api/buildcraft/api/mj/MjCapabilityHelper.java index 1ebb320..94ae110 100644 --- a/api/buildcraft/api/mj/MjCapabilityHelper.java +++ b/api/buildcraft/api/mj/MjCapabilityHelper.java @@ -4,6 +4,8 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.energy.CapabilityEnergy; +import net.minecraftforge.energy.IEnergyStorage; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -26,12 +28,126 @@ public class MjCapabilityHelper implements ICapabilityProvider { @Nullable private final IMjPassiveProvider provider; + @Nullable + private final IEnergyStorage rfAutoConvert; + public MjCapabilityHelper(@Nonnull IMjConnector mj) { this.connector = mj; this.receiver = mj instanceof IMjReceiver ? (IMjReceiver) mj : null; this.rsReceiver = mj instanceof IMjRedstoneReceiver ? (IMjRedstoneReceiver) mj : null; this.readable = mj instanceof IMjReadable ? (IMjReadable) mj : null; this.provider = mj instanceof IMjPassiveProvider ? (IMjPassiveProvider) mj : null; + + if (MjAPI.isRfAutoConversionEnabled()) { + rfAutoConvert = new IEnergyStorage() { + + @Override + public int getEnergyStored() { + IMjReadable read = readable; + if (read != null) { + long mjPerRf = MjAPI.getRfConversion().mjPerRf; + return (int) (read.getStored() / mjPerRf); + } else { + return 0; + } + } + + @Override + public int getMaxEnergyStored() { + IMjReadable read = readable; + if (read != null) { + long mjPerRf = MjAPI.getRfConversion().mjPerRf; + return (int) (read.getCapacity() / mjPerRf); + } else { + return 0; + } + } + + @Override + public boolean canReceive() { + return receiver != null && receiver.canReceive(); + } + + /** @return Amount of energy that was (or would have been, if simulated) accepted by the storage. */ + @Override + public int receiveEnergy(int maxReceive, boolean simulate) { + + if (maxReceive <= 0) { + return 0; + } + + IMjReceiver recv = receiver; + if (recv == null || !recv.canReceive()) { + return 0; + } + + long mjPerRf = MjAPI.getRfConversion().mjPerRf; + long maxReceiveMj = maxReceive * mjPerRf; + long excess = recv.receivePower(maxReceiveMj, true); + + // Actual MJ that was accepted + long acceptedMj = maxReceiveMj - excess; + + if (acceptedMj < mjPerRf) { + return 0; + } + + // MJ that was accepted but cannot be converted back to RF + // (We need to actual accepted MJ to be some integer multiple of mjPerRf) + long excessMj = acceptedMj % mjPerRf; + // An MJ value that is an integer multiple of mjPerRf + long exactAcceptableMj = maxReceiveMj - excessMj; + + if (exactAcceptableMj <= 0) { + return 0; + } + + int rf = (int) (exactAcceptableMj / mjPerRf); + if (rf * mjPerRf != exactAcceptableMj) { + // Sanity check + throw new IllegalStateException( + "Programmer made a mistake?? mjPerRf=" + mjPerRf + ", rf=" + rf + ", exactAcceptableMJ=" + + exactAcceptableMj + ); + } + + long excess2 = recv.receivePower(exactAcceptableMj, true); + + if (excess2 != 0) { + // Odd. This means we can't actually accept the exact amount + // not actually a crash + return 0; + } + + if (!simulate) { + long excess3 = recv.receivePower(exactAcceptableMj, simulate); + + if (excess3 != excess2) { + throw new IllegalStateException("Bad impl: " + recv.getClass() + " of receivePower"); + } + } + + return rf; + } + + @Override + public boolean canExtract() { + return provider != null; + } + + /** @return Amount of energy that was (or would have been, if simulated) extracted from the storage. */ + @Override + public int extractEnergy(int maxExtract, boolean simulate) { + long mjPerRf = MjAPI.getRfConversion().mjPerRf; + // TODO! + // (Nothing in buildcraft supports this at the moment) + return 0; + } + + }; + } else { + rfAutoConvert = null; + } } // @Override @@ -61,6 +177,9 @@ public LazyOptional getCapability(@Nonnull Capability capability, Dire // return MjAPI.CAP_PASSIVE_PROVIDER.cast(provider); return provider == null ? LazyOptional.empty() : LazyOptional.of(() -> provider).cast(); } + if (capability == CapabilityEnergy.ENERGY) { + return provider == null ? LazyOptional.empty() : LazyOptional.of(() -> rfAutoConvert).cast(); + } return LazyOptional.empty(); } } diff --git a/api/buildcraft/api/mj/MjRfConversion.java b/api/buildcraft/api/mj/MjRfConversion.java new file mode 100644 index 0000000..8f922b9 --- /dev/null +++ b/api/buildcraft/api/mj/MjRfConversion.java @@ -0,0 +1,46 @@ +package buildcraft.api.mj; + +public class MjRfConversion { + + /** Maximum MJ per RF, or minimum of 5 RF to make 1 MJ. */ + public static final long MAX_MJ_PER_RF = MjAPI.MJ / 5; + + /** Minimum MJ per RF, or maximum of 10,000 RF to make 1 MJ */ + public static final long MIN_MJ_PER_RF = MjAPI.MJ / 10_000; + + /** Default MJ per RF. */ + public static final long DEFAULT_MJ_PER_RF = MjAPI.MJ / 10; + + /** micro MJ per 1 int rf. */ + public final long mjPerRf; + + /** Set to true if {@link #mjPerRf} has been set to the {@link #DEFAULT_MJ_PER_RF} because the passed in value was + * out-of-bounds. (This is used to differentiate between it being explicitly set to the default value). */ + public final boolean usingDefaultValue; + + private MjRfConversion(long mjPerRf) { + if (MIN_MJ_PER_RF <= mjPerRf && mjPerRf <= MAX_MJ_PER_RF) { + usingDefaultValue = false; + this.mjPerRf = mjPerRf; + } else { + usingDefaultValue = true; + this.mjPerRf = DEFAULT_MJ_PER_RF; + } + } + + /** @param mjPerRf Micro Minecraft Joules per 1 RF */ + public static MjRfConversion createRaw(long mjPerRf) { + return new MjRfConversion(mjPerRf); + } + + /** @param configMjPerRf {@link MjAPI#MJ} per RF. This is rounded to the nearest 100 micro MJ */ + public static MjRfConversion createParsed(double configMjPerRf) { + long value = Math.round(configMjPerRf * 10_000); + return new MjRfConversion(value * MjAPI.MJ / 10_000); + } + + public static MjRfConversion createDefault() { + // -10 is always out of range + return new MjRfConversion(-10); + } +} diff --git a/api/buildcraft/api/mj/MjToRfAutoConvertor.java b/api/buildcraft/api/mj/MjToRfAutoConvertor.java new file mode 100644 index 0000000..4507c6b --- /dev/null +++ b/api/buildcraft/api/mj/MjToRfAutoConvertor.java @@ -0,0 +1,192 @@ +package buildcraft.api.mj; + +import net.minecraftforge.energy.IEnergyStorage; + +/** Automatic conversion utility class for treating an RF {@link IEnergyStorage} in the MJ API. */ +public class MjToRfAutoConvertor implements IMjReadable { + + final IEnergyStorage rf; + + /** @return An {@link MjToRfAutoConvertor} that may implement {@link IMjPassiveProvider} and/or {@link IMjReceiver} + * if the given storage can provide/receive energy, or null if the given storage is null, or if + * RF<->MJ autoconversion is not enabled ( {@link MjAPI#isRfAutoConversionEnabled()} ) */ + public static MjToRfAutoConvertor create(IEnergyStorage rf) { + + if (rf == null) { + return null; + } + + if (!MjAPI.isRfAutoConversionEnabled()) { + return null; + } + + if (rf.canReceive()) { + if (rf.canExtract()) { + return new OfBoth(rf); + } else { + return new OfReceiver(rf); + } + } else { + if (rf.canExtract()) { + return new OfProvider(rf); + } else { + return new MjToRfAutoConvertor(rf); + } + } + } + + /** @return An {@link MjToRfAutoConvertor} that may implements {@link IMjReceiver} if the given storage can receive + * energy, or null if the given storage is null, or if RF<->MJ autoconversion is not enabled ( + * {@link MjAPI#isRfAutoConversionEnabled()} ) */ + public static IMjReceiver createReceiver(IEnergyStorage rf) { + MjToRfAutoConvertor convertor = create(rf); + if (convertor instanceof IMjReceiver) { + return (IMjReceiver) convertor; + } else { + return null; + } + } + + /** @return An {@link MjToRfAutoConvertor} that may implements {@link IMjPassiveProvider} if the given storage can + * provide energy, or null if the given storage is null, or if RF<->MJ autoconversion is not enabled ( + * {@link MjAPI#isRfAutoConversionEnabled()} ) */ + public static IMjPassiveProvider createProvider(IEnergyStorage rf) { + MjToRfAutoConvertor convertor = create(rf); + if (convertor instanceof IMjPassiveProvider) { + return (IMjPassiveProvider) convertor; + } else { + return null; + } + } + + MjToRfAutoConvertor(IEnergyStorage storage) { + this.rf = storage; + } + + /** @return true. (Redstone-like engines are expected to not connect due to this class never implementing + * {@link IMjRedstoneReceiver}) */ + @Override + public boolean canConnect(IMjConnector other) { + return true; + } + + @Override + public long getStored() { + return rf.getEnergyStored() * MjAPI.getRfConversion().mjPerRf; + } + + @Override + public long getCapacity() { + return rf.getMaxEnergyStored() * MjAPI.getRfConversion().mjPerRf; + } + + long implGetPowerRequested() { + return (rf.getMaxEnergyStored() - rf.getEnergyStored()) * MjAPI.getRfConversion().mjPerRf; + } + + /** @return excess */ + long implReceivePower(long microJoules, boolean simulate) { + if (!rf.canReceive()) { + return microJoules; + } + + long mjPerRf = MjAPI.getRfConversion().mjPerRf; + + int maxRf = (int) (microJoules / mjPerRf); + + if (maxRf <= 0) { + return microJoules; + } + + int received = rf.receiveEnergy(maxRf, simulate); + + return microJoules - received * mjPerRf; + } + + long implExtractPower(long min, long max, boolean simulate) { + + if (!rf.canExtract()) { + return 0; + } + + long mjPerRf = MjAPI.getRfConversion().mjPerRf; + + int maxRf = (int) (max / mjPerRf); + + if (maxRf <= 0) { + return 0; + } + + int extractedRF = rf.extractEnergy(maxRf, true); + long extractedMJ = extractedRF * mjPerRf; + if (extractedMJ < min) { + return 0; + } + + if (!simulate) { + rf.extractEnergy(maxRf, simulate); + } + + return extractedMJ; + } +} + +final class OfReceiver extends MjToRfAutoConvertor implements IMjReceiver { + + OfReceiver(IEnergyStorage storage) { + super(storage); + } + + @Override + public boolean canReceive() { + return rf.canReceive(); + } + + @Override + public long getPowerRequested() { + return implGetPowerRequested(); + } + + @Override + public long receivePower(long microJoules, boolean simulate) { + return implReceivePower(microJoules, simulate); + } +} + +final class OfProvider extends MjToRfAutoConvertor implements IMjPassiveProvider { + OfProvider(IEnergyStorage storage) { + super(storage); + } + + @Override + public long extractPower(long min, long max, boolean simulate) { + return implExtractPower(min, max, simulate); + } +} + +final class OfBoth extends MjToRfAutoConvertor implements IMjReceiver, IMjPassiveProvider { + + OfBoth(IEnergyStorage storage) { + super(storage); + } + + @Override + public boolean canReceive() { + return rf.canReceive(); + } + + @Override + public long getPowerRequested() { + return implGetPowerRequested(); + } + + @Override + public long receivePower(long microJoules, boolean simulate) { + return implReceivePower(microJoules, simulate); + } + + @Override + public long extractPower(long min, long max, boolean simulate) { + return implExtractPower(min, max, simulate); + } +} diff --git a/api/buildcraft/api/transport/pipe/IFlowPower.java b/api/buildcraft/api/transport/pipe/IFlowPower.java index b97bb54..fde831e 100644 --- a/api/buildcraft/api/transport/pipe/IFlowPower.java +++ b/api/buildcraft/api/transport/pipe/IFlowPower.java @@ -3,8 +3,9 @@ import buildcraft.api.mj.IMjPassiveProvider; import net.minecraft.util.Direction; -public interface IFlowPower { +public interface IFlowPower extends IFlowPowerLike { /** Makes this pipe reconfigure itself, possibly due to the addition of new modules. */ + @Override void reconfigure(); /** Attempts to extract power from the {@link IMjPassiveProvider} connected to this pipe on the given side. diff --git a/api/buildcraft/api/transport/pipe/IFlowPowerLike.java b/api/buildcraft/api/transport/pipe/IFlowPowerLike.java new file mode 100644 index 0000000..c56b085 --- /dev/null +++ b/api/buildcraft/api/transport/pipe/IFlowPowerLike.java @@ -0,0 +1,6 @@ +package buildcraft.api.transport.pipe; + +public interface IFlowPowerLike { + /** Makes this pipe reconfigure itself, possibly due to the addition of new modules. */ + void reconfigure(); +} diff --git a/api/buildcraft/api/transport/pipe/IFlowRedstoneFlux.java b/api/buildcraft/api/transport/pipe/IFlowRedstoneFlux.java new file mode 100644 index 0000000..833eeec --- /dev/null +++ b/api/buildcraft/api/transport/pipe/IFlowRedstoneFlux.java @@ -0,0 +1,18 @@ +package buildcraft.api.transport.pipe; + +import net.minecraft.util.Direction; +import net.minecraftforge.energy.IEnergyStorage; + +public interface IFlowRedstoneFlux extends IFlowPowerLike { + /** Makes this pipe reconfigure itself, possibly due to the addition of new modules. */ + @Override + void reconfigure(); + + /** Attempts to extract power from the {@link IEnergyStorage} connected to this pipe on the given side. + * + * @param maxPower The Maximum amount of power that can be extracted. + * @param from The side (of this pipe) to take power from. + * @return The amount of power extracted. */ + // int tryExtractPower(int maxPower, EnumFacing from); + int tryExtractPower(int maxPower, Direction from); +} diff --git a/api/buildcraft/api/transport/pipe/PipeApi.java b/api/buildcraft/api/transport/pipe/PipeApi.java index fdd35b5..6659215 100644 --- a/api/buildcraft/api/transport/pipe/PipeApi.java +++ b/api/buildcraft/api/transport/pipe/PipeApi.java @@ -22,6 +22,7 @@ public final class PipeApi { public static PipeFlowType flowItems; public static PipeFlowType flowFluids; public static PipeFlowType flowPower; + public static PipeFlowType flowRf; /** The default transfer information used if a pipe definition has not been registered. Note that this is replaced * by BuildCraft Transport to config-defined values. */ @@ -31,8 +32,13 @@ public final class PipeApi { * by BuildCraft Transport to config-defined values. */ public static PowerTransferInfo powerInfoDefault = PowerTransferInfo.createFromResistance(8 * MjAPI.MJ, MjAPI.MJ / 32, false); + /** The default transfer information used if a pipe definition has not been registered. Note that this is replaced + * by BuildCraft Transport to config-defined values. */ + public static RedstoneFluxTransferInfo rfInfoDefault = new RedstoneFluxTransferInfo(80, false); + public static final Map fluidTransferData = new IdentityHashMap<>(); public static final Map powerTransferData = new IdentityHashMap<>(); + public static final Map rfTransferData = new IdentityHashMap<>(); @Nonnull public static Capability CAP_PIPE_HOLDER; @@ -64,6 +70,15 @@ public static PowerTransferInfo getPowerTransferInfo(PipeDefinition def) { } } + public static RedstoneFluxTransferInfo getRfTransferInfo(PipeDefinition def) { + RedstoneFluxTransferInfo info = rfTransferData.get(def); + if (info == null) { + return rfInfoDefault; + } else { + return info; + } + } + public static class FluidTransferInfo { /** Controls the maximum amount of fluid that can be transferred around and out of a pipe per tick. Note that * this does not affect the flow rate coming into the pipe. */ @@ -119,6 +134,16 @@ public PowerTransferInfo(long transferPerTick, long lossPerTick, long resistance } } + public static class RedstoneFluxTransferInfo { + public final int transferPerTick; + public final boolean isReceiver; + + public RedstoneFluxTransferInfo(int transferPerTick, boolean isReceiver) { + this.transferPerTick = transferPerTick; + this.isReceiver = isReceiver; + } + } + // Internals // static diff --git a/api/buildcraft/api/transport/pipe/PipeEventPower.java b/api/buildcraft/api/transport/pipe/PipeEventPower.java index 6b3db58..211b89a 100644 --- a/api/buildcraft/api/transport/pipe/PipeEventPower.java +++ b/api/buildcraft/api/transport/pipe/PipeEventPower.java @@ -25,6 +25,7 @@ public static class Configure extends PipeEventPower { * or by {@link #powerResistance} if it is set. This is capped at the value given in {@link #getMaxPower()} */ private long powerLoss = -1; private boolean receiver = false; + private boolean disabled = false; public Configure(IPipeHolder holder, IFlowPower flow) { super(holder, flow); @@ -70,6 +71,14 @@ public boolean isReceiver() { public void setReceiver(boolean receiver) { this.receiver = receiver; } + + public void disableTransfer() { + disabled = true; + } + + public boolean isTransferDisabled() { + return disabled; + } } public static class PrimaryDirection extends PipeEventPower { diff --git a/api/buildcraft/api/transport/pipe/PipeEventRedstoneFlux.java b/api/buildcraft/api/transport/pipe/PipeEventRedstoneFlux.java new file mode 100644 index 0000000..88db803 --- /dev/null +++ b/api/buildcraft/api/transport/pipe/PipeEventRedstoneFlux.java @@ -0,0 +1,69 @@ +package buildcraft.api.transport.pipe; + +import net.minecraft.util.Direction; + +public abstract class PipeEventRedstoneFlux extends PipeEvent { + public final IFlowRedstoneFlux flow; + + protected PipeEventRedstoneFlux(IPipeHolder holder, IFlowRedstoneFlux flow) { + super(holder); + this.flow = flow; + } + + protected PipeEventRedstoneFlux(boolean canBeCancelled, IPipeHolder holder, IFlowRedstoneFlux flow) { + super(canBeCancelled, holder); + this.flow = flow; + } + + public static class Configure extends PipeEventRedstoneFlux { + private int maxPower = 100; + private boolean receiver = false; + private boolean disabled = false; + + public Configure(IPipeHolder holder, IFlowRedstoneFlux flow) { + super(holder, flow); + } + + public int getMaxPower() { + return this.maxPower; + } + + public void setMaxPower(int maxPower) { + this.maxPower = maxPower; + } + + public boolean isReceiver() { + return this.receiver; + } + + /** Sets this pipe to be one that receives power from external sources. */ + public void setReceiver(boolean receiver) { + this.receiver = receiver; + } + + public void disableTransfer() { + disabled = true; + } + + public boolean isTransferDisabled() { + return disabled; + } + } + + public static class PrimaryDirection extends PipeEventRedstoneFlux { + private Direction facing; + + public PrimaryDirection(IPipeHolder holder, IFlowRedstoneFlux flow, Direction facing) { + super(holder, flow); + this.facing = facing; + } + + public Direction getFacing() { + return facing; + } + + public void setFacing(Direction facing) { + this.facing = facing; + } + } +} diff --git a/api/buildcraft/api/transport/pipe/PipeFlow.java b/api/buildcraft/api/transport/pipe/PipeFlow.java index ee7c48b..82c9d4d 100644 --- a/api/buildcraft/api/transport/pipe/PipeFlow.java +++ b/api/buildcraft/api/transport/pipe/PipeFlow.java @@ -73,11 +73,11 @@ public boolean shouldForceConnection(Direction face, TileEntity oTile) { return false; } - public void onTick() { - } + public void onTick() {} - public void addDrops(NonNullList toDrop, int fortune) { - } + public void postPluggableTick() {} + + public void addDrops(NonNullList toDrop, int fortune) {} public boolean onFlowActivate(PlayerEntity player, RayTraceResult trace, float hitX, float hitY, float hitZ, EnumPipePart part) { From 1c3be06cc37ba2b69f74d29e8e470a55154cbd35 Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Thu, 24 Apr 2025 18:36:23 +0800 Subject: [PATCH 5/7] Update engine type --- api/buildcraft/api/core/IEngineType.java | 6 ++++-- api/buildcraft/api/enums/EnumEngineType.java | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/api/buildcraft/api/core/IEngineType.java b/api/buildcraft/api/core/IEngineType.java index 11361a1..f3be89e 100644 --- a/api/buildcraft/api/core/IEngineType.java +++ b/api/buildcraft/api/core/IEngineType.java @@ -1,6 +1,8 @@ package buildcraft.api.core; +import net.minecraft.util.ResourceLocation; + public interface IEngineType { - @Deprecated() - String getItemModelLocation(); + // String getItemModelLocation(); + ResourceLocation getItemModelLocation(); } diff --git a/api/buildcraft/api/enums/EnumEngineType.java b/api/buildcraft/api/enums/EnumEngineType.java index 6705978..e3a0ecf 100644 --- a/api/buildcraft/api/enums/EnumEngineType.java +++ b/api/buildcraft/api/enums/EnumEngineType.java @@ -2,30 +2,31 @@ import buildcraft.api.core.IEngineType; import net.minecraft.util.IStringSerializable; +import net.minecraft.util.ResourceLocation; public enum EnumEngineType implements IStringSerializable, IEngineType { WOOD("core", "wood"), - STONE("energy", "stone"), - IRON("energy", "iron"), - // CREATIVE("energy", "creative"), + STONE("core", "stone"), + IRON("core", "iron"), CREATIVE("core", "creative"), - RF("energy", "rf"), + RF("core", "rf"), ; public final String unlocalizedTag; - @Deprecated() - public final String resourceLocation; + // public final String resourceLocation; + public final ResourceLocation resourceLocation; public static final EnumEngineType[] VALUES = values(); EnumEngineType(String mod, String loc) { unlocalizedTag = loc; - resourceLocation = "buildcraft" + mod + ":blocks/engine/inv/" + loc; + // resourceLocation = "buildcraft" + mod + ":blocks/engine/inv/" + loc; + resourceLocation = new ResourceLocation("buildcraft" + mod, "engine_" + loc); } - @Deprecated() @Override - public String getItemModelLocation() { + // public String getItemModelLocation() + public ResourceLocation getItemModelLocation() { return resourceLocation; } From 9f3379e718366d59b3842a0b6e168c772d3c59b6 Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Sat, 26 Apr 2025 14:57:30 +0800 Subject: [PATCH 6/7] Update IMessage --- api/buildcraft/api/net/IMessage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/buildcraft/api/net/IMessage.java b/api/buildcraft/api/net/IMessage.java index 6833ba9..9161db7 100644 --- a/api/buildcraft/api/net/IMessage.java +++ b/api/buildcraft/api/net/IMessage.java @@ -8,9 +8,9 @@ public interface IMessage { void toBytes(PacketBuffer buf); - public static IMessage staticFromBytes(Class clazz, PacketBuffer buf) { + public static MSG staticFromBytes(Class clazz, PacketBuffer buf) { try { - IMessage message = clazz.newInstance(); + MSG message = clazz.newInstance(); message.fromBytes(buf); return message; } catch (Exception e) { From 6183d8e149e000efc29509fa07ad3361a74c798a Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Wed, 7 May 2025 21:48:37 +0800 Subject: [PATCH 7/7] Fix MJ-RF conversion --- api/buildcraft/api/mj/MjCapabilityHelper.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/buildcraft/api/mj/MjCapabilityHelper.java b/api/buildcraft/api/mj/MjCapabilityHelper.java index 94ae110..e57e91e 100644 --- a/api/buildcraft/api/mj/MjCapabilityHelper.java +++ b/api/buildcraft/api/mj/MjCapabilityHelper.java @@ -96,7 +96,9 @@ public int receiveEnergy(int maxReceive, boolean simulate) { // (We need to actual accepted MJ to be some integer multiple of mjPerRf) long excessMj = acceptedMj % mjPerRf; // An MJ value that is an integer multiple of mjPerRf - long exactAcceptableMj = maxReceiveMj - excessMj; + // Calen FIX: acceptedMj, not maxReceiveMj + // long exactAcceptableMj = maxReceiveMj - excessMj; + long exactAcceptableMj = acceptedMj - excessMj; if (exactAcceptableMj <= 0) { return 0; @@ -178,7 +180,7 @@ public LazyOptional getCapability(@Nonnull Capability capability, Dire return provider == null ? LazyOptional.empty() : LazyOptional.of(() -> provider).cast(); } if (capability == CapabilityEnergy.ENERGY) { - return provider == null ? LazyOptional.empty() : LazyOptional.of(() -> rfAutoConvert).cast(); + return rfAutoConvert == null ? LazyOptional.empty() : LazyOptional.of(() -> rfAutoConvert).cast(); } return LazyOptional.empty(); }