Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/VazkiiMods/Quark
Browse files Browse the repository at this point in the history
  • Loading branch information
MehVahdJukaar committed Aug 15, 2023
2 parents 3b69f16 + dd45fcf commit 2c9f651
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 126 deletions.
15 changes: 13 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'pmd'

jarJar.enable()

ext.configFile = file('build.properties')
ext.depsFile = file('dependencies.properties')
ext.config = parseConfig(configFile)
Expand Down Expand Up @@ -169,8 +171,7 @@ def parseConfig(File config) {
}

jar {
//rename the default output, for some better... sanity with scipts
archiveName = "${baseName}-${version}.${extension}"
classifier "pure" // Jar without jar-in-jar

manifest {
attributes([
Expand Down Expand Up @@ -202,6 +203,16 @@ task deobfJar(type: Jar) {
from sourceSets.main.output
}

tasks.jarJar.configure {
classifier "" // "Main" jar should be the one with jar-in-jar

exclude "**/*.bat"
exclude "**/*.psd"
exclude "**/*.exe"
exclude "**/unused"
exclude "**/genscripts"
}

artifacts {
archives sourcesJar
archives deobfJar
Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#Mon Aug 14 22:44:07 UTC 2023
#Tue Aug 15 18:18:48 UTC 2023
mapping_version=1.19.2
version=3.4
mod_name=Quark
mc_version=1.19.2
mapping_channel=official
mod_id=quark
build_number=407
build_number=410
dir_output=../Build Output/Quark/
59 changes: 3 additions & 56 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,56 +1,3 @@
- New Feature: Maps can now be washed on a cauldron, reverting them to blank maps
- New Feature: Rainbow Lamps, made of corundum by default, redstone powered, can color beacons when powered
- Added a config option for pathfinders quills to try and search again if they fail
- Added a config option to alter the activation range of monster boxes
- Added a game nerf option to prevent large mushroom from destroying blocks
- Added a new config option for additional "baked" enchantments such as gold tools having fortune
- Added an allow list config to the pat module
- Added config option to change the hoe harvesting radius
- Added new sorting logic for potions and tipped arrows
- Added scroll interaction for bundles to change the "front" item
- Added some more JEI hints
- Added support for the Lootr mod for quark chest variants
- Added translation keys for quark tags in EMI
- Attribute tooltips will no longer show attribute up/downgrade if the held item doesn't match the type
- Attribute tooltips will now show any additional attributes not present on the held item you'd lose by switching to it
- Bees will no longer randomly change sweaters when entering and exiting beehives
- Crabs can now be placed in buckets
- Crabs will no longer take damage from cacti or berry bushes (they are unprickable)
- Decoupled vertical slab blocks from quark module system logic so other mods can extend them easier
- Fixed a potential memory leak
- Fixed backpacks being enchantable
- Fixed cloud block and monster box not being pick block-able
- Fixed compass logic for lodestones being incorrect and working across dimensions
- Fixed crash when loading the slabs to blocks map
- Fixed crash when shift clicking items with pending enchants into matrix enchanting
- Fixed crash with dispensers placing blocks when placing mob heads
- Fixed crash with monster box when the loot table is incorrect
- Fixed encasing copper pipes in creative mode consuming the glass block
- Fixed expanded item interactions shulker incompatibility with Inventorio
- Fixed glass item frames not rendering properly on top of signs
- Fixed having mending nerf enabled allowing for incompatible enchantments to be applied to items
- Fixed incorrect enchantment application logic in matrix enchanting allowing some other mod enchantments to end up on the wrong items
- Fixed incorrect simple harvest behavior with several modded crops
- Fixed light gray rune recipe producing gray runes
- Fixed potential dupes alongside mods that increase shulker box stack size
- Fixed Potion of Stability not hiding itself from JEI when disabled
- Fixed rotation lock message appearing more often than intended
- Fixed seed pouch retaining item count after being emptied
- Fixed sharing items with a section sign in the name kicking the player
- Fixed Simple Harvest reducing yield on crops that drop multiple different items
- Fixed the enchantments begone experimental module not removing enchantments from enchanting tables
- Fixed torch dupe with multishot torch arrows
- Fixed vertical slabs not inheriting block colors
- Fixed weird offhand interaction with pathfinders quill
- Food crates now have the storage_block tag
- Giant crabs can now be ridden
- Grates can now be crawled under, similarly to hollow logs
- JEI candle influences will now only show items that can receive the enchantment in question
- Lootr blocks are now immune to iron rods
- Removed all Redirect mixins, thus ensuring much better compatibility with other mods using mixins on the same targets
- Removed all RETURN mixin cancellations, opting to cancel at HEAD instead (again, better compatibility)
- Rewrote most of the mod's mixins to use MixinExtras
- Shift clicking items in the player's inventory when a backpack is held now prioritizes moving onto the backpack over the hotbar
- Updated sorting logic to be fully deterministic
- Updated the chest variant textures with new ones by dani
- Villagers can now use simple harvest
- Fixed crash with Rubidium
- Fixed having pat all mobs enabled toggling sitting
- Optimized item share packet size
1 change: 1 addition & 0 deletions contributors.properties
Original file line number Diff line number Diff line change
Expand Up @@ -887,3 +887,4 @@ JLJarvis=1
jdpaboojian=2
TheIronArcher49=1
eliteminecraft99=1
KevinKebab=2
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package vazkii.quark.base.network.message;

import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.LastSeenMessages;
import net.minecraft.network.chat.MessageSignature;
import net.minecraft.server.level.ServerPlayer;
Expand All @@ -19,7 +18,6 @@ public class ShareItemMessage implements IMessage {

public ItemStack stack;
public String message;
public Component component;
public Instant timeStamp;
public long salt;
public MessageSignature signature;
Expand All @@ -28,10 +26,9 @@ public class ShareItemMessage implements IMessage {

public ShareItemMessage() { }

public ShareItemMessage(ItemStack stack, String message, Component component, Instant timeStamp, long salt, MessageSignature signature, boolean signedPreview, LastSeenMessages.Update lastSeenMessages) {
public ShareItemMessage(ItemStack stack, String message, Instant timeStamp, long salt, MessageSignature signature, boolean signedPreview, LastSeenMessages.Update lastSeenMessages) {
this.stack = stack;
this.message = message;
this.component = component;
this.timeStamp = timeStamp;
this.salt = salt;
this.signature = signature;
Expand All @@ -43,7 +40,7 @@ public ShareItemMessage(ItemStack stack, String message, Component component, In
public boolean receive(Context context) {
ServerPlayer player = context.getSender();
if (player != null && player.server != null)
context.enqueueWork(() -> ItemSharingModule.shareItem(player, message, component, stack, timeStamp, salt, signature, signedPreview, lastSeenMessages));
context.enqueueWork(() -> ItemSharingModule.shareItem(player, message, stack, timeStamp, salt, signature, signedPreview, lastSeenMessages));

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public boolean clicc() {
LastSeenMessages.Update update = mc.player.connection.generateMessageAcknowledgements();
MessageSignature signature = accessorLocalPlayer.quark$signMessage(sign, content, update.lastSeen());

ShareItemMessage message = new ShareItemMessage(stack, content.plain(), content.decorated(), sign.timeStamp(), sign.salt(), signature, content.isDecorated(), update);
ShareItemMessage message = new ShareItemMessage(stack, content.plain(), sign.timeStamp(), sign.salt(), signature, content.isDecorated(), update);
QuarkNetwork.sendToServer(message);

return true;
Expand All @@ -145,19 +145,15 @@ public boolean clicc() {
return false;
}

public static void shareItem(ServerPlayer player, String message, Component component, ItemStack stack, Instant timeStamp, long salt, MessageSignature signature, boolean signedPreview, LastSeenMessages.Update lastSeenMessages) {
public static void shareItem(ServerPlayer player, String message, ItemStack stack, Instant timeStamp, long salt, MessageSignature signature, boolean signedPreview, LastSeenMessages.Update lastSeenMessages) {
if (!ModuleLoader.INSTANCE.isModuleEnabled(ItemSharingModule.class))
return;

Component itemComp = stack.getDisplayName();

// This is done to ensure that arbitrary components can't be sent - only the stack's component.
// Component is checked on this side to ensure the signing was of the correct component.
if (itemComp.equals(component)) {
((AccessorServerGamePacketListenerImpl) player.connection).quark$chatPreviewCache().set(message, itemComp);
((AccessorServerGamePacketListenerImpl) player.connection).quark$chatPreviewCache().set(message, itemComp);

player.connection.handleChat(new ServerboundChatPacket(message, timeStamp, salt, signature, signedPreview, lastSeenMessages));
}
player.connection.handleChat(new ServerboundChatPacket(message, timeStamp, salt, signature, signedPreview, lastSeenMessages));
}

public static MutableComponent createStackComponent(ItemStack stack, MutableComponent component) {
Expand Down
105 changes: 53 additions & 52 deletions src/main/java/vazkii/quark/content/tweaks/module/PatTheDogsModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,72 +80,73 @@ public void onInteract(PlayerInteractEvent.EntityInteract event) {
} else if (event.getTarget() instanceof LivingEntity living &&
(petAllMobs || living instanceof Player || pettableAllowlist.contains(living.getEncodeId())) &&
!pettableDenylist.contains(living.getEncodeId())) {
if (event.getHand() == InteractionHand.MAIN_HAND) {
SoundEvent sound = null;
float pitchCenter = 1f;
if (living instanceof Axolotl) {
sound = SoundEvents.AXOLOTL_SPLASH;
} else if (living instanceof Cat || living instanceof Ocelot) {
sound = SoundEvents.CAT_PURREOW;
} else if (living instanceof Chicken) {
sound = SoundEvents.CHICKEN_AMBIENT;
} else if (living instanceof Cow) {
sound = SoundEvents.COW_AMBIENT;
pitchCenter = 1.2f;
} else if (living instanceof AbstractHorse) {
sound = SoundEvents.HORSE_AMBIENT;
} else if (living instanceof AbstractFish) {
sound = SoundEvents.FISH_SWIM;
} else if (living instanceof Fox) {
sound = SoundEvents.FOX_SLEEP;
} else if (living instanceof Squid) {
sound = (living instanceof GlowSquid) ?
SoundEvents.GLOW_SQUID_SQUIRT : SoundEvents.SQUID_SQUIRT;
pitchCenter = 1.2f;
} else if (living instanceof Parrot) {
sound = SoundEvents.PARROT_AMBIENT;
} else if (living instanceof Pig) {
sound = SoundEvents.PIG_AMBIENT;
} else if (living instanceof Rabbit) {
sound = SoundEvents.RABBIT_AMBIENT;
} else if (living instanceof Sheep) {
sound = SoundEvents.SHEEP_AMBIENT;
} else if (living instanceof Strider) {
sound = SoundEvents.STRIDER_HAPPY;
} else if (living instanceof Turtle) {
sound = SoundEvents.TURTLE_AMBIENT_LAND;
} else if (living instanceof Player pettee) {
var uuid = pettee.getStringUUID();
sound = switch (uuid) {
case "a2ce9382-2518-4752-87b2-c6a5c97f173e" -> // petra_the_kat
QuarkSounds.PET_DEVICE;
case "29a10dc6-a201-4993-80d8-c847212bc92b", // MacyMacerator
"d30d8e38-6f93-4d96-968d-dd6ec5596941" -> // Falkory220
QuarkSounds.PET_NEKO;
case "d475af59-d73c-42be-90ed-f1a78f10d452" -> // DaniCherryJam
QuarkSounds.PET_SLIME;
case "458391f5-6303-4649-b416-e4c0d18f837a" -> // yrsegal
QuarkSounds.PET_WIRE;
default -> null;
};
}
if (sound != null) {
SoundEvent sound = null;
float pitchCenter = 1f;
if (living instanceof Axolotl) {
sound = SoundEvents.AXOLOTL_SPLASH;
} else if (living instanceof Cat || living instanceof Ocelot) {
sound = SoundEvents.CAT_PURREOW;
} else if (living instanceof Chicken) {
sound = SoundEvents.CHICKEN_AMBIENT;
} else if (living instanceof Cow) {
sound = SoundEvents.COW_AMBIENT;
pitchCenter = 1.2f;
} else if (living instanceof AbstractHorse) {
sound = SoundEvents.HORSE_AMBIENT;
} else if (living instanceof AbstractFish) {
sound = SoundEvents.FISH_SWIM;
} else if (living instanceof Fox) {
sound = SoundEvents.FOX_SLEEP;
} else if (living instanceof Squid) {
sound = (living instanceof GlowSquid) ?
SoundEvents.GLOW_SQUID_SQUIRT : SoundEvents.SQUID_SQUIRT;
pitchCenter = 1.2f;
} else if (living instanceof Parrot) {
sound = SoundEvents.PARROT_AMBIENT;
} else if (living instanceof Pig) {
sound = SoundEvents.PIG_AMBIENT;
} else if (living instanceof Rabbit) {
sound = SoundEvents.RABBIT_AMBIENT;
} else if (living instanceof Sheep) {
sound = SoundEvents.SHEEP_AMBIENT;
} else if (living instanceof Strider) {
sound = SoundEvents.STRIDER_HAPPY;
} else if (living instanceof Turtle) {
sound = SoundEvents.TURTLE_AMBIENT_LAND;
} else if (living instanceof Player pettee) {
var uuid = pettee.getStringUUID();
sound = switch (uuid) {
case "a2ce9382-2518-4752-87b2-c6a5c97f173e" -> // petra_the_kat
QuarkSounds.PET_DEVICE;
case "29a10dc6-a201-4993-80d8-c847212bc92b", // MacyMacerator
"d30d8e38-6f93-4d96-968d-dd6ec5596941" -> // Falkory220
QuarkSounds.PET_NEKO;
case "d475af59-d73c-42be-90ed-f1a78f10d452" -> // DaniCherryJam
QuarkSounds.PET_SLIME;
case "458391f5-6303-4649-b416-e4c0d18f837a" -> // yrsegal
QuarkSounds.PET_WIRE;
default -> null;
};
}
if (sound != null) {
if (event.getHand() == InteractionHand.MAIN_HAND) {
if (player.level instanceof ServerLevel serverLevel) {
var pos = living.getEyePosition();
serverLevel.sendParticles(ParticleTypes.HEART, pos.x, pos.y + 0.5, pos.z, 1, 0, 0, 0, 0.1);

living.playSound(sound, 1F, pitchCenter + (float) (Math.random() - 0.5) * 0.5F);
} else player.swing(InteractionHand.MAIN_HAND);

event.setCanceled(true);
}

event.setCanceled(true);
}
}
}
}




@SubscribeEvent
public void onTame(AnimalTameEvent event) {
if(event.getAnimal() instanceof Wolf wolf) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static RenderType getEntityGlintDirect(RenderType prev) {
return ColorRunesModule.getEntityGlintDirect();
}

@ModifyConstant(method = "renderQuadList", constant = @Constant(floatValue = 1F))
@ModifyConstant(method = "renderQuadList", constant = @Constant(floatValue = 1F), require = 0) // Allow failure in case of rubidium
public float renderQuads(float constant) {
return ItemSharingModule.alphaValue * constant;
}
Expand Down

0 comments on commit 2c9f651

Please sign in to comment.