save stuff here

This commit is contained in:
Ben Kerllenevich
2023-06-09 00:01:03 -04:00
parent 0b3c94c72d
commit 8768f54932
159 changed files with 4276 additions and 3663 deletions

View File

@@ -26,12 +26,12 @@ index 64f17b4a22454b59968787089253eaba0a04c1f2..b373f9e4b5a2604bcbccd36cd3de961f
}
+ // Purpur start
+ if (level.purpurConfig.phantomAttackedByCrystalRadius <= 0 || --idleCooldown > 0) {
+ if (level().purpurConfig.phantomAttackedByCrystalRadius <= 0 || --idleCooldown > 0) {
+ return; // on cooldown
+ }
+
+ if (targetPhantom == null) {
+ for (net.minecraft.world.entity.monster.Phantom phantom : level.getEntitiesOfClass(net.minecraft.world.entity.monster.Phantom.class, getBoundingBox().inflate(level.purpurConfig.phantomAttackedByCrystalRadius))) {
+ for (net.minecraft.world.entity.monster.Phantom phantom : level.getEntitiesOfClass(net.minecraft.world.entity.monster.Phantom.class, getBoundingBox().inflate(level().purpurConfig.phantomAttackedByCrystalRadius))) {
+ if (phantom.hasLineOfSight(this)) {
+ attackPhantom(phantom);
+ break;
@@ -44,7 +44,7 @@ index 64f17b4a22454b59968787089253eaba0a04c1f2..b373f9e4b5a2604bcbccd36cd3de961f
+ if (targetPhantom.hasLineOfSight(this)) {
+ if (phantomDamageCooldown <= 0) {
+ phantomDamageCooldown = 20;
+ targetPhantom.hurt(targetPhantom.damageSources().indirectMagic(this, this), level.purpurConfig.phantomAttackedByCrystalDamage);
+ targetPhantom.hurt(targetPhantom.damageSources().indirectMagic(this, this), level().purpurConfig.phantomAttackedByCrystalDamage);
+ }
+ } else {
+ forgetPhantom(); // no longer in sight
@@ -120,7 +120,7 @@ index e271555ac03fcbb565a7fe08efdc9a6036164e74..fd02dfb905c71fa10e0830cf0a02d4b6
- this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
+ // Purpur start
+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
+ if (level.purpurConfig.phantomOrbitCrystalRadius > 0) {
+ if (level().purpurConfig.phantomOrbitCrystalRadius > 0) {
+ this.goalSelector.addGoal(1, new FindCrystalGoal(this));
+ this.goalSelector.addGoal(2, new OrbitCrystalGoal(this));
+ }
@@ -186,7 +186,7 @@ index e271555ac03fcbb565a7fe08efdc9a6036164e74..fd02dfb905c71fa10e0830cf0a02d4b6
+ }
+
+ private double maxTargetRange() {
+ return phantom.level.purpurConfig.phantomOrbitCrystalRadius;
+ return phantom.level().purpurConfig.phantomOrbitCrystalRadius;
+ }
+ }
+

View File

@@ -151,7 +151,7 @@ index aa95cd7e04e25dec63c172d219f1f16cd6c9c4b5..8e2015fc122a93015482a81b2bbfa112
} else {
brain.setSchedule(Schedule.VILLAGER_DEFAULT);
- brain.addActivityWithConditions(Activity.WORK, VillagerGoalPackages.getWorkPackage(villagerprofession, 0.5F), ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT)));
+ brain.addActivityWithConditions(Activity.WORK, VillagerGoalPackages.getWorkPackage(villagerprofession, 0.5F, this.level.purpurConfig.villagerClericsFarmWarts), ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))); // Purpur
+ brain.addActivityWithConditions(Activity.WORK, VillagerGoalPackages.getWorkPackage(villagerprofession, 0.5F, this.level().purpurConfig.villagerClericsFarmWarts), ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))); // Purpur
}
brain.addActivity(Activity.CORE, VillagerGoalPackages.getCorePackage(villagerprofession, 0.5F));
@@ -160,7 +160,7 @@ index aa95cd7e04e25dec63c172d219f1f16cd6c9c4b5..8e2015fc122a93015482a81b2bbfa112
public boolean hasFarmSeeds() {
+ // Purpur start
+ if (this.level.purpurConfig.villagerClericsFarmWarts && this.getVillagerData().getProfession() == VillagerProfession.CLERIC) {
+ if (this.level().purpurConfig.villagerClericsFarmWarts && this.getVillagerData().getProfession() == VillagerProfession.CLERIC) {
+ return this.getInventory().hasAnyOf(ImmutableSet.of(Items.NETHER_WART));
+ }
+ // Purpur end

View File

@@ -12,7 +12,7 @@ index a7cd9d4f83a6e0df28818c55788cdc2db369dfac..dd21804bb62ad7ae2a086600d9cec7e6
@Override
public void openTextEdit(SignBlockEntity sign) {
+ if (level.purpurConfig.signAllowColors) this.connection.send(sign.getTranslatedUpdatePacket(textFilteringEnabled)); // Purpur
+ if (level().purpurConfig.signAllowColors) this.connection.send(sign.getTranslatedUpdatePacket(textFilteringEnabled)); // Purpur
sign.setAllowedPlayerEditor(this.getUUID());
this.connection.send(new ClientboundBlockUpdatePacket(this.level, sign.getBlockPos()));
this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos()));

View File

@@ -1290,7 +1290,7 @@ index bf5705551720d338ee0b790504727685b1f8f026..8e2274f7dce34e0997356205cf96e46f
super.aiStep();
- this.level.getProfiler().push("looting");
+ //this.level.getProfiler().push("looting"); // Purpur
if (!this.level.isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level.purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) {
if (!this.level.isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level().purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) {
Vec3i baseblockposition = this.getPickupReach();
List<ItemEntity> list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ()));
@@ -719,7 +719,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1704,7 +1704,7 @@ index 6f47f6c785dc8da6b211ac87630a3d83c42d1576..73cdb6b1793b264e1ec8ff51c4f82743
- this.level.getProfiler().push("villagerBrain");
+ //this.level.getProfiler().push("villagerBrain"); // Purpur
// Purpur start
if (this.level.purpurConfig.villagerLobotomizeEnabled) {
if (this.level().purpurConfig.villagerLobotomizeEnabled) {
// treat as inactive if lobotomized
@@ -357,7 +357,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
restock();