mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-24 11:44:25 +00:00
Merge branch 'dev' into syntax-highlighter-unified
This commit is contained in:
commit
79fa879eb6
13 files changed
+109
-45
No files matched your search
@@ -122,7 +122,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Mod(modid = "customnpcs", name = "CustomNPC+", version = "1.11-beta6")
|
||||
@Mod(modid = "customnpcs", name = "CustomNPC+", version = "1.11-beta6.1")
|
||||
public class CustomNpcs {
|
||||
|
||||
@SidedProxy(clientSide = "noppes.npcs.client.ClientProxy", serverSide = "noppes.npcs.CommonProxy")
|
||||
|
||||
@@ -118,10 +118,11 @@ public class FieldDef {
|
||||
return def;
|
||||
}
|
||||
|
||||
public static FieldDef subGuiField(String label, Supplier<SubGuiInterface> factory, Consumer<SubGuiInterface> resultHandler) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> FieldDef subGuiField(String label, Supplier<T> factory, Consumer<T> resultHandler) {
|
||||
FieldDef def = new FieldDef(label, FieldType.SUB_GUI);
|
||||
def.subGuiFactory = factory;
|
||||
def.subGuiResultHandler = resultHandler;
|
||||
def.subGuiFactory = (Supplier<SubGuiInterface>) (Supplier<?>) factory;
|
||||
def.subGuiResultHandler = (Consumer<SubGuiInterface>) (Consumer<?>) resultHandler;
|
||||
return def;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,15 +62,16 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
} else if (heightOffGround > this.ais.flyHeightLimit) {
|
||||
aboveLimit = true;
|
||||
}
|
||||
if (aboveLimit && this.ais.hasFlyLimit || (heightOffGround < Math.ceil(this.height) && this.motionY == 0)) {
|
||||
if (aboveLimit && this.ais.hasFlyLimit) {
|
||||
this.flyLimitAllow = false;
|
||||
if (!this.getNavigator().noPath() && this.motionY > 0) {
|
||||
if (this.motionY > 0) {
|
||||
this.motionY = 0;
|
||||
} else {
|
||||
setNpcFlyingState(false);
|
||||
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);
|
||||
return;
|
||||
}
|
||||
} else if (heightOffGround < Math.ceil(this.height) && this.motionY == 0) {
|
||||
this.flyLimitAllow = false;
|
||||
setNpcFlyingState(false);
|
||||
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);
|
||||
return;
|
||||
}
|
||||
this.flyLimitAllow = true;
|
||||
setNpcFlyingState(true);
|
||||
@@ -120,15 +121,16 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
} else if (heightOffGround > this.ais.flyHeightLimit) {
|
||||
aboveLimit = true;
|
||||
}
|
||||
if (aboveLimit && this.ais.hasFlyLimit || (heightOffGround < Math.ceil(this.height) && this.motionY == 0)) {
|
||||
if (aboveLimit && this.ais.hasFlyLimit) {
|
||||
this.flyLimitAllow = false;
|
||||
if (!this.getNavigator().noPath() && this.motionY > 0) {
|
||||
if (this.motionY > 0) {
|
||||
this.motionY = 0;
|
||||
} else {
|
||||
setNpcFlyingState(false);
|
||||
super.performMountedMovement(strafe, forward, moveSpeed);
|
||||
return;
|
||||
}
|
||||
} else if (heightOffGround < Math.ceil(this.height) && this.motionY == 0) {
|
||||
this.flyLimitAllow = false;
|
||||
setNpcFlyingState(false);
|
||||
super.performMountedMovement(strafe, forward, moveSpeed);
|
||||
return;
|
||||
}
|
||||
this.flyLimitAllow = true;
|
||||
setNpcFlyingState(true);
|
||||
|
||||
@@ -789,7 +789,7 @@ public class ScriptDBCPlayer<T extends EntityPlayerMP> extends ScriptPlayer<T> i
|
||||
}
|
||||
|
||||
public void setRace(byte race) {
|
||||
if (race < 0 || race > 1)
|
||||
if (race < 0 || race > 5)
|
||||
return;
|
||||
|
||||
player.getEntityData().getCompoundTag("PlayerPersisted").setByte("jrmcRace", race);
|
||||
|
||||
Reference in new issue
Block a user