0.18.3 pre update
This commit is contained in:
@@ -142,6 +142,18 @@ setPortalProps(gallifreyportal);
|
||||
setPortalLogic(gallifreyportal, 624, false);
|
||||
gallifreyportal.register();
|
||||
|
||||
|
||||
var homeseekerportal = VanillaFactory.createExpandBlock("homeseeker_portal_block", <blockmaterial:glass>);
|
||||
setPortalProps(homeseekerportal);
|
||||
setPortalHomeseeker(homeseekerportal);
|
||||
homeseekerportal.register();
|
||||
|
||||
var homeboundportal = VanillaFactory.createExpandBlock("homebound_portal_block", <blockmaterial:glass>);
|
||||
setPortalProps(homeboundportal);
|
||||
setPortalHomebound(homeboundportal);
|
||||
homeboundportal.register();
|
||||
|
||||
|
||||
function setPortalProps(block as Block) as Block {
|
||||
block.setBlockHardness(-1.0);
|
||||
block.setToolClass("pickaxe");
|
||||
@@ -178,4 +190,50 @@ function setPortalLogic(block as Block, dimId as int, inSpace as bool) as Block
|
||||
}
|
||||
};
|
||||
return block;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// construct special teleport
|
||||
function setPortalHomeseeker(block as Block) as Block {
|
||||
block.onEntityCollidedWithBlock = function(world, pos, state, entity) {
|
||||
if (world.isRemote() || entity.world.time % 20 != 0 || !(entity instanceof IPlayer)) {
|
||||
return;
|
||||
}
|
||||
var player as IPlayer = entity;
|
||||
// CoT type -> native type
|
||||
var blockPos as BlockPos = BlockPos(pos.x, pos.y, pos.z);
|
||||
var entityBB = entity.native.getEntityBoundingBox();
|
||||
// Ugly casting because of CoT types
|
||||
var blockBB = (state as IBlockState).native.getBoundingBox(entity.world.native, blockPos);
|
||||
if (!entity.isRiding && !entity.isBeingRidden && entityBB.intersects(blockBB.offset(blockPos))) {
|
||||
Commands.call("tp @p ~5 ~50 ~5", player, world, true, true);
|
||||
Commands.call("summon Item ~ ~ ~ {Item:{id:\"contenttweaker:shattered_mythic_matter\",Count:1b,Damage:0b}}", player, world, true, true);
|
||||
}
|
||||
};
|
||||
return block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// construct special teleport
|
||||
function setPortalHomebound(block as Block) as Block {
|
||||
block.onEntityCollidedWithBlock = function(world, pos, state, entity) {
|
||||
if (world.isRemote() || entity.world.time % 20 != 0 || !(entity instanceof IPlayer)) {
|
||||
return;
|
||||
}
|
||||
var player as IPlayer = entity;
|
||||
// CoT type -> native type
|
||||
var blockPos as BlockPos = BlockPos(pos.x, pos.y, pos.z);
|
||||
var entityBB = entity.native.getEntityBoundingBox();
|
||||
// Ugly casting because of CoT types
|
||||
var blockBB = (state as IBlockState).native.getBoundingBox(entity.world.native, blockPos);
|
||||
if (!entity.isRiding && !entity.isBeingRidden && entityBB.intersects(blockBB.offset(blockPos))) {
|
||||
Commands.call("tp @p ~5 ~50 ~5", player, world, true, true);
|
||||
Commands.call("summon twilightforest:knight_phantom ~ ~1 ~ {PersistenceRequired:1,HandItems:[{Count:1,id:\"aoa3:baron_sword\"},{Count:1,id:\"contenttweaker:recursive_mind_shield\"}],HandDropChances:[0.0f,1.0f],ArmorItems:[{},{},{Count:1,id:\"contenttweaker:sentient_meatball_chest\"},{Count:1,id:\"contenttweaker:sentient_meatball\"}],ActiveEffects:[{Id:14,Amplifier:0,Duration:999999,ShowParticles:0b},{Id:24,Amplifier:0,Duration:999999,ShowParticles:0b}],ForgeCaps:{\"twilightforest:cap_shield\":{tempshields:100,permshields:100}},Attributes:[{Name:generic.maxHealth, Base:50000.0},{Name:generic.attackDamage, Base:300.0}],Health:50000f,CustomName:\"肉丸意志之盾\"}", player, world, true, true);
|
||||
}
|
||||
};
|
||||
return block;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ portal.addItems([
|
||||
<contenttweaker:gallifrey_portal_block>
|
||||
]);
|
||||
var tooltip = [
|
||||
"该配方在激活时会生成一个传送门。",
|
||||
"站在传送门中以进行传送。"
|
||||
"This recipe spawns a portal while active.",
|
||||
"To teleport, stand inside the portal."
|
||||
] as string[];
|
||||
|
||||
var wormholetaerrapiatta = RecipeBuilder.newBuilder("wormholetaerrapiatta","wormhole_field_generator",100);
|
||||
@@ -99,6 +99,27 @@ wormholegallifrey.addItemInput(<contenttweaker:gallifrey_warper>).setChance(0)
|
||||
.addRecipeTooltip(tooltip)
|
||||
.build();
|
||||
|
||||
var wormholehomeseeker = RecipeBuilder.newBuilder("wormholehomeseeker","wormhole_field_generator",100);
|
||||
wormholehomeseeker.addItemInput(<contenttweaker:homeseeker_warper>).setChance(0)
|
||||
.addEnergyPerTickInput(10000)
|
||||
.addStartHandler(function(event as RecipeStartEvent) {
|
||||
wormholeGeneratorRecipeStart(event.controller, "contenttweaker:homeseeker_portal_block", "Home?");
|
||||
}
|
||||
)
|
||||
.addRecipeTooltip(tooltip)
|
||||
.build();
|
||||
|
||||
var wormholehomebound = RecipeBuilder.newBuilder("wormholehomebound","wormhole_field_generator",100);
|
||||
wormholehomebound.addItemInput(<contenttweaker:homebound_warper>).setChance(0)
|
||||
.addEnergyPerTickInput(10000)
|
||||
.addStartHandler(function(event as RecipeStartEvent) {
|
||||
wormholeGeneratorRecipeStart(event.controller, "contenttweaker:homebound_portal_block", "Home!");
|
||||
}
|
||||
)
|
||||
.addRecipeTooltip(tooltip)
|
||||
.build();
|
||||
|
||||
|
||||
// Do start up sound and message if no current portal, spawn portal if different recipe, or nothing if same portal:
|
||||
function wormholeGeneratorRecipeStart(controller as IMachineController, portalBlock as string, destination as string) {
|
||||
var pos = offset.getCenter(controller);
|
||||
|
||||
Reference in New Issue
Block a user