Finished up the Inversion Pillar animation rendering.
This commit is contained in:
parent
dab6e0842b
commit
a0b92c0c2f
|
@ -3,6 +3,7 @@ Version 2.1.0-60
|
|||
------------------------------------------------------
|
||||
- Fixed routing node serialization.
|
||||
- Removed unwanted System.out lines when clicking on the slots in the routing node.
|
||||
- Added fancy rendering for the Inversion Pillars.
|
||||
|
||||
------------------------------------------------------
|
||||
Version 2.1.0-59
|
||||
|
|
|
@ -56,6 +56,12 @@ public class BlockInversionPillar extends BlockStringContainer implements IVaria
|
|||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return super.getActualState(state, world, pos).withProperty(Properties.StaticProperty, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{
|
||||
|
@ -91,7 +97,7 @@ public class BlockInversionPillar extends BlockStringContainer implements IVaria
|
|||
{
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
for (int i = 0; i < names.length; i++)
|
||||
ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i]));
|
||||
ret.add(new ImmutablePair<Integer, String>(i, "static=false,type=" + names[i]));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -104,6 +110,6 @@ public class BlockInversionPillar extends BlockStringContainer implements IVaria
|
|||
@Override
|
||||
protected BlockStateContainer createRealBlockState()
|
||||
{
|
||||
return new ExtendedBlockState(this, new IProperty[] { stringProp }, new IUnlistedProperty[] { unlistedStringProp, Properties.AnimationProperty });
|
||||
return new ExtendedBlockState(this, new IProperty[] { stringProp, Properties.StaticProperty }, new IUnlistedProperty[] { unlistedStringProp, Properties.AnimationProperty });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,9 +46,9 @@ public class TileInversionPillar extends TileTicking
|
|||
public static double minimumWillForChunkWhenSpreading = 100;
|
||||
|
||||
private final IAnimationStateMachine asm;
|
||||
private final VariableValue offset = new VariableValue(0);
|
||||
private float animationOffsetValue = 0;
|
||||
private final VariableValue animationOffset = new VariableValue(0);
|
||||
private final VariableValue cycleLength = new VariableValue(4);
|
||||
private final VariableValue clickTime = new VariableValue(0);
|
||||
|
||||
public EnumDemonWillType type;
|
||||
public double currentInversion = 0;
|
||||
|
@ -72,12 +72,19 @@ public class TileInversionPillar extends TileTicking
|
|||
public TileInversionPillar(EnumDemonWillType type)
|
||||
{
|
||||
this.type = type;
|
||||
asm = BloodMagic.proxy.load(new ResourceLocation(Constants.Mod.MODID.toLowerCase(), "asms/block/inversion_pillar.json"), ImmutableMap.<String, ITimeValue>of("offset", offset, "cycle_length", cycleLength, "click_time", clickTime));
|
||||
asm = BloodMagic.proxy.load(new ResourceLocation(Constants.Mod.MODID.toLowerCase(), "asms/block/inversion_pillar.json"), ImmutableMap.<String, ITimeValue>of("offset", animationOffset, "cycle_length", cycleLength));
|
||||
animationOffsetValue = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if (animationOffsetValue < 0)
|
||||
{
|
||||
animationOffsetValue = worldObj.getTotalWorldTime() * worldObj.rand.nextFloat();
|
||||
animationOffset.setValue(animationOffsetValue);
|
||||
}
|
||||
|
||||
if (worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
|
@ -281,6 +288,9 @@ public class TileInversionPillar extends TileTicking
|
|||
currentInversion = tag.getDouble("currentInversion");
|
||||
currentInfectionRadius = tag.getInteger("currentInfectionRadius");
|
||||
consecutiveFailedChecks = tag.getInteger("consecutiveFailedChecks");
|
||||
|
||||
animationOffsetValue = tag.getFloat("animationOffset");
|
||||
animationOffset.setValue(animationOffsetValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -292,6 +302,7 @@ public class TileInversionPillar extends TileTicking
|
|||
tag.setDouble("currentInversion", currentInversion);
|
||||
tag.setInteger("currentInfectionRadius", currentInfectionRadius);
|
||||
tag.setInteger("consecutiveFailedChecks", consecutiveFailedChecks);
|
||||
tag.setFloat("animationOffset", animationOffsetValue);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"variable": "offset_y",
|
||||
"type": "uniform",
|
||||
"interpolation": "linear",
|
||||
"samples": [ 0, 0.08, 0.25, 0.42, 0.5, 0.42, 0.25, 0.08 ]
|
||||
"samples": [ -0.0625, -0.0442, 0, 0.0442, 0.0625, 0.0442, 0, -0.0442 ]
|
||||
},
|
||||
{
|
||||
"variable": "axis_y",
|
||||
|
@ -29,16 +29,13 @@
|
|||
"type": "uniform",
|
||||
"interpolation": "linear",
|
||||
"samples": [
|
||||
0, 120, 240,
|
||||
0, 120, 240,
|
||||
0, 120, 240,
|
||||
0, 120, 240
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"events": {
|
||||
"0.5": "boop"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +1,13 @@
|
|||
{
|
||||
"parameters": {
|
||||
"clip_time": [ "-/", "#offset", "#cycle_length" ],
|
||||
"round_cycle": [ "compose", [ "-R+", "#offset", "#cycle_length", "#offset" ] , "#click_time" ],
|
||||
"end_cycle": [ "-", "#round_cycle" ]
|
||||
"clip_time": [ "-/", "#offset", "#cycle_length" ]
|
||||
},
|
||||
"clips": {
|
||||
"default": "bloodmagic:block/inversion_pillar@default",
|
||||
"moving": [ "apply", "bloodmagic:block/inversion_pillar@moving", "#clip_time" ],
|
||||
"stopping": [ "trigger_positive", "#moving", "#end_cycle", "!transition:default" ]
|
||||
"moving": [ "apply", "bloodmagic:block/pillar_mid@moving", "#clip_time" ]
|
||||
},
|
||||
"states": [
|
||||
"default",
|
||||
"moving",
|
||||
"stopping"
|
||||
"moving"
|
||||
],
|
||||
"transitions": {
|
||||
"default": "moving",
|
||||
"moving": "stopping",
|
||||
"stopping": "default"
|
||||
},
|
||||
"transitions": {},
|
||||
"start_state": "moving"
|
||||
}
|
|
@ -36,6 +36,14 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"static": {
|
||||
"true": {
|
||||
"model": "builtin/generated"
|
||||
},
|
||||
"false": {
|
||||
"model": "bloodmagic:pillar_mid"
|
||||
}
|
||||
},
|
||||
"inventory": [{}]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue