mirror of
https://github.com/squeek502/Squake.git
synced 2025-08-03 09:47:22 -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
|
||||
build/
|
||||
bin/
|
||||
target/
|
||||
lib/
|
||||
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
|
||||
eclipse
|
||||
run
|
||||
libs
|
||||
media
|
||||
classes
|
||||
*.bat
|
||||
*.sh
|
||||
builds
|
||||
sources
|
||||
|
||||
# Misc
|
||||
*.rej
|
||||
# Created by https://www.gitignore.io/api/gradle,intellij,eclipse,windows,osx,linux
|
||||
|
||||
### 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 {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
minecraft {
|
||||
version = "1.8-11.14.1.1334"
|
||||
mappings = "snapshot_20141130"
|
||||
version = "1.9.4-12.17.0.1962"
|
||||
mappings = "snapshot_20160518"
|
||||
runDir = "run"
|
||||
|
||||
replace "\${version}", project.version
|
||||
replaceIn "ModInfo.java"
|
||||
}
|
||||
|
||||
group = project.projectDir.name.toLowerCase()
|
||||
archivesBaseName = project.projectDir.name + "-mc" + project.minecraft.version
|
||||
|
||||
sourceSets.main{
|
||||
java {
|
||||
srcDirs 'java', 'apis'
|
||||
}
|
||||
resources {
|
||||
srcDirs 'resources'
|
||||
}
|
||||
sourceSets.main.java.srcDirs += 'java'
|
||||
sourceSets.main.resources.srcDirs += 'resources'
|
||||
|
||||
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'
|
||||
}
|
||||
}
|
||||
|
||||
// variable substitution in java files
|
||||
task processSourceMainJava(type:Copy) {
|
||||
inputs.property "vars", project.version + project.minecraft.version
|
||||
from('java')
|
||||
{
|
||||
include '**/ModInfo.java'
|
||||
include '**/package-info.java'
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
into project.buildDir.getPath()+"/sources/java"
|
||||
repositories {
|
||||
ivy {
|
||||
name "PlayerAPI"
|
||||
artifactPattern "http://addons-origin.cursecdn.com/files/2318/180/[module]-[revision].[ext]"
|
||||
}
|
||||
}
|
||||
|
||||
// correct task ordering
|
||||
afterEvaluate { project ->
|
||||
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'
|
||||
}
|
||||
dependencies {
|
||||
deobfCompile group: 'playerapi', name: 'PlayerAPI', version: '1.9.4-1.0', ext: 'jar'
|
||||
}
|
@ -2,19 +2,19 @@ package squeek.quakemovement;
|
||||
|
||||
import api.player.client.ClientPlayerAPI;
|
||||
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.EventHandler;
|
||||
import net.minecraftforge.fml.common.Mod.Instance;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
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.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
|
||||
{
|
||||
// The instance of your mod that Forge uses.
|
||||
@ -42,12 +42,12 @@ public class ModQuakeMovement
|
||||
@SubscribeEvent
|
||||
public void onLivingFall(LivingFallEvent event)
|
||||
{
|
||||
if (!(event.entity instanceof EntityPlayer))
|
||||
if (!(event.getEntityLiving() instanceof EntityPlayer))
|
||||
return;
|
||||
|
||||
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 net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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.ClientPlayerBase;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
@ -51,7 +52,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
||||
double d1 = this.player.posY;
|
||||
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);
|
||||
else
|
||||
this.quake_moveEntityWithHeading(sidemove, forwardmove);
|
||||
@ -102,7 +103,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
||||
@Override
|
||||
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);
|
||||
return;
|
||||
@ -236,9 +237,8 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
||||
int i = MathHelper.floor_double(this.player.posY - 0.20000000298023224D - this.player.getYOffset());
|
||||
int k = MathHelper.floor_double(this.player.posZ);
|
||||
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++)
|
||||
{
|
||||
@ -360,7 +360,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
||||
private void minecraft_WaterMove(float sidemove, float forwardmove)
|
||||
{
|
||||
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.motionX *= 0.800000011920929D;
|
||||
this.player.motionY *= 0.800000011920929D;
|
||||
@ -387,7 +387,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
|
||||
float momentumRetention = this.getSlipperiness();
|
||||
|
||||
// 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
|
||||
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)
|
||||
{
|
||||
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)
|
||||
this.player.motionY *= ModConfig.SHARKING_SURFACE_TENSION;
|
||||
|
Loading…
x
Reference in New Issue
Block a user