Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Add your dependencies here

dependencies {
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.1.29:api')
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.1.32:api')
api("com.github.GTNewHorizons:Mantle:0.5.2:dev")
api("com.github.GTNewHorizons:ForgeMultipart:1.7.10:dev")
// gtnhlib is compileOnlyApi by us, but needed at runtime by nei, so require the correct version
api("com.github.GTNewHorizons:GTNHLib:0.11.4:dev")
api("com.github.GTNewHorizons:GTNHLib:0.11.6:dev")
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.100-GTNH:dev")
compileOnlyApi("curse.maven:cofh-core-69162:2388751")
compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:api")
compileOnly("com.github.GTNewHorizons:waila:1.19.29:api")
compileOnly("com.github.GTNewHorizons:waila:1.19.30:api")
compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.3:api")
compileOnly("curse.maven:minefactory-reloaded-66672:2366150")
compileOnly("curse.maven:zelda-sword-skills-220540:2384889")
Expand All @@ -22,7 +22,7 @@ dependencies {
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev')
compileOnly('com.github.GTNewHorizons:SpecialMobs:3.7.4')
runtimeOnly('com.github.GTNewHorizons:TiC-Tooltips:1.4.1:dev'){transitive = false}
runtimeOnly("com.github.GTNewHorizons:ServerUtilities:2.2.37:dev")
runtimeOnly("com.github.GTNewHorizons:ServerUtilities:2.3.0:dev")


// For testing scythe crop harvesting
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/tconstruct/armor/player/TPlayerHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

import net.minecraft.block.Block;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.Entity.EnumEntitySize;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;

Expand All @@ -32,11 +38,13 @@
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mantle.player.PlayerUtils;
import tconstruct.TConstruct;
import tconstruct.compat.BaublesHelper;
import tconstruct.compat.LoadedMods;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.smeltery.blocks.SpeedBlock;
import tconstruct.tools.TinkerTools;
import tconstruct.util.config.PHConstruct;

Expand Down Expand Up @@ -389,5 +397,23 @@ public void playerDeathWrapper(LivingDeathEvent event) {
public void playerDropsWrapper(PlayerDropsEvent evt) {
TPlayerHandler.this.playerDrops(evt);
}

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void playerUpdates(LivingEvent.LivingUpdateEvent event) {
final EntityLivingBase entity = event.entityLiving;

// the player should handle its own movement, rest is handled by the server
if (entity instanceof EntityClientPlayerMP && entity.onGround) {
int tX = MathHelper.floor_double(entity.posX),
tY = MathHelper.floor_double(entity.boundingBox.minY - 0.001F),
tZ = MathHelper.floor_double(entity.posZ);
World world = entity.worldObj;
Block tBlock = world.getBlock(tX, tY, tZ);
if (tBlock instanceof SpeedBlock speedBlock) {
speedBlock.onWalkedOn(world, tX, tY, tZ, entity);
}
}
}
}
}
28 changes: 15 additions & 13 deletions src/main/java/tconstruct/smeltery/blocks/SpeedBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,25 @@ public class SpeedBlock extends TConstructBlock {

public SpeedBlock() {
super(Material.rock, 3.0f, textureNames);
// this.setBlockBounds(0f, 0f, 0f, 1.0f, 0.5f, 1.0f);
}

@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
double boost = 2.2D;
int metadata = world.getBlockMetadata(x, y, z);
if (metadata == 1 || metadata == 4) boost = 2.7D;
/// Invoked whenever the local player walks over this block.
/// Only invoked clientside.
public void onWalkedOn(World world, int x, int y, int z, Entity entity) {
if (entity.motionX == 0 && entity.motionZ == 0) return;
if (entity.isInWater()) return;
if (entity.isWet()) return;
if (entity.isSneaking()) return;

double mX = Math.abs(entity.motionX);
double mZ = Math.abs(entity.motionZ);
if (mX < 0.5D) {
entity.motionX *= boost;
}
if (mZ < 0.5D) {
entity.motionZ *= boost;
double tSpeed = 1.15;

int metadata = world.getBlockMetadata(x, y, z);
if (metadata == 1 || metadata == 4) {
tSpeed = 1.3;
}

entity.motionX *= tSpeed;
entity.motionZ *= tSpeed;
}

@Override
Expand Down