mirror of
https://github.com/GTNewHorizons/StructureLib.git
synced 2026-10-26 14:23:56 +00:00
remove unnecessary shim code for IMultiblockInfoContainer
nobody implement these in practice, so we should be safe
This commit is contained in:
1 parent
113e05b7e6
commit
a8a1547845
1 file changed
+25
-34
+25
-34
@@ -8,7 +8,9 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
|
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
|
||||||
|
import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment;
|
||||||
import com.gtnewhorizon.structurelib.structure.IItemSource;
|
import com.gtnewhorizon.structurelib.structure.IItemSource;
|
||||||
|
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@@ -41,24 +43,35 @@ public interface IMultiblockInfoContainer<T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the structure using
|
* Construct the structure using
|
||||||
* {@link com.gtnewhorizon.structurelib.structure.IStructureElement#survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, java.util.function.Consumer)}
|
* {@link com.gtnewhorizon.structurelib.structure.IStructureElement#survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment)}
|
||||||
*
|
*
|
||||||
* @return -1 if done, a helping pointer
|
* @return -1 if done, a helping pointer
|
||||||
*/
|
*/
|
||||||
default int survivalConstruct(ItemStack stackSize, int elementBudge, IItemSource source,
|
int survivalConstruct(ItemStack stackSize, int elementBudge, ISurvivalBuildEnvironment env, T tileEntity,
|
||||||
EntityPlayerMP actorProfile, T tileEntity, ExtendedFacing aSide) {
|
ExtendedFacing aSide);
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
String[] getDescription(ItemStack stackSize);
|
String[] getDescription(ItemStack stackSize);
|
||||||
|
|
||||||
/**
|
default ISurvivalConstructable toConstructable(T tileEntity, ExtendedFacing aSide) {
|
||||||
* Override this and return {@link #toConstructable(IMultiblockInfoContainer, Object, ExtendedFacing)} if
|
return new ISurvivalConstructable() {
|
||||||
* {@link #survivalConstruct(ItemStack, int, IItemSource, EntityPlayerMP, Object, ExtendedFacing)} isn't a stub
|
|
||||||
*/
|
@Override
|
||||||
default IConstructable toConstructable(T tileEntity, ExtendedFacing aSide) {
|
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
|
||||||
return new IConstructable() {
|
return IMultiblockInfoContainer.this
|
||||||
|
.survivalConstruct(stackSize, elementBudget, env, tileEntity, aSide);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source,
|
||||||
|
EntityPlayerMP actor) {
|
||||||
|
return IMultiblockInfoContainer.this.survivalConstruct(
|
||||||
|
stackSize,
|
||||||
|
elementBudget,
|
||||||
|
ISurvivalBuildEnvironment.create(source, actor),
|
||||||
|
tileEntity,
|
||||||
|
aSide);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void construct(ItemStack stackSize, boolean hintsOnly) {
|
public void construct(ItemStack stackSize, boolean hintsOnly) {
|
||||||
@@ -71,26 +84,4 @@ public interface IMultiblockInfoContainer<T> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static <T> ISurvivalConstructable toConstructable(IMultiblockInfoContainer<T> thiz, T tileEntity,
|
|
||||||
ExtendedFacing aSide) {
|
|
||||||
return new ISurvivalConstructable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source,
|
|
||||||
EntityPlayerMP actor) {
|
|
||||||
return thiz.survivalConstruct(stackSize, elementBudget, source, actor, tileEntity, aSide);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void construct(ItemStack stackSize, boolean hintsOnly) {
|
|
||||||
thiz.construct(stackSize, hintsOnly, tileEntity, aSide);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getStructureDescription(ItemStack stackSize) {
|
|
||||||
return thiz.getDescription(stackSize);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user