Fixed Issues & Extra details#1576
Fixed Issues & Extra details#1576LtxProgrammer merged 25 commits intoLtxProgrammer:0.15-featuresfrom
Conversation
…ecraft-Mod into 0.15-features
Separated client-side and server-side logic in the grab entity ability to ensure correct packet handling and entity interaction. Updated packet sending to use PacketDistributor on the server side and fixed conditional checks for entity grabbing.
|
i'm testing in a various contexts, and I'm trying to put together the most acceptable solution. For now, I'll try to implement a "steal grab" solution, but it's easy to create a simple "no grabbed rule" if you don't like that feature. |
added a simple check
|
there's a function that is not used but works.. i have almost sure that you will probably added but 10 times better tbh.. |
|
Possible Solutions for a "steal the grabber", please select one for me to follow
i really would love to see this feature in the mod, logically speaking nothing really stop a player to do that right? |
|
i follow the first option because i my opnion is the most okay to have. |
|
i'm thinking in make a "keyStrength" by more modular, maybe making into a method or getting a attribute for the player or just use the thorns enchantment applied into the math. |
clean up purifier screen code.
Introduces LightingBoltMixin to clear latex cover state when a lightning bolt strikes a block. Updates changed.mixins.json to include the new mixin, ensuring latex is removed due to shock vulnerability.
|
fixed infuser screen small issues and added a simple detail for when a latex cover state is stricken by lightning |
| RenderSystem.enableDepthTest(); | ||
| Font font = minecraft.font; | ||
| graphics.setColor(1.0F, 1.0F, 1.0F, this.alpha); | ||
| graphics.setColor(1.0F, 1.0F, 1.0F, 1.0f); |
There was a problem hiding this comment.
i change that to use a preset alpha because for some reason it was affecting the render, it may is because of my device soo idk
| } | ||
|
|
||
| public void renderWidget(GuiGraphics graphics, int p_93844_, int p_93845_, float p_93846_) { | ||
| super.renderWidget(graphics, p_93844_, p_93845_, p_93846_); |
There was a problem hiding this comment.
the widgets don't go well with stacks... and the "text" of the switch button was going in the way of the button switch
to be safe i just move the render to before the button render
|
|
||
| @Override | ||
| protected void updateWidgetNarration(NarrationElementOutput p_259858_) { | ||
| protected void updateWidgetNarration(@NotNull NarrationElementOutput p_259858_) { |
There was a problem hiding this comment.
inteliJ auto did that
| this.recipeBookComponent.init(this.width, this.height, this.minecraft, this.widthTooNarrow, this.menu); | ||
| this.leftPos = this.recipeBookComponent.updateScreenPosition(this.width, this.imageWidth); | ||
| this.addRenderableWidget(new ImageButton(this.leftPos + 16, this.height / 2 - 25, 20, 18, 0, 0, 19, RECIPE_BUTTON_LOCATION, (p_98484_) -> { | ||
| this.addRenderableWidget(new ImageButton(this.leftPos + 16, this.height / 2 - 30, 20, 18, 0, 0, 19, RECIPE_BUTTON_LOCATION, (p_98484_) -> { |
There was a problem hiding this comment.
i added a simple offset into the recipe book because it had a very odd position, being inside of the "player inventory label text"
fixed entity dimension not being sync
…d by Foxyas in #1576. Signed-off-by: LtxPgm <ltxprogrammer@outlook.com>
src/main/java/net/ltxprogrammer/changed/ability/GrabEntityAbilityInstance.java
Show resolved
Hide resolved
| @Inject(method = "powerLightningRod", at = @At("TAIL"), cancellable = false) | ||
| private void latexCoverIsStruckByLighting(CallbackInfo ci) { | ||
| // Latex is Weak to Shock, and a LightingBolt is a very powerful shock soo it die when struck by it | ||
| BlockPos strikePosition = this.getStrikePosition(); | ||
| Level level = level(); | ||
| LatexCoverState strikePositionCoverState = LatexCoverState.getAt(level, strikePosition); | ||
| if (strikePositionCoverState.isAir()) return; | ||
| LatexCoverState.setAtAndUpdate(level, strikePosition, ChangedLatexTypes.NONE.get().defaultCoverState()); |
There was a problem hiding this comment.
I like this idea as well. Perhaps it could be further developed to electrocute nearby latexes that are standing on (or are submerged within) latex cover.
There was a problem hiding this comment.
I will make a simple hook method in the LatexCoverState called "whenStuckByLighting" for such event, leaving it be by a single mixin wouldn't be that dynamic :)
There was a problem hiding this comment.
i did some changes and now the "shock" spreads through the latex because it is technically a fluid and also because the white latexes are almost 100% connected to it "fluid" which would make them feel the shock even when more far away.
Suggestions.
the player could be able to "hit" the latex cover state with a stun weapon to give any white latex nearby the shock effect for some seconds, also it could increase the nearby cover states saturation making it die after some time.
the latex cover state could have higher layer basing on it saturation being mapped with something like this.
higher (15) -> small puddle
lower (0) -> big puddle
|
Alright! I will resolve the conflict and try to apply a "shock area spread" for nearby white latexes and for players i will make a check to see if they are submerged near to the strike posision. Idk if it would be necessary much code because the thunder already has a bit hitbox soo i would just make a loop that would go through afew cover stats until find a entity or reach "max depth" |
| public static void syncEntityPosRotWithEntity(LivingEntity set, LivingEntity get) { | ||
| if (get.level() instanceof ServerLevel getServerLevel) { | ||
| Level setLevel = set.level(); | ||
| if (getServerLevel.dimension().equals(setLevel.dimension())) set.changeDimension(getServerLevel); |
There was a problem hiding this comment.
A dimension Sync with a small check to avoid calling when not necessary
There was a problem hiding this comment.
I forgot to comment on this when I saw it, but the code to change dimensions will only run when the two entities are in the same dimension (getServerLevel.dimension().equals(setLevel.dimension())). Additionally, an ITeleporter can be defined to specify certain teleport info (positioning, teleport sound).
There was a problem hiding this comment.
Also, you can just do a reference equality check between the two levels: getServerLevel != set.level(). In the context of the server, each dimension has its' own ServerLevel object. Therefor, if two entities are in the same level, then they are in the same dimension.
There was a problem hiding this comment.
Lastly, there may need to be special case handling code where Minecraft will replace an entity reference with a new entity on .changeDimension(), invalidating the grabbed entity reference. Though this shouldn't happen with grabbed players.
There was a problem hiding this comment.
to avoid doing something that may become spaghetti code i will leave that for you.
|
the re-requesta was a miss click |
|
check it out now, |
|
i added more range for the entity detection. i think that there's no problem in having a higher hitbox to detect entities. the check to see if they are or not touching the latex cover already take cares of the logic to who will get the damage |
|
funny ahh behavior |
Refactored LatexType to trigger a stun animation when entities are shocked and fixed logic for latex removal on lightning strike. Updated LightingBoltMixin to intercept fire spawning and cancel it if latex cover is present, ensuring correct latex cover behavior when struck by lightning.
removed not used imports
LtxProgrammer
left a comment
There was a problem hiding this comment.
I'll make some adjustments in LatexType and TransfurVariantInstance.
Proposed Changes