added all the changes and loot tabels
This commit is contained in:
1 parent
313c54e8d6
commit
05c9dd5e66
61 files changed
+739
-109
No files matched your search
@@ -218,13 +218,13 @@ public final class AntarchySettings {
|
||||
private static int basiliskPreyPetrifyTicks = 200;
|
||||
private static boolean diamondMinecartEnabled = true;
|
||||
private static boolean diamondMinecartPlacesRails = true;
|
||||
private static double diamondMinecartCruiseSpeed = 0.6D;
|
||||
private static double diamondMinecartMaxSpeed = 1.0D;
|
||||
private static double diamondMinecartAcceleration = 0.03D;
|
||||
private static double diamondMinecartDeceleration = 0.04D;
|
||||
private static double diamondMinecartCoastDeceleration = 0.01D;
|
||||
private static boolean diamondMinecartMobDamageEnabled = true;
|
||||
private static double diamondMinecartMaxMobDamage = 8.0D;
|
||||
private static double diamondMinecartCruiseSpeed = 0.0D;
|
||||
private static double diamondMinecartMaxSpeed = 0.55D;
|
||||
private static double diamondMinecartAcceleration = 0.02D;
|
||||
private static double diamondMinecartDeceleration = 0.05D;
|
||||
private static double diamondMinecartCoastDeceleration = 0.02D;
|
||||
private static boolean diamondMinecartMobDamageEnabled = false;
|
||||
private static double diamondMinecartMaxMobDamage = 4.0D;
|
||||
private static boolean dreadHallucinationSoundsEnabled = true;
|
||||
private static double dreadHallucinationSoundMinInterval = 3.0D;
|
||||
private static double dreadHallucinationSoundMaxInterval = 10.0D;
|
||||
|
||||
+18
@@ -229,10 +229,17 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
return !HerculesBeetleEntity.this.isKnockedDown()
|
||||
&& !HerculesBeetleEntity.this.isLeashed()
|
||||
&& !HerculesBeetleEntity.this.isVehicle()
|
||||
&& !HerculesBeetleEntity.this.isInBusyAnimation()
|
||||
&& super.canUse();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canContinueToUse() {
|
||||
return !HerculesBeetleEntity.this.isLeashed()
|
||||
&& super.canContinueToUse();
|
||||
}
|
||||
});
|
||||
this.goalSelector.addGoal(3, new LookAtPlayerGoal(this, Player.class, 16.0F));
|
||||
this.goalSelector.addGoal(4, new RandomLookAroundGoal(this));
|
||||
@@ -364,6 +371,10 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl
|
||||
|
||||
if (this.isKnockedDown()) {
|
||||
this.tickKnockedDown();
|
||||
} else if (this.isLeashed()) {
|
||||
this.getNavigation().stop();
|
||||
this.setTarget(null);
|
||||
this.updateAmbientAnimation();
|
||||
} else if (this.chargeTicksRemaining > 0 || this.getAnimationState() == ANIM_CHARGE) {
|
||||
this.tickCharge();
|
||||
} else if (this.isInBusyAnimation()) {
|
||||
@@ -1402,6 +1413,11 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeLeashed(Player player) {
|
||||
return this.isTame() && super.canBeLeashed(player);
|
||||
}
|
||||
|
||||
private final class HerculesCombatGoal extends Goal {
|
||||
HerculesCombatGoal() {
|
||||
this.setFlags(EnumSet.of(Flag.MOVE, Flag.LOOK));
|
||||
@@ -1410,6 +1426,7 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
return !HerculesBeetleEntity.this.isTame()
|
||||
&& !HerculesBeetleEntity.this.isLeashed()
|
||||
&& !HerculesBeetleEntity.this.isKnockedDown()
|
||||
&& HerculesBeetleEntity.this.getTarget() != null
|
||||
&& HerculesBeetleEntity.this.canAttack(HerculesBeetleEntity.this.getTarget());
|
||||
@@ -1421,6 +1438,7 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl
|
||||
return target != null
|
||||
&& target.isAlive()
|
||||
&& !HerculesBeetleEntity.this.isTame()
|
||||
&& !HerculesBeetleEntity.this.isLeashed()
|
||||
&& !HerculesBeetleEntity.this.isKnockedDown()
|
||||
&& HerculesBeetleEntity.this.canAttack(target);
|
||||
}
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.craisinlord.antarchy.content.gravity;
|
||||
|
||||
import com.craisinlord.antarchy.content.AntarchyObjects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
||||
public final class AntarchyMountedGravityHelper {
|
||||
private static final AntarchyGravityTransition STACK_TRANSITION = new AntarchyGravityTransition(12);
|
||||
|
||||
private AntarchyMountedGravityHelper() {
|
||||
}
|
||||
|
||||
public static void syncConnectedStack(Entity entity) {
|
||||
if (entity == null || entity.level().isClientSide()) {
|
||||
return;
|
||||
}
|
||||
syncRootStack(entity.getRootVehicle(), null);
|
||||
}
|
||||
|
||||
public static void syncConnectedStackIgnoring(Entity entity, LivingEntity ignoredEffectSource) {
|
||||
if (entity == null || entity.level().isClientSide()) {
|
||||
return;
|
||||
}
|
||||
syncRootStack(entity.getRootVehicle(), ignoredEffectSource);
|
||||
}
|
||||
|
||||
public static void syncSeparatedStacks(Entity previousVehicle, Entity detachedEntity) {
|
||||
if (previousVehicle != null && !previousVehicle.level().isClientSide()) {
|
||||
syncRootStack(previousVehicle.getRootVehicle(), null);
|
||||
}
|
||||
if (detachedEntity != null && !detachedEntity.level().isClientSide()) {
|
||||
syncRootStack(detachedEntity.getRootVehicle(), null);
|
||||
}
|
||||
}
|
||||
|
||||
private static void syncRootStack(Entity root, LivingEntity ignoredEffectSource) {
|
||||
boolean shouldInvert = stackHasInvertedEffect(root, ignoredEffectSource);
|
||||
applyGravityState(root, shouldInvert);
|
||||
for (Entity passenger : root.getIndirectPassengers()) {
|
||||
applyGravityState(passenger, shouldInvert);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean stackHasInvertedEffect(Entity root, LivingEntity ignoredEffectSource) {
|
||||
if (hasInvertedEffect(root, ignoredEffectSource)) {
|
||||
return true;
|
||||
}
|
||||
for (Entity passenger : root.getIndirectPassengers()) {
|
||||
if (hasInvertedEffect(passenger, ignoredEffectSource)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean hasInvertedEffect(Entity entity, LivingEntity ignoredEffectSource) {
|
||||
return entity instanceof LivingEntity living
|
||||
&& living != ignoredEffectSource
|
||||
&& living.hasEffect(AntarchyObjects.INVERTED_EFFECT.get());
|
||||
}
|
||||
|
||||
private static void applyGravityState(Entity entity, boolean shouldInvert) {
|
||||
if (shouldInvert) {
|
||||
if (AntarchyGravityApi.getGravityDirection(entity) != AntarchyGravityDirection.UP) {
|
||||
AntarchyGravityApi.setForcedGravityDirection(entity, AntarchyGravityDirection.UP, STACK_TRANSITION);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (AntarchyGravityApi.isGravityForced(entity)) {
|
||||
AntarchyGravityApi.setGravityDirection(entity, AntarchyGravityDirection.DOWN, false, STACK_TRANSITION);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -34,6 +34,14 @@ public class DiamondMinecartItem extends Item {
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, Level level, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
||||
super.appendHoverText(stack, level, tooltipComponents, tooltipFlag);
|
||||
if (!AntarchySettings.diamondMinecartEnabled()) {
|
||||
tooltipComponents.add(Component.literal("Currently behaves like a regular minecart.").withStyle(ChatFormatting.GRAY));
|
||||
return;
|
||||
}
|
||||
tooltipComponents.add(Component.literal("Hold W to accelerate and S to brake.").withStyle(ChatFormatting.GRAY));
|
||||
if (AntarchySettings.diamondMinecartPlacesRails()) {
|
||||
tooltipComponents.add(Component.literal("Places rails from your inventory while ridden.").withStyle(ChatFormatting.DARK_AQUA));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.craisinlord.antarchy.mixins.gravity;
|
||||
|
||||
import com.craisinlord.antarchy.content.gravity.AntarchyMountedGravityHelper;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
public abstract class EntityMountedGravityMixin {
|
||||
@Unique
|
||||
private Entity antarchy$previousVehicle;
|
||||
|
||||
@Inject(method = "startRiding(Lnet/minecraft/world/entity/Entity;Z)Z", at = @At("RETURN"))
|
||||
private void antarchy$syncMountedStack(Entity vehicle, boolean force, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (cir.getReturnValue()) {
|
||||
AntarchyMountedGravityHelper.syncConnectedStack((Entity) (Object) this);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "stopRiding", at = @At("HEAD"))
|
||||
private void antarchy$capturePreviousVehicle(CallbackInfo ci) {
|
||||
this.antarchy$previousVehicle = ((Entity) (Object) this).getVehicle();
|
||||
}
|
||||
|
||||
@Inject(method = "stopRiding", at = @At("TAIL"))
|
||||
private void antarchy$syncDismountedStacks(CallbackInfo ci) {
|
||||
AntarchyMountedGravityHelper.syncSeparatedStacks(this.antarchy$previousVehicle, (Entity) (Object) this);
|
||||
this.antarchy$previousVehicle = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "building",
|
||||
"key": {
|
||||
"D": {
|
||||
"tag": "c:deepslates"
|
||||
},
|
||||
"B": {
|
||||
"item": "antarchy:broodfruit"
|
||||
}
|
||||
},
|
||||
"pattern": [
|
||||
"DDD",
|
||||
"DBD",
|
||||
"DDD"
|
||||
],
|
||||
"result": {
|
||||
"count": 8,
|
||||
"item": "antarchy:bloodstone"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "building",
|
||||
"key": {
|
||||
"S": {
|
||||
"tag": "c:stones"
|
||||
},
|
||||
"C": {
|
||||
"item": "antarchy:chitin"
|
||||
}
|
||||
},
|
||||
"pattern": [
|
||||
"SSS",
|
||||
"SCS",
|
||||
"SSS"
|
||||
],
|
||||
"result": {
|
||||
"count": 8,
|
||||
"item": "antarchy:myrmite"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:deepslate"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:stone"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user