finished the aura field creator

This commit is contained in:
Ellpeck 2018-11-13 01:27:47 +01:00
parent 850e37889b
commit b4508abb4a
9 changed files with 185 additions and 10 deletions

View file

@ -5,14 +5,17 @@ import de.ellpeck.naturesaura.api.NaturesAuraAPI;
import de.ellpeck.naturesaura.blocks.tiles.TileEntityFieldCreator;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -76,15 +79,46 @@ public class BlockFieldCreator extends BlockContainerImpl {
BlockPos connected = creator.getConnectedPos();
if (connected != null)
NaturesAuraAPI.instance().spawnParticleStream(
pos.getX() + rand.nextFloat(),
pos.getY() + rand.nextFloat(),
pos.getZ() + rand.nextFloat(),
connected.getX() + rand.nextFloat(),
connected.getY() + rand.nextFloat(),
connected.getZ() + rand.nextFloat(),
pos.getX() + 0.25F + rand.nextFloat() * 0.5F,
pos.getY() + 0.25F + rand.nextFloat() * 0.5F,
pos.getZ() + 0.25F + rand.nextFloat() * 0.5F,
connected.getX() + 0.25F + rand.nextFloat() * 0.5F,
connected.getY() + 0.25F + rand.nextFloat() * 0.5F,
connected.getZ() + 0.25F + rand.nextFloat() * 0.5F,
0.65F, 0x4245f4, 1F
);
}
}
}
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@Override
public boolean isFullCube(IBlockState state) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
return false;
}
@Override
public boolean isSideSolid(IBlockState baseState, IBlockAccess world, BlockPos pos, EnumFacing side) {
return false;
}
@Override
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) {
return BlockFaceShape.UNDEFINED;
}
}

View file

@ -37,7 +37,7 @@ public class TileEntityFieldCreator extends TileEntityImpl implements ITickable
return;
BlockPos connectedPos = this.getConnectedPos();
if (connectedPos == null)
if (connectedPos == null || !this.world.isBlockLoaded(connectedPos))
return;
TileEntity other = this.world.getTileEntity(connectedPos);
@ -136,9 +136,9 @@ public class TileEntityFieldCreator extends TileEntityImpl implements ITickable
p.getX() + (float) this.world.rand.nextGaussian() * 3F,
p.getY() + 1 + this.world.rand.nextFloat() * 3F,
p.getZ() + (float) this.world.rand.nextGaussian() * 3F,
p.getX() + this.world.rand.nextFloat(),
p.getY() + this.world.rand.nextFloat(),
p.getZ() + this.world.rand.nextFloat(),
p.getX() + 0.5F,
p.getY() + 0.5F,
p.getZ() + 0.5F,
this.world.rand.nextFloat() * 0.07F + 0.07F, IAuraType.forWorld(this.world).getColor(), this.world.rand.nextFloat() + 0.5F
));
}

View file

@ -0,0 +1,16 @@
{
"forge_marker": 1,
"defaults": {
"model": "naturesaura:field_creator",
"textures": {
"texture": "naturesaura:blocks/field_creator",
"center": "naturesaura:blocks/field_creator_center",
"particle": "#texture"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}

View file

@ -28,6 +28,7 @@ tile.naturesaura.infused_brick_slab_double.name=Infused Brick Double Slab
tile.naturesaura.flower_generator.name=Herbivorous Absorber
tile.naturesaura.placer.name=Imperceptible Builder
tile.naturesaura.hopper_upgrade.name=Hopper Enhancement
tile.naturesaura.field_creator.name=Aura Field Creator
item.naturesaura.eye.name=Environmental Eye
item.naturesaura.gold_fiber.name=Brilliant Fiber

View file

@ -0,0 +1,69 @@
{
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"down": {
"uv": [0, 0, 16, 16],
"texture": "#texture",
"cullface": "down"
},
"up": {
"uv": [0, 0, 16, 16],
"texture": "#texture",
"cullface": "up"
},
"north": {
"uv": [0, 0, 16, 16],
"texture": "#texture",
"cullface": "north"
},
"south": {
"uv": [0, 0, 16, 16],
"texture": "#texture",
"cullface": "south"
},
"west": {
"uv": [0, 0, 16, 16],
"texture": "#texture",
"cullface": "west"
},
"east": {
"uv": [0, 0, 16, 16],
"texture": "#texture",
"cullface": "east"
}
}
}, {
"from": [5, 5, 5],
"to": [11, 11, 11],
"faces": {
"down": {
"uv": [0, 0, 6, 6],
"texture": "#center"
},
"up": {
"uv": [0, 0, 6, 6],
"texture": "#center"
},
"north": {
"uv": [0, 0, 6, 6],
"texture": "#center"
},
"south": {
"uv": [0, 0, 6, 6],
"texture": "#center"
},
"west": {
"uv": [0, 0, 6, 6],
"texture": "#center"
},
"east": {
"uv": [0, 0, 6, 6],
"texture": "#center"
}
}
}
]
}

View file

@ -0,0 +1,25 @@
{
"name": "Aura Field Creator",
"icon": "naturesaura:field_creator",
"category": "using",
"advancement": "naturesaura:aura_bottle_end",
"pages": [
{
"type": "text",
"text": "One of the two activities mostly done by humans is $(thing)breaking$() blocks. This requires quite a bit of strengh and effort, and, if done for long amounts of time, can become quite tiring.$(br)The $(item)Aura Field Creator$() creates a dense field of moving $(aura) that is strong enough for it to $(thing)destroy blocks$() within it."
},
{
"type": "text",
"text": "To set up a field like this, two $(item)Aura Field Creators$() need to be placed a couple of blocks apart. Then, interacting with one of them while sneaking and interacting with the other while not sneaking will cause a connection between the two to form.$(br)Once supplying one of them with a $(thing)redstone signal$(), and after a short channel time, the field will be created between the two, allowing any blocks being placed there to be broken and their items being dropped into the world."
},
{
"type":"text",
"text":"Of course, breaking blocks and especially the initial channel time will require a bit of $(aura) from the environment. Additionally, while the field is active, a small amount is consumed as a sort of upkeep cost."
},
{
"type": "crafting",
"text": "Creating two $(item)Aura Field Creators$()",
"recipe": "naturesaura:field_creator"
}
]
}

View file

@ -0,0 +1,30 @@
{
"type": "forge:ore_shaped",
"pattern": [
"GIG",
"GPG",
"GEG"
],
"key": {
"G": {
"item": "minecraft:glass"
},
"I": {
"item": "naturesaura:infused_iron"
},
"P": {
"item": "minecraft:piston"
},
"E": {
"type": "minecraft:item_nbt",
"item": "naturesaura:aura_bottle",
"nbt": {
"stored_type": "naturesaura:end"
}
}
},
"result": {
"item": "naturesaura:field_creator",
"count": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B