Compare commits
No commits in common. "1.17" and "v1.3.1" have entirely different histories.
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '0.12-SNAPSHOT'
|
id 'fabric-loom' version '0.10-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/versions.html
|
# check these on https://fabricmc.net/versions.html
|
||||||
minecraft_version=1.19
|
minecraft_version=1.18
|
||||||
yarn_mappings=1.19+build.1
|
yarn_mappings=1.18+build.1
|
||||||
loader_version=0.14.7
|
loader_version=0.12.8
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.4.0
|
mod_version = 1.3.1
|
||||||
maven_group = nl.andrewlalis
|
maven_group = nl.andrewlalis
|
||||||
archives_base_name = speed-carts
|
archives_base_name = speed-carts
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_version=0.55.3+1.19
|
fabric_version=0.43.1+1.18
|
||||||
|
|
|
@ -39,7 +39,6 @@ public class Config {
|
||||||
|
|
||||||
private void ensureConfigExists() throws IOException {
|
private void ensureConfigExists() throws IOException {
|
||||||
if (!Files.exists(CONFIG_FILE)) {
|
if (!Files.exists(CONFIG_FILE)) {
|
||||||
Files.createDirectories(CONFIG_FILE.getParent());
|
|
||||||
OutputStream out = Files.newOutputStream(CONFIG_FILE);
|
OutputStream out = Files.newOutputStream(CONFIG_FILE);
|
||||||
InputStream defaultConfigInputStream = SpeedCarts.class.getClassLoader().getResourceAsStream("default_config.yaml");
|
InputStream defaultConfigInputStream = SpeedCarts.class.getClassLoader().getResourceAsStream("default_config.yaml");
|
||||||
if (defaultConfigInputStream == null) {
|
if (defaultConfigInputStream == null) {
|
||||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.state.property.Properties;
|
import net.minecraft.state.property.Properties;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.DyeColor;
|
import net.minecraft.util.DyeColor;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.math.*;
|
import net.minecraft.util.math.*;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import nl.andrewlalis.speed_carts.SpeedCarts;
|
import nl.andrewlalis.speed_carts.SpeedCarts;
|
||||||
|
@ -76,9 +77,9 @@ public abstract class AbstractMinecartMixin extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
protected abstract double getMaxSpeed();
|
protected abstract double getMaxOffRailSpeed();
|
||||||
|
|
||||||
@Inject(at = @At("HEAD"), method = "getMaxSpeed", cancellable = true)
|
@Inject(at = @At("HEAD"), method = "getMaxOffRailSpeed", cancellable = true)
|
||||||
public void getMaxOffRailSpeedOverwrite(CallbackInfoReturnable<Double> cir) {
|
public void getMaxOffRailSpeedOverwrite(CallbackInfoReturnable<Double> cir) {
|
||||||
cir.setReturnValue(this.maxSpeedBps / 20.0);
|
cir.setReturnValue(this.maxSpeedBps / 20.0);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +122,8 @@ public abstract class AbstractMinecartMixin extends Entity {
|
||||||
|
|
||||||
for (BlockPos position : this.getPositionsToCheck(pos)) {
|
for (BlockPos position : this.getPositionsToCheck(pos)) {
|
||||||
BlockEntity blockEntity = this.world.getBlockEntity(position);
|
BlockEntity blockEntity = this.world.getBlockEntity(position);
|
||||||
if (blockEntity instanceof SignBlockEntity sign) {
|
if (blockEntity instanceof SignBlockEntity) {
|
||||||
|
SignBlockEntity sign = (SignBlockEntity) blockEntity;
|
||||||
if (!sign.getPos().equals(this.lastUpdatedFrom) || this.world.getTime() > this.lastSpeedUpdate + SPEED_UPDATE_COOLDOWN) {
|
if (!sign.getPos().equals(this.lastUpdatedFrom) || this.world.getTime() > this.lastSpeedUpdate + SPEED_UPDATE_COOLDOWN) {
|
||||||
BlockState state = this.world.getBlockState(position);
|
BlockState state = this.world.getBlockState(position);
|
||||||
Direction dir = (Direction) state.getEntries().get(Properties.HORIZONTAL_FACING);
|
Direction dir = (Direction) state.getEntries().get(Properties.HORIZONTAL_FACING);
|
||||||
|
@ -141,7 +143,7 @@ public abstract class AbstractMinecartMixin extends Entity {
|
||||||
*/
|
*/
|
||||||
private boolean updateSpeedForSign(SignBlockEntity sign) {
|
private boolean updateSpeedForSign(SignBlockEntity sign) {
|
||||||
Text text = sign.getTextOnRow(0, false);
|
Text text = sign.getTextOnRow(0, false);
|
||||||
String s = text.getString();
|
String s = text.asString();
|
||||||
if (!SIGN_PATTERN.matcher(s).matches()) {
|
if (!SIGN_PATTERN.matcher(s).matches()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -310,7 +312,7 @@ public abstract class AbstractMinecartMixin extends Entity {
|
||||||
f = q + i * x;
|
f = q + i * x;
|
||||||
this.setPosition(d, e, f);
|
this.setPosition(d, e, f);
|
||||||
v = this.hasPassengers() ? 0.75D : 1.0D;
|
v = this.hasPassengers() ? 0.75D : 1.0D;
|
||||||
w = this.getMaxSpeed();
|
w = this.getMaxOffRailSpeed();
|
||||||
velocity = this.getVelocity();
|
velocity = this.getVelocity();
|
||||||
Vec3d movement = new Vec3d(MathHelper.clamp(v * velocity.x, -w, w), 0.0D, MathHelper.clamp(v * velocity.z, -w, w));
|
Vec3d movement = new Vec3d(MathHelper.clamp(v * velocity.x, -w, w), 0.0D, MathHelper.clamp(v * velocity.z, -w, w));
|
||||||
this.move(MovementType.SELF, movement);
|
this.move(MovementType.SELF, movement);
|
||||||
|
|
|
@ -23,12 +23,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"speed-carts.mixins.json"
|
"modid.mixins.json"
|
||||||
],
|
],
|
||||||
|
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.14.7",
|
"fabricloader": ">=0.11.3",
|
||||||
"minecraft": "1.19.x",
|
"minecraft": "1.18.x",
|
||||||
"java": ">=17"
|
"java": ">=16"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"required": true,
|
"required": true,
|
||||||
"minVersion": "0.8",
|
"minVersion": "0.8",
|
||||||
"package": "nl.andrewlalis.speed_carts.mixin",
|
"package": "nl.andrewlalis.speed_carts.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_16",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"AbstractMinecartMixin"
|
"AbstractMinecartMixin"
|
||||||
],
|
],
|
Loading…
Reference in New Issue