mirror of
https://github.com/squeek502/Squake.git
synced 2025-09-08 03:25:54 -04:00
Port to 1.9.4
This commit is contained in:
parent
69fa089165
commit
aa77702954
217
.gitignore
vendored
217
.gitignore
vendored
@ -1,40 +1,181 @@
|
|||||||
# Builds & binaries
|
eclipse
|
||||||
build/
|
run
|
||||||
bin/
|
libs
|
||||||
target/
|
media
|
||||||
lib/
|
classes
|
||||||
launcher/
|
|
||||||
.gradle/
|
|
||||||
*.zip
|
|
||||||
*.jar
|
|
||||||
|
|
||||||
# Misc mod files
|
|
||||||
media/
|
|
||||||
libs/
|
|
||||||
|
|
||||||
# Tmp files
|
|
||||||
*~
|
|
||||||
*#
|
|
||||||
|
|
||||||
# IDEs
|
|
||||||
.classpath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.pydevproject
|
|
||||||
|
|
||||||
# MCP Files
|
|
||||||
docs/
|
|
||||||
conf/
|
|
||||||
eclipse/
|
|
||||||
jars/
|
|
||||||
logs/
|
|
||||||
runtime/
|
|
||||||
temp/
|
|
||||||
reobf/
|
|
||||||
CHANGELOG
|
|
||||||
LICENSE.txt
|
|
||||||
*.bat
|
*.bat
|
||||||
*.sh
|
builds
|
||||||
|
sources
|
||||||
|
|
||||||
# Misc
|
# Created by https://www.gitignore.io/api/gradle,intellij,eclipse,windows,osx,linux
|
||||||
*.rej
|
|
||||||
|
### Gradle ###
|
||||||
|
gradle/
|
||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
gradlew
|
||||||
|
|
||||||
|
# Ignore Gradle GUI config
|
||||||
|
gradle-app.setting
|
||||||
|
|
||||||
|
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||||
|
!gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Cache of project
|
||||||
|
.gradletasknamecache
|
||||||
|
|
||||||
|
### Intellij ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||||
|
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
## Directory-based project format:
|
||||||
|
.idea/
|
||||||
|
# if you remove the above rule, at least ignore the following:
|
||||||
|
|
||||||
|
# User-specific stuff:
|
||||||
|
# .idea/workspace.xml
|
||||||
|
# .idea/tasks.xml
|
||||||
|
# .idea/dictionaries
|
||||||
|
# .idea/shelf
|
||||||
|
|
||||||
|
# Sensitive or high-churn files:
|
||||||
|
# .idea/dataSources.ids
|
||||||
|
# .idea/dataSources.xml
|
||||||
|
# .idea/sqlDataSources.xml
|
||||||
|
# .idea/dynamic.xml
|
||||||
|
# .idea/uiDesigner.xml
|
||||||
|
|
||||||
|
# Gradle:
|
||||||
|
# .idea/gradle.xml
|
||||||
|
# .idea/libraries
|
||||||
|
|
||||||
|
# Mongo Explorer plugin:
|
||||||
|
# .idea/mongoSettings.xml
|
||||||
|
|
||||||
|
## File-based project format:
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
## Plugin-specific files:
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
*.pydevproject
|
||||||
|
.metadata
|
||||||
|
bin/
|
||||||
|
tmp/
|
||||||
|
*.tmp
|
||||||
|
*.bak
|
||||||
|
*.swp
|
||||||
|
*~.nib
|
||||||
|
local.properties
|
||||||
|
.settings/
|
||||||
|
.loadpath
|
||||||
|
|
||||||
|
# Eclipse Core
|
||||||
|
.project
|
||||||
|
|
||||||
|
# External tool builders
|
||||||
|
.externalToolBuilders/
|
||||||
|
|
||||||
|
# Locally stored "Eclipse launch configurations"
|
||||||
|
*.launch
|
||||||
|
|
||||||
|
# CDT-specific
|
||||||
|
.cproject
|
||||||
|
|
||||||
|
# JDT-specific (Eclipse Java Development Tools)
|
||||||
|
.classpath
|
||||||
|
|
||||||
|
# Java annotation processor (APT)
|
||||||
|
.factorypath
|
||||||
|
|
||||||
|
# PDT-specific
|
||||||
|
.buildpath
|
||||||
|
|
||||||
|
# sbteclipse plugin
|
||||||
|
.target
|
||||||
|
|
||||||
|
# TeXlipse plugin
|
||||||
|
.texlipse
|
||||||
|
|
||||||
|
# STS (Spring Tool Suite)
|
||||||
|
.springBeans
|
||||||
|
|
||||||
|
|
||||||
|
### Windows ###
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
|
||||||
|
### OSX ###
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
|
||||||
|
### Linux ###
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
85
build.gradle
85
build.gradle
@ -1,64 +1,51 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
jcenter()
|
||||||
maven {
|
maven {
|
||||||
name = "forge"
|
name = "forge"
|
||||||
url = "http://files.minecraftforge.net/maven"
|
url = "http://files.minecraftforge.net/maven"
|
||||||
}
|
}
|
||||||
maven {
|
}
|
||||||
name = "sonatype"
|
dependencies {
|
||||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'forge'
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.8-11.14.1.1334"
|
version = "1.9.4-12.17.0.1962"
|
||||||
mappings = "snapshot_20141130"
|
mappings = "snapshot_20160518"
|
||||||
|
runDir = "run"
|
||||||
|
|
||||||
|
replace "\${version}", project.version
|
||||||
|
replaceIn "ModInfo.java"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = project.projectDir.name.toLowerCase()
|
group = project.projectDir.name.toLowerCase()
|
||||||
archivesBaseName = project.projectDir.name + "-mc" + project.minecraft.version
|
archivesBaseName = project.projectDir.name + "-mc" + project.minecraft.version
|
||||||
|
|
||||||
sourceSets.main{
|
sourceSets.main.java.srcDirs += 'java'
|
||||||
java {
|
sourceSets.main.resources.srcDirs += 'resources'
|
||||||
srcDirs 'java', 'apis'
|
|
||||||
}
|
processResources {
|
||||||
resources {
|
inputs.property "vars", project.version + project.minecraft.version
|
||||||
srcDirs 'resources'
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
}
|
include '**/*.info'
|
||||||
|
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||||
|
}
|
||||||
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
exclude '**/*.info'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// variable substitution in java files
|
repositories {
|
||||||
task processSourceMainJava(type:Copy) {
|
ivy {
|
||||||
inputs.property "vars", project.version + project.minecraft.version
|
name "PlayerAPI"
|
||||||
from('java')
|
artifactPattern "http://addons-origin.cursecdn.com/files/2318/180/[module]-[revision].[ext]"
|
||||||
{
|
}
|
||||||
include '**/ModInfo.java'
|
|
||||||
include '**/package-info.java'
|
|
||||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
|
||||||
}
|
|
||||||
into project.buildDir.getPath()+"/sources/java"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// correct task ordering
|
dependencies {
|
||||||
afterEvaluate { project ->
|
deobfCompile group: 'playerapi', name: 'PlayerAPI', version: '1.9.4-1.0', ext: 'jar'
|
||||||
sourceMainJava.finalizedBy(processSourceMainJava)
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources
|
|
||||||
{
|
|
||||||
inputs.property "vars", project.version + project.minecraft.version
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
include '**/*.info'
|
|
||||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
|
||||||
}
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
exclude '**/*.info'
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -2,19 +2,19 @@ package squeek.quakemovement;
|
|||||||
|
|
||||||
import api.player.client.ClientPlayerAPI;
|
import api.player.client.ClientPlayerAPI;
|
||||||
import api.player.server.ServerPlayerAPI;
|
import api.player.server.ServerPlayerAPI;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||||
import net.minecraftforge.fml.common.Mod.Instance;
|
import net.minecraftforge.fml.common.Mod.Instance;
|
||||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
|
||||||
@Mod(modid = ModInfo.MODID, version = ModInfo.VERSION, acceptedMinecraftVersions="[1.8,1.9)", dependencies = "required-after:PlayerAPI;after:Squeedometer")
|
@Mod(modid = ModInfo.MODID, version = ModInfo.VERSION, acceptedMinecraftVersions="[1.9,1.10)", dependencies = "required-after:PlayerAPI;after:Squeedometer")
|
||||||
public class ModQuakeMovement
|
public class ModQuakeMovement
|
||||||
{
|
{
|
||||||
// The instance of your mod that Forge uses.
|
// The instance of your mod that Forge uses.
|
||||||
@ -42,12 +42,12 @@ public class ModQuakeMovement
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onLivingFall(LivingFallEvent event)
|
public void onLivingFall(LivingFallEvent event)
|
||||||
{
|
{
|
||||||
if (!(event.entity instanceof EntityPlayer))
|
if (!(event.getEntityLiving() instanceof EntityPlayer))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ModConfig.INCREASED_FALL_DISTANCE != 0.0D)
|
if (ModConfig.INCREASED_FALL_DISTANCE != 0.0D)
|
||||||
{
|
{
|
||||||
event.distance = (float) (event.distance - ModConfig.INCREASED_FALL_DISTANCE);
|
event.setDistance((float) (event.getDistance() - ModConfig.INCREASED_FALL_DISTANCE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.EnumBlockRenderType;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumParticleTypes;
|
import net.minecraft.util.EnumParticleTypes;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import api.player.client.ClientPlayerAPI;
|
import api.player.client.ClientPlayerAPI;
|
||||||
import api.player.client.ClientPlayerBase;
|
import api.player.client.ClientPlayerBase;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
@ -51,7 +52,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
|||||||
double d1 = this.player.posY;
|
double d1 = this.player.posY;
|
||||||
double d2 = this.player.posZ;
|
double d2 = this.player.posZ;
|
||||||
|
|
||||||
if (this.player.capabilities.isFlying && this.player.ridingEntity == null)
|
if (this.player.capabilities.isFlying && this.player.getRidingEntity() == null)
|
||||||
super.moveEntityWithHeading(sidemove, forwardmove);
|
super.moveEntityWithHeading(sidemove, forwardmove);
|
||||||
else
|
else
|
||||||
this.quake_moveEntityWithHeading(sidemove, forwardmove);
|
this.quake_moveEntityWithHeading(sidemove, forwardmove);
|
||||||
@ -102,7 +103,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
|||||||
@Override
|
@Override
|
||||||
public void moveFlying(float sidemove, float forwardmove, float wishspeed)
|
public void moveFlying(float sidemove, float forwardmove, float wishspeed)
|
||||||
{
|
{
|
||||||
if ((this.player.capabilities.isFlying && this.player.ridingEntity == null) || this.player.isInWater())
|
if ((this.player.capabilities.isFlying && this.player.getRidingEntity() == null) || this.player.isInWater())
|
||||||
{
|
{
|
||||||
super.moveFlying(sidemove, forwardmove, wishspeed);
|
super.moveFlying(sidemove, forwardmove, wishspeed);
|
||||||
return;
|
return;
|
||||||
@ -236,9 +237,8 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
|||||||
int i = MathHelper.floor_double(this.player.posY - 0.20000000298023224D - this.player.getYOffset());
|
int i = MathHelper.floor_double(this.player.posY - 0.20000000298023224D - this.player.getYOffset());
|
||||||
int k = MathHelper.floor_double(this.player.posZ);
|
int k = MathHelper.floor_double(this.player.posZ);
|
||||||
IBlockState blockState = this.player.worldObj.getBlockState(new BlockPos(j, i, k));
|
IBlockState blockState = this.player.worldObj.getBlockState(new BlockPos(j, i, k));
|
||||||
Block ground = blockState.getBlock();
|
|
||||||
|
|
||||||
if (ground != null && ground.getRenderType() != -1)
|
if (blockState.getRenderType() != EnumBlockRenderType.INVISIBLE)
|
||||||
{
|
{
|
||||||
for (int iParticle = 0; iParticle < numParticles; iParticle++)
|
for (int iParticle = 0; iParticle < numParticles; iParticle++)
|
||||||
{
|
{
|
||||||
@ -360,7 +360,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
|||||||
private void minecraft_WaterMove(float sidemove, float forwardmove)
|
private void minecraft_WaterMove(float sidemove, float forwardmove)
|
||||||
{
|
{
|
||||||
double d0 = this.player.posY;
|
double d0 = this.player.posY;
|
||||||
this.player.moveFlying(sidemove, forwardmove, 0.04F);
|
this.player.moveRelative(sidemove, forwardmove, 0.04F);
|
||||||
this.player.moveEntity(this.player.motionX, this.player.motionY, this.player.motionZ);
|
this.player.moveEntity(this.player.motionX, this.player.motionY, this.player.motionZ);
|
||||||
this.player.motionX *= 0.800000011920929D;
|
this.player.motionX *= 0.800000011920929D;
|
||||||
this.player.motionY *= 0.800000011920929D;
|
this.player.motionY *= 0.800000011920929D;
|
||||||
@ -387,7 +387,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
|||||||
float momentumRetention = this.getSlipperiness();
|
float momentumRetention = this.getSlipperiness();
|
||||||
|
|
||||||
// alter motionX/motionZ based on desired movement
|
// alter motionX/motionZ based on desired movement
|
||||||
this.player.moveFlying(sidemove, forwardmove, this.minecraft_getMoveSpeed());
|
this.player.moveRelative(sidemove, forwardmove, this.minecraft_getMoveSpeed());
|
||||||
|
|
||||||
// make adjustments for ladder interaction
|
// make adjustments for ladder interaction
|
||||||
minecraft_ApplyLadderPhysics();
|
minecraft_ApplyLadderPhysics();
|
||||||
@ -483,7 +483,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
|||||||
if (ModConfig.SHARKING_ENABLED && ModConfig.SHARKING_SURFACE_TENSION > 0.0D && this.playerAPI.getIsJumpingField() && this.player.motionY < 0.0F)
|
if (ModConfig.SHARKING_ENABLED && ModConfig.SHARKING_SURFACE_TENSION > 0.0D && this.playerAPI.getIsJumpingField() && this.player.motionY < 0.0F)
|
||||||
{
|
{
|
||||||
AxisAlignedBB axisalignedbb = this.player.getEntityBoundingBox().offset(this.player.motionX, this.player.motionY, this.player.motionZ);
|
AxisAlignedBB axisalignedbb = this.player.getEntityBoundingBox().offset(this.player.motionX, this.player.motionY, this.player.motionZ);
|
||||||
boolean isFallingIntoWater = this.player.worldObj.isAnyLiquid(axisalignedbb);
|
boolean isFallingIntoWater = this.player.worldObj.containsAnyLiquid(axisalignedbb);
|
||||||
|
|
||||||
if (isFallingIntoWater)
|
if (isFallingIntoWater)
|
||||||
this.player.motionY *= ModConfig.SHARKING_SURFACE_TENSION;
|
this.player.motionY *= ModConfig.SHARKING_SURFACE_TENSION;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user