Potential fix for routing nodes (I changed nothing, but it now works). Fixed blocks that are solid that did not block sunlight.
This commit is contained in:
parent
0a2dfb4fd4
commit
8571d4d264
|
@ -59,6 +59,7 @@ public class ConfigHandler
|
|||
public static boolean ritualUpgradeRemove;
|
||||
public static boolean ritualArmourEvolve;
|
||||
public static boolean ritualForsakenSoul;
|
||||
public static boolean ritualCrystalHarvest;
|
||||
|
||||
public static boolean cobblestoneRitual;
|
||||
public static boolean placerRitual;
|
||||
|
@ -256,6 +257,7 @@ public class ConfigHandler
|
|||
ritualUpgradeRemove = config.get(category, "ritualRemove", true).getBoolean();
|
||||
ritualArmourEvolve = config.get(category, "ritualArmourEvolve", true).getBoolean();
|
||||
ritualForsakenSoul = config.get(category, "ritualForsakenSoul", true).getBoolean();
|
||||
ritualCrystalHarvest = config.get(category, "ritualCrystalHarvest", true).getBoolean();
|
||||
|
||||
cobblestoneRitual = config.get(category, "ritualCobblestone", true).getBoolean();
|
||||
placerRitual = config.get(category, "ritualPlacer", true).getBoolean();
|
||||
|
|
|
@ -6,13 +6,17 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
|
||||
|
||||
public abstract class BlockRoutingNode extends BlockContainer
|
||||
{
|
||||
|
@ -112,4 +116,22 @@ public abstract class BlockRoutingNode extends BlockContainer
|
|||
Block block = blockState.getBlock();
|
||||
return block.getMaterial(blockState).isOpaque() && blockState.isFullCube();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState blockState)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileRoutingNode)
|
||||
{
|
||||
((TileRoutingNode) tile).removeAllConnections();
|
||||
} else if (tile instanceof TileMasterRoutingNode)
|
||||
{
|
||||
((TileMasterRoutingNode) tile).removeAllConnections();
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(world, pos, blockState);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import net.minecraft.block.state.BlockStateContainer;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -86,12 +85,6 @@ public class BlockString extends Block
|
|||
return this.realBlockState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return Blocks.air.getBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
|
|
|
@ -54,6 +54,11 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi
|
|||
@Override
|
||||
public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
TileEntity tileHit = world.getTileEntity(pos);
|
||||
|
||||
if (!(tileHit instanceof IRoutingNode))
|
||||
|
@ -87,7 +92,7 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi
|
|||
|
||||
if (!node.isMaster(master))
|
||||
{
|
||||
if (node.getMasterPos().equals(BlockPos.ORIGIN))
|
||||
if (node.getMasterPos().equals(BlockPos.ORIGIN)) //If the node is not the master and it is receptive
|
||||
{
|
||||
node.connectMasterToRemainingNode(world, new LinkedList<BlockPos>(), master);
|
||||
master.addConnection(pos, containedPos);
|
||||
|
@ -112,7 +117,7 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi
|
|||
|
||||
if (!pastNode.isMaster(master))
|
||||
{
|
||||
if (pastNode.getMasterPos().equals(BlockPos.ORIGIN))
|
||||
if (pastNode.getMasterPos().equals(BlockPos.ORIGIN)) //TODO: This is where the issue is
|
||||
{
|
||||
pastNode.connectMasterToRemainingNode(world, new LinkedList<BlockPos>(), master);
|
||||
master.addConnection(pos, containedPos);
|
||||
|
|
|
@ -40,6 +40,7 @@ public class ModRituals
|
|||
public static Ritual upgradeRemoveRitual;
|
||||
public static Ritual armourEvolveRitual;
|
||||
public static Ritual forsakenSoulRitual;
|
||||
public static Ritual crystalHarvestRitual;
|
||||
|
||||
public static Ritual cobblestoneRitual;
|
||||
public static Ritual placerRitual;
|
||||
|
@ -98,6 +99,8 @@ public class ModRituals
|
|||
RitualRegistry.registerRitual(armourEvolveRitual, ConfigHandler.ritualArmourEvolve);
|
||||
forsakenSoulRitual = new RitualForsakenSoul();
|
||||
RitualRegistry.registerRitual(forsakenSoulRitual, ConfigHandler.ritualForsakenSoul);
|
||||
crystalHarvestRitual = new RitualCrystalHarvest();
|
||||
RitualRegistry.registerRitual(crystalHarvestRitual, ConfigHandler.ritualCrystalHarvest);
|
||||
|
||||
cobblestoneRitual = new RitualCobblestone();
|
||||
RitualRegistry.registerRitual(cobblestoneRitual, ConfigHandler.cobblestoneRitual);
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.network.SoulNetwork;
|
||||
import WayofTime.bloodmagic.api.ritual.AreaDescriptor;
|
||||
import WayofTime.bloodmagic.api.ritual.EnumRuneType;
|
||||
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
|
||||
import WayofTime.bloodmagic.api.ritual.Ritual;
|
||||
import WayofTime.bloodmagic.api.ritual.RitualComponent;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
||||
|
||||
public class RitualCrystalHarvest extends Ritual
|
||||
{
|
||||
public static final String CRYSTAL_RANGE = "crystal";
|
||||
|
||||
public RitualCrystalHarvest()
|
||||
{
|
||||
super("ritualCrystalHarvest", 0, 40000, "ritual." + Constants.Mod.MODID + ".crystalHarvestRitual");
|
||||
addBlockRange(CRYSTAL_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-3, 2, -3), 7, 5, 7));
|
||||
|
||||
setMaximumVolumeAndDistanceOfRange(CRYSTAL_RANGE, 250, 5, 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performRitual(IMasterRitualStone masterRitualStone)
|
||||
{
|
||||
World world = masterRitualStone.getWorldObj();
|
||||
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner());
|
||||
int currentEssence = network.getCurrentEssence();
|
||||
BlockPos pos = masterRitualStone.getBlockPos();
|
||||
|
||||
if (currentEssence < getRefreshCost())
|
||||
{
|
||||
network.causeNauseaToPlayer();
|
||||
return;
|
||||
}
|
||||
|
||||
int maxEffects = 1;
|
||||
int totalEffects = 0;
|
||||
|
||||
AreaDescriptor crystalRange = getBlockRange(CRYSTAL_RANGE);
|
||||
|
||||
crystalRange.resetIterator();
|
||||
while (crystalRange.hasNext())
|
||||
{
|
||||
BlockPos nextPos = crystalRange.next().add(pos);
|
||||
TileEntity tile = world.getTileEntity(nextPos);
|
||||
if (tile instanceof TileDemonCrystal)
|
||||
{
|
||||
TileDemonCrystal demonCrystal = (TileDemonCrystal) tile;
|
||||
if (demonCrystal.dropSingleCrystal())
|
||||
{
|
||||
IBlockState state = world.getBlockState(nextPos);
|
||||
world.notifyBlockUpdate(nextPos, state, state, 3);
|
||||
totalEffects++;
|
||||
if (totalEffects >= maxEffects)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
network.syphon(getRefreshCost() * totalEffects);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshTime()
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshCost()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<RitualComponent> getComponents()
|
||||
{
|
||||
ArrayList<RitualComponent> components = new ArrayList<RitualComponent>();
|
||||
|
||||
this.addCornerRunes(components, 1, 0, EnumRuneType.AIR);
|
||||
this.addParallelRunes(components, 1, 1, EnumRuneType.DUSK);
|
||||
this.addParallelRunes(components, 1, -1, EnumRuneType.FIRE);
|
||||
this.addParallelRunes(components, 2, -1, EnumRuneType.FIRE);
|
||||
this.addParallelRunes(components, 3, -1, EnumRuneType.FIRE);
|
||||
this.addOffsetRunes(components, 3, 1, -1, EnumRuneType.FIRE);
|
||||
this.addCornerRunes(components, 3, -1, EnumRuneType.EARTH);
|
||||
this.addCornerRunes(components, 3, 0, EnumRuneType.EARTH);
|
||||
this.addOffsetRunes(components, 3, 2, 0, EnumRuneType.DUSK);
|
||||
|
||||
return components;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ritual getNewCopy()
|
||||
{
|
||||
return new RitualCrystalHarvest();
|
||||
}
|
||||
}
|
|
@ -136,7 +136,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
|
|||
|
||||
public int getMaxTransferForDemonWill(double will)
|
||||
{
|
||||
return 8 + (int) (will / 25);
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -381,6 +381,15 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
|
|||
@Override
|
||||
public void removeAllConnections()
|
||||
{
|
||||
// Empty
|
||||
for (BlockPos testPos : generalNodeList)
|
||||
{
|
||||
TileEntity tile = worldObj.getTileEntity(testPos);
|
||||
if (tile instanceof IRoutingNode)
|
||||
{
|
||||
((IRoutingNode) tile).removeConnection(pos);
|
||||
this.removeConnection(testPos);
|
||||
getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(testPos), getWorld().getBlockState(testPos), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class TileRoutingNode extends TileInventory implements IRoutingNode, IIte
|
|||
if (tile instanceof IRoutingNode)
|
||||
{
|
||||
((IRoutingNode) tile).removeConnection(pos);
|
||||
getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(getPos()), getWorld().getBlockState(getPos()), 3);
|
||||
getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(testPos), getWorld().getBlockState(testPos), 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue