Skip to content

Commit

Permalink
Added Nukranium Gauntlet and fixed some world border issues in Apocal…
Browse files Browse the repository at this point in the history
…ypse
  • Loading branch information
jamioflan committed Apr 15, 2021
1 parent 6c7c47e commit 425eee3
Show file tree
Hide file tree
Showing 13 changed files with 219 additions and 27 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ minecraft {
version = minecraft_version + "-" + forge_version
runDir = "run"

replace "@ALLOWED_VERSIONS@", "[5.9.0, 5.10)"
replace "@ALLOWED_VERSIONS@", "[5.10.0, 5.11)"
replace "@VERSION@", project.version
replaceIn "FlansMod.java"
replaceIn "ModernWeaponsPackMod.java"
Expand All @@ -53,7 +53,7 @@ minecraft {
replaceIn "YeOldePackMod.java"
replaceIn "ZombiePackMod.java"

replace "@ALLOWED_VERSIONS_APOCALYPSE@", "[1.3, 1.4)"
replace "@ALLOWED_VERSIONS_APOCALYPSE@", "[1.4, 1.5)"
replace "@VERSION_APOCALYPSE@", project.apocalypseVersion
replaceIn "FlansModApocalypse.java"

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ minecraft_version = 1.12.2
jei_version = 4.15.0.293

version_major = 5
version_minor = 9
version_minor = 10
version_patch = 0
version_extra =
apocalypseVersion = 1.3.3
apocalypseVersion = 1.4.0
3 changes: 2 additions & 1 deletion run/Flan/Apocalypse Pack/assets/flansmod/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ item.aiChip.name=AI Chip
item.complicatedCircuit.name=Complicated Circuit
item.nuclearPowerCore.name=Nuclear Power Core
tile.flanGunRack.name=Gun Rack
item.buggy.name=Buggy
item.buggy.name=Buggy
item.nukranium_gauntlet.name=Nukranium Gauntlet
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "flansmod:items/nukranium_gauntlet",
"particle": "flansmod:items/nukranium_gauntlet"
},
"elements": [
{
"from": [5, 5, 5],
"to": [11, 11, 11],
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#0"},
"east": {"uv": [0, 0, 6, 6], "texture": "#0"},
"south": {"uv": [0, 0, 6, 6], "texture": "#0"},
"west": {"uv": [0, 0, 6, 6], "texture": "#0"},
"up": {"uv": [0, 0, 6, 6], "texture": "#0"},
"down": {"uv": [0, 0, 6, 6], "texture": "#0"}
}
},
{
"from": [6, 6, 4],
"to": [10, 10, 5],
"rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 4]},
"faces": {
"north": {"uv": [0, 8, 4, 12], "texture": "#0"},
"east": {"uv": [4, 8, 5, 12], "texture": "#0"},
"south": {"uv": [0, 12, 4, 16], "texture": "#0"},
"west": {"uv": [4, 12, 5, 16], "texture": "#0"},
"up": {"uv": [0, 6, 4, 7], "texture": "#0"},
"down": {"uv": [0, 7, 4, 8], "texture": "#0"}
}
},
{
"from": [5.5, 5.5, 9],
"to": [10.5, 10.5, 13],
"faces": {
"north": {"uv": [0, 0, 5, 5], "texture": "#0"},
"east": {"uv": [0, 0, 4, 5], "texture": "#0"},
"south": {"uv": [0, 0, 5, 5], "texture": "#0"},
"west": {"uv": [0, 0, 4, 5], "texture": "#0"},
"up": {"uv": [0, 0, 5, 4], "texture": "#0"},
"down": {"uv": [0, 0, 5, 4], "texture": "#0"}
}
},
{
"name": "spike",
"from": [9.25, 9.75, 6],
"to": [10.25, 10.75, 10],
"rotation": {"angle": -22.5, "axis": "x", "origin": [9, 10, 6]},
"faces": {
"north": {"uv": [10, 0, 11, 1], "texture": "#0"},
"east": {"uv": [12, 1, 16, 2], "texture": "#0"},
"south": {"uv": [11, 1, 12, 2], "texture": "#0"},
"west": {"uv": [12, 0, 16, 1], "texture": "#0"},
"up": {"uv": [10, 0, 11, 4], "texture": "#0"},
"down": {"uv": [9, 0, 10, 4], "texture": "#0"}
}
},
{
"name": "spike",
"from": [5.75, 9.5, 6],
"to": [6.75, 10.5, 10],
"rotation": {"angle": -22.5, "axis": "x", "origin": [6, 10, 6]},
"faces": {
"north": {"uv": [10, 0, 11, 1], "texture": "#0"},
"east": {"uv": [12, 1, 16, 2], "texture": "#0"},
"south": {"uv": [11, 1, 12, 2], "texture": "#0"},
"west": {"uv": [12, 0, 16, 1], "texture": "#0"},
"up": {"uv": [10, 0, 11, 4], "texture": "#0"},
"down": {"uv": [9, 0, 10, 4], "texture": "#0"}
}
},
{
"name": "spike",
"from": [7.5, 9.625, 6],
"to": [8.5, 10.625, 10],
"rotation": {"angle": -22.5, "axis": "x", "origin": [8, 10, 6]},
"faces": {
"north": {"uv": [10, 0, 11, 1], "texture": "#0"},
"east": {"uv": [12, 1, 16, 2], "texture": "#0"},
"south": {"uv": [11, 1, 12, 2], "texture": "#0"},
"west": {"uv": [12, 0, 16, 1], "texture": "#0"},
"up": {"uv": [10, 0, 11, 4], "texture": "#0"},
"down": {"uv": [9, 0, 10, 4], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"translation": [0, -2, 0],
"scale": [1, 1, 1]
},
"thirdperson_lefthand": {
"translation": [0, -2, 0]
},
"firstperson_righthand": {
"scale": [1, 1, 1]
},
"gui": {
"rotation": [45, 135, 0],
"scale": [1.2, 1.2, 1.2]
},
"fixed": {
"rotation": [-90, 0, 0]
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions run/Flan/Apocalypse Pack/gloves/NukraniumGauntlet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Name Nukranium Gauntlet
ShortName nukranium_gauntlet
Icon nukranium_gauntlet
//Colour in Red, Green, Blue, each going up to 255.
Colour 255 255 255
Enchantability 50
Durability 2048
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
import com.flansmod.common.FlansMod;
import com.flansmod.common.IFlansModContentProvider;
import com.flansmod.common.ItemHolderType;
import com.flansmod.common.enchantments.GloveType;
import com.flansmod.common.enchantments.ItemGlove;
import com.flansmod.common.parts.PartType;

@Mod(modid = FlansModApocalypse.MODID, name = "Flan's Mod: Apocalypse", version = FlansModApocalypse.VERSION, acceptableRemoteVersions = "@ALLOWED_VERSIONS_APOCALYPSE@", dependencies = "required-after:" + FlansMod.MODID)
Expand Down Expand Up @@ -91,6 +93,7 @@ public class FlansModApocalypse implements IFlansModContentProvider
public static int AIRPORT_RARITY = 125;
public static int DYE_FACTORY_RARITY = 400;
public static int LAB_RARITY = 100;


// TODO: Configify
public static int ABANDONED_PORTAL_APOC_RARITY = 4000;
Expand All @@ -104,6 +107,7 @@ public class FlansModApocalypse implements IFlansModContentProvider
* How far from their death point does the player respawn?
*/
public static int SPAWN_RADIUS = 100;
public static boolean RESPAWN_IN_APOC = false;
/**
* Who gets teleported to the apocalypse when a player places a mecha?
*/
Expand All @@ -130,6 +134,8 @@ public class FlansModApocalypse implements IFlansModContentProvider
//References to apocalypse specific items and blocks:
public static BlockItemHolder skeleton, slumpedSkeleton, gunRack;

public static ItemGlove nukraniumGauntlet;

static
{
FluidRegistry.enableUniversalBucket();
Expand Down Expand Up @@ -274,6 +280,11 @@ public void init(FMLInitializationEvent event)
if(PartType.getPart("nuclearPowerCore") != null)
PartType.getPart("nuclearPowerCore").item.setCreativeTab(tabApocalypse);

if(GloveType.getGlove("nukranium_gauntlet") != null)
{
nukraniumGauntlet = (ItemGlove)GloveType.getGlove("nukranium_gauntlet").item;
}

lootGenerator = new FlansModLootGenerator();
}

Expand Down Expand Up @@ -343,6 +354,7 @@ public static void syncConfig()

ABANDONED_PORTAL_APOC_RARITY = configFile.getInt("Abandoned Portal Rarity (Apocalypse)", Configuration.CATEGORY_GENERAL, ABANDONED_PORTAL_APOC_RARITY, 1, Integer.MAX_VALUE, "Rarity of the abandoned portal structures in the apocalypse");
ABANDONED_PORTAL_OVERWORLD_RARITY = configFile.getInt("Abandoned Portal Rarity (Other Dimensions)", Configuration.CATEGORY_GENERAL, ABANDONED_PORTAL_OVERWORLD_RARITY, 1, Integer.MAX_VALUE, "Rarity of the abandoned portal structures in other dimensions");
RESPAWN_IN_APOC = configFile.getBoolean("Respawn in Apocalypse", Configuration.CATEGORY_GENERAL, RESPAWN_IN_APOC, "If false, players will return to their overworld spawn point");

if(configFile.hasChanged())
configFile.save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.flansmod.common.guns.ItemGun;
import com.flansmod.common.network.PacketPlaySound;

import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.MoverType;
Expand Down Expand Up @@ -390,6 +391,17 @@ public void setDead()
dropItem(FlansMod.gunpowderBlockItem, rand.nextInt(4) + 1);
dropItem(FlansMod.gunpowderBlockItem, rand.nextInt(4) + 1);
dropItem(FlansMod.gunpowderBlockItem, rand.nextInt(4) + 1);

if(FlansModApocalypse.nukraniumGauntlet != null)
{
ItemStack gauntlet = new ItemStack(FlansModApocalypse.nukraniumGauntlet);
// 50% enchanted, 50% clean
if(rand.nextBoolean())
{
EnchantmentHelper.addRandomEnchantment(world.rand, gauntlet, 50, true);
}
entityDropItem(gauntlet, 0.0f);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,14 @@ private void findPortal(EntityPlayer player)
{
if(overworld.isAirBlock(pos) && overworld.isSideSolid(pos.down(), EnumFacing.UP))
{
//We have found a valid position
if(createPortal(overworld, pos))
if(overworld.getWorldBorder().contains(pos) && overworld.getWorldBorder().contains(pos.add(3, 0, 3)))
{
targetTeleporter = pos;
return;
//We have found a valid position
if(createPortal(overworld, pos))
{
targetTeleporter = pos;
return;
}
}
}
}
Expand All @@ -160,11 +163,14 @@ private void findPortal(EntityPlayer player)
{
if(apocWorld.isAirBlock(pos) && apocWorld.isSideSolid(pos.down(), EnumFacing.UP))
{
//We have found a valid position
if(createPortal(apocWorld, pos))
if(apocWorld.getWorldBorder().contains(pos) && apocWorld.getWorldBorder().contains(pos.add(3, 0, 3)))
{
targetTeleporter = pos;
return;
//We have found a valid position
if(createPortal(apocWorld, pos))
{
targetTeleporter = pos;
return;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public IChunkGenerator createChunkGenerator()
@Override
public boolean canRespawnHere()
{
return true;
return FlansModApocalypse.RESPAWN_IN_APOC;
}

@Override
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/com/flansmod/common/driveables/EntityPlane.java
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,12 @@ world.isRemote && getSeat(0) != null && getSeat(0).getControllingPassenger() ins
float targetWheelLength = targetWheelPos.length();
float currentWheelLength = currentWheelPos.length();

if(currentWheelLength > targetWheelLength * 3.0d)
{
// Make wheels break?
//this.attackPart(EnumDriveablePart.backLeftWheel, source, damage);
}

float dLength = targetWheelLength - currentWheelLength;
float dAngle = Vector3f.angle(targetWheelPos, currentWheelPos);

Expand Down Expand Up @@ -681,11 +687,11 @@ world.isRemote && getSeat(0) != null && getSeat(0).getControllingPassenger() ins
amountToMoveCar.y += ((wheel.posY - wheel.prevPosY) - (motionY)) * 0.5F / wheels.length;
//amountToMoveCar.z += ((wheel.posZ - wheel.prevPosZ) - (motionZ)) * 0.0616F / wheels.length;

if(amountToMoveWheel.lengthSquared() >= 16f * 16f)
if(amountToMoveWheel.lengthSquared() >= 32f * 32f)
{
FlansMod.log.warn("Wheel tried to move " + amountToMoveWheel.length() + " in a single frame, capping at 16 blocks");
FlansMod.log.warn("Wheel tried to move " + amountToMoveWheel.length() + " in a single frame, capping at 32 blocks");
amountToMoveWheel.normalise();
amountToMoveWheel.scale(16f);
amountToMoveWheel.scale(32f);
}

wheel.move(MoverType.SELF, amountToMoveWheel.x, amountToMoveWheel.y, amountToMoveWheel.z);
Expand Down
46 changes: 38 additions & 8 deletions src/main/java/com/flansmod/common/driveables/EntitySeat.java
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,31 @@ public void updatePosition()
.toVec3().subtract(0, entityInThisSeat.getEyeHeight(), 0);
// driveable.rotate(0, riddenByEntity.getYOffset(), 0).toVec3();

playerPosX = posX + yOffset.x;
playerPosY = posY + yOffset.y;
playerPosZ = posZ + yOffset.z;
double x = posX + yOffset.x;
double y = posY + yOffset.y;
double z = posZ + yOffset.z;

entityInThisSeat.lastTickPosX = getControllingPassenger().prevPosX = prevPlayerPosX;
entityInThisSeat.lastTickPosY = getControllingPassenger().prevPosY = prevPlayerPosY;
entityInThisSeat.lastTickPosZ = getControllingPassenger().prevPosZ = prevPlayerPosZ;
entityInThisSeat.setPosition(playerPosX, playerPosY, playerPosZ);
if((Math.abs(prevPlayerPosX - x) > 100d
|| Math.abs(prevPlayerPosY - y) > 100d
|| Math.abs(prevPlayerPosZ - z) > 100d)
&& prevPlayerPosY > 0.00001d)
{

FlansMod.log.warn("Player was made to move stupid distance in a frame, cancelling");
//entityInThisSeat.dismountRidingEntity();
}
else
{
// Set the absol
entityInThisSeat.setPosition(playerPosX, playerPosY, playerPosZ);
playerPosX = x;
playerPosY = y;
playerPosZ = z;

entityInThisSeat.lastTickPosX = getControllingPassenger().prevPosX = prevPlayerPosX;
entityInThisSeat.lastTickPosY = getControllingPassenger().prevPosY = prevPlayerPosY;
entityInThisSeat.lastTickPosZ = getControllingPassenger().prevPosZ = prevPlayerPosZ;
}

// Calculate the local look axes globally
RotatedAxes globalLookAxes = driveable.axes.findLocalAxesGlobally(playerLooking);
Expand Down Expand Up @@ -772,6 +789,9 @@ public boolean processInitialInteract(EntityPlayer entityplayer,
{
looking.setAngles(-animal.rotationYaw, animal.rotationPitch, 0F);
animal.clearLeashed(true, !entityplayer.capabilities.isCreativeMode);
playerPosX = prevPlayerPosX = animal.posX;
playerPosY = prevPlayerPosY = animal.posY;
playerPosZ = prevPlayerPosZ = animal.posZ;
}
else
{
Expand All @@ -784,7 +804,13 @@ public boolean processInitialInteract(EntityPlayer entityplayer,
// Put them in the seat
if(getControllingPassenger() == null && !driveable.getDriveableData().engine.isAIChip)
{
if(!entityplayer.startRiding(this))
if(entityplayer.startRiding(this))
{
playerPosX = prevPlayerPosX = entityplayer.posX;
playerPosY = prevPlayerPosY = entityplayer.posY;
playerPosZ = prevPlayerPosZ = entityplayer.posZ;
}
else
{
FlansMod.log.warn("Failed to mount seat");
}
Expand Down Expand Up @@ -841,6 +867,10 @@ public boolean startRiding(Entity riding)
EntityDriveable driveable = (EntityDriveable)riding;
driveable.registerSeat(this);
}

playerPosX = prevPlayerPosX = riding.posX;
playerPosY = prevPlayerPosY = riding.posY;
playerPosZ = prevPlayerPosZ = riding.posZ;
return success;
}

Expand Down
Loading

0 comments on commit 425eee3

Please sign in to comment.