Buggy MCMP support
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -14,3 +14,5 @@ run/
|
|||||||
.idea/
|
.idea/
|
||||||
out/
|
out/
|
||||||
translation-diff.diff
|
translation-diff.diff
|
||||||
|
src/main/java/mcmultipart/*
|
||||||
|
src/main/resources/assets/mcmultiparttest/*
|
@@ -41,6 +41,9 @@ repositories {
|
|||||||
maven {
|
maven {
|
||||||
url "http://maven.epoxide.xyz"
|
url "http://maven.epoxide.xyz"
|
||||||
}
|
}
|
||||||
|
maven {
|
||||||
|
url "http://maven.amadornes.com"
|
||||||
|
}
|
||||||
maven {
|
maven {
|
||||||
name "Cyclops Repo"
|
name "Cyclops Repo"
|
||||||
url "https://dl.bintray.com/cyclopsmc/dev/"
|
url "https://dl.bintray.com/cyclopsmc/dev/"
|
||||||
@@ -53,6 +56,7 @@ dependencies {
|
|||||||
deobfCompile "net.darkhax.tesla:Tesla:1.11-1.3.0.51"
|
deobfCompile "net.darkhax.tesla:Tesla:1.11-1.3.0.51"
|
||||||
deobfCompile "org.cyclops.cyclopscore:CyclopsCore:1.11.2-0.9.2-483"
|
deobfCompile "org.cyclops.cyclopscore:CyclopsCore:1.11.2-0.9.2-483"
|
||||||
deobfCompile "org.cyclops.commoncapabilities:CommonCapabilities:1.11.2-1.3.1-95"
|
deobfCompile "org.cyclops.commoncapabilities:CommonCapabilities:1.11.2-1.3.1-95"
|
||||||
|
deobfCompile "MCMultiPart2:MCMultiPart-exp:2.0.0_13"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
@@ -144,6 +144,11 @@ public class BlockCable extends BlockNode {
|
|||||||
return boxes;
|
return boxes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||||
|
return CORE_AABB;
|
||||||
|
}
|
||||||
|
|
||||||
public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) {
|
public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,16 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.integration.mcmp;
|
||||||
|
|
||||||
|
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||||
|
import mcmultipart.api.addon.IMCMPAddon;
|
||||||
|
import mcmultipart.api.addon.MCMPAddon;
|
||||||
|
import mcmultipart.api.multipart.IMultipartRegistry;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
|
@MCMPAddon
|
||||||
|
public class IntegrationMCMP implements IMCMPAddon {
|
||||||
|
@Override
|
||||||
|
public void registerParts(IMultipartRegistry registry) {
|
||||||
|
registry.registerPartWrapper(RSBlocks.CABLE, new PartCable());
|
||||||
|
registry.registerStackWrapper(Item.getItemFromBlock(RSBlocks.CABLE), s -> true, RSBlocks.CABLE);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,32 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.integration.mcmp;
|
||||||
|
|
||||||
|
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||||
|
import mcmultipart.api.multipart.IMultipart;
|
||||||
|
import mcmultipart.api.slot.EnumCenterSlot;
|
||||||
|
import mcmultipart.api.slot.IPartSlot;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class PartCable implements IMultipart {
|
||||||
|
@Override
|
||||||
|
public IPartSlot getSlotForPlacement(World world, BlockPos pos, IBlockState state, EnumFacing facing, float hitX, float hitY, float hitZ, EntityLivingBase placer) {
|
||||||
|
return EnumCenterSlot.CENTER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPartSlot getSlotFromWorld(IBlockAccess world, BlockPos pos, IBlockState state) {
|
||||||
|
return EnumCenterSlot.CENTER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Block getBlock() {
|
||||||
|
return RSBlocks.CABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,17 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.integration.mcmp;
|
||||||
|
|
||||||
|
import mcmultipart.api.multipart.IMultipartTile;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
public class PartCableTile implements IMultipartTile {
|
||||||
|
private TileEntity tile;
|
||||||
|
|
||||||
|
public PartCableTile(TileEntity tile) {
|
||||||
|
this.tile = tile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity getTileEntity() {
|
||||||
|
return tile;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,13 +1,34 @@
|
|||||||
package com.raoulvdberge.refinedstorage.tile;
|
package com.raoulvdberge.refinedstorage.tile;
|
||||||
|
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeCable;
|
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeCable;
|
||||||
|
import com.raoulvdberge.refinedstorage.integration.mcmp.PartCableTile;
|
||||||
|
import mcmultipart.api.ref.MCMPCapabilities;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class TileCable extends TileNode<NetworkNodeCable> {
|
public class TileCable extends TileNode<NetworkNodeCable> {
|
||||||
|
private PartCableTile part = new PartCableTile(this);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public NetworkNodeCable createNode() {
|
public NetworkNodeCable createNode() {
|
||||||
return new NetworkNodeCable(this);
|
return new NetworkNodeCable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
||||||
|
return super.hasCapability(capability, side) || capability == MCMPCapabilities.MULTIPART_TILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing side) {
|
||||||
|
if (capability == MCMPCapabilities.MULTIPART_TILE) {
|
||||||
|
return (T) part;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.getCapability(capability, side);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user