Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0272304
Update GrabEntityAbilityInstance.java
Foxyas Jan 4, 2026
292178e
Merge branch '0.15-features' of https://github.com/Foxyas/Changed-Min…
Foxyas Jan 4, 2026
cec5384
Update GrabEntityAbilityInstance.java
Foxyas Jan 5, 2026
a56249a
Fix grab entity logic for client and server sides
Foxyas Jan 5, 2026
ef5bd24
Update GrabEntityAbilityInstance.java
Foxyas Jan 5, 2026
daf511a
Update GrabEntityAbilityInstance.java
Foxyas Jan 5, 2026
9616a08
Update GrabEntityAbilityInstance.java
Foxyas Jan 5, 2026
5ce43af
Update GrabEntityAbilityInstance.java
Foxyas Jan 5, 2026
f7bc75d
Merge branch 'LtxProgrammer:0.15-features' into 0.15-features
Foxyas Jan 6, 2026
20b7aa4
fixed issue with gender button on infuser screen
Foxyas Jan 6, 2026
d4ad050
Add LightningBolt mixin to remove latex on strike
Foxyas Jan 6, 2026
b168924
Update InfuserScreen.java
Foxyas Jan 6, 2026
4078dd3
Update TransfurVariantInstance.java
Foxyas Jan 8, 2026
8f89832
Merge branch '0.15-features' into 0.15-features
Foxyas Jan 10, 2026
5e26bd2
Update TransfurVariantInstance.java
Foxyas Jan 10, 2026
416a9a5
tweaks
Foxyas Jan 10, 2026
4ba44d9
Update LatexType.java
Foxyas Jan 10, 2026
ef2cb77
Improve latex cover reaction to lightning strikes
Foxyas Jan 10, 2026
3b6f409
updated maven
Foxyas Jan 10, 2026
e965b1a
Merge branch 'LtxProgrammer:0.15-features' into 0.15-features
Foxyas Jan 14, 2026
b23b575
Update GrabEntityAbilityInstance.java
Foxyas Jan 14, 2026
e1ff153
Update LatexType.java
Foxyas Jan 14, 2026
0acd23c
updated maven
Foxyas Jan 14, 2026
e839b98
Merge branch 'LtxProgrammer:0.15-features' into 0.15-features
Foxyas Jan 16, 2026
3b93774
updated maven
Foxyas Jan 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<versions>
<version>v0.15.0</version>
</versions>
<lastUpdated>20260109173049</lastUpdated>
<lastUpdated>20260116142425</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fff27e0d7ae0c68144403d5c1abee224
fce3db3665c838dddd2ee7d5d8bae949
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2ff003f7f3970778df4663f653addcbca05b2436
dae01136496d17e71cfdce997fb3fde1bfbc487c
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6dee6aa09748cee00cf95e083e350e34c92158f025ef17a678bd901e8f2ba0d3
b7736c92fd24fcb1ff254c17edb15a5b12c86be2809de48bb48ed617e206e8a6
Original file line number Diff line number Diff line change
@@ -1 +1 @@
975a307243179d593332897ffca2e626c8b53ad638277a16d80c5b23e909c7f176371a1d2d78e4fa0b77e87336d402eb1a5444aa1dbb30a92f8c13b3f92bd306
0d33f144f82836fa278fad18d6477d8ad65cda37a9aa26a4bc1ae355a1d9958832f8226383bfc981cc2c60e7a95974ab11a7de39814f5b920f7fa8a3143c6654
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2279401ea52d170347e8b704e867cda1
18805301af5d583f22c957da7549025f
Original file line number Diff line number Diff line change
@@ -1 +1 @@
86df9c3267c56a304d407617e43467a53009e093
5bb28b3294425a3a695493583fbad0f9da23a1ba
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0bb8a61e1f51c37211d2631c5f85f1cfe53cdea2fb53703b0988d0cf27967ccd
9d84813198a7a80225c82966f9d290c457f97a25bcf9f327e74f02ba9ae4817b
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d344aa159574bd0b06e5d19710adfa7b4bc24cfbf68b4984f0450c53645dbf71df4d0ad05f401695abd6728a94b7411659847e7fd28e90c75244b916ee3bcd91
fb009d0f3dc21ba051d94674f2d09984471f0edc3ef654becd4eb0e5c09a59591297d199cadc29433f2d74f2146765c6aab4743f2f4f0a5be2ff0605ace548c5
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.minecraft.util.Mth;
import net.minecraft.world.entity.player.Inventory;
import net.minecraftforge.network.PacketDistributor;
import org.jetbrains.annotations.NotNull;

public class InfuserScreen extends AbstractContainerScreen<InfuserMenu> implements RecipeUpdateListener {
public static class Switch extends AbstractButton {
Expand Down Expand Up @@ -57,22 +58,21 @@ public Switch(AbstractContainerScreen<?> container, ResourceLocation name,
}

public void renderWidget(GuiGraphics graphics, int p_93844_, int p_93845_, float p_93846_) {
super.renderWidget(graphics, p_93844_, p_93845_, p_93846_);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Minecraft minecraft = Minecraft.getInstance();
RenderSystem.setShaderTexture(0, sheet);
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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.enableDepthTest();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
int switchX = this.isHoveredOrFocused() ? this.width : 0;
int switchY = this.disabled ? this.height * 2 : (this.toggle ? this.height : 0);
graphics.blit(sheet, this.getX(), this.getY(), switchX, switchY, this.width, this.height, this.width * 2, this.height * 3);
super.renderWidget(graphics, p_93844_, p_93845_, p_93846_);
}

@Override
protected void updateWidgetNarration(NarrationElementOutput p_259858_) {
protected void updateWidgetNarration(@NotNull NarrationElementOutput p_259858_) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inteliJ auto did that

this.defaultButtonNarrationText(p_259858_);
}

Expand All @@ -98,15 +98,16 @@ protected void init() {
this.widthTooNarrow = this.width < 379;
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_) -> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added a simple offset into the recipe book because it had a very odd position, being inside of the "player inventory label text"

this.recipeBookComponent.toggleVisibility();
this.leftPos = this.recipeBookComponent.updateScreenPosition(this.width, this.imageWidth);
((ImageButton)p_98484_).setPosition(this.leftPos + 16, this.height / 2 - 25);
p_98484_.setPosition(this.leftPos + 16, this.height / 2 - 30);
maleFemaleSwitch.setPosition(this.leftPos + 135, this.topPos + 61);
}));
this.addWidget(this.recipeBookComponent);
this.setInitialFocus(this.recipeBookComponent);
this.titleLabelX = 29;
this.titleLabelX = 5;
this.titleLabelY = 5;

maleFemaleSwitch = new Switch(this, Changed.modResource("male_female_switch"), this.leftPos + 135, this.topPos + 61, 20, 10, Component.empty(), false,
GENDER_SWITCH_LOCATION);
Expand All @@ -116,12 +117,9 @@ protected void init() {
private static final ResourceLocation texture = Changed.modResource("textures/gui/infuser.png");

@Override
public void render(GuiGraphics graphics, int p_98480_, int p_98481_, float p_98482_) {
public void render(@NotNull GuiGraphics graphics, int p_98480_, int p_98481_, float p_98482_) {
var variant = Syringe.getVariant(menu.getResultSlot().getItem());
if (variant != null && !variant.isGendered())
maleFemaleSwitch.disabled = true;
else
maleFemaleSwitch.disabled = false;
maleFemaleSwitch.disabled = variant != null && !variant.isGendered();

this.renderBackground(graphics);
if (this.recipeBookComponent.isVisible() && this.widthTooNarrow) {
Expand Down Expand Up @@ -170,7 +168,7 @@ public void recipesUpdated() {
}

@Override
public RecipeBookComponent getRecipeBookComponent() {
public @NotNull RecipeBookComponent getRecipeBookComponent() {
return this.recipeBookComponent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import org.jetbrains.annotations.NotNull;

public class PurifierScreen extends AbstractContainerScreen<PurifierMenu> {
private final PurifierMenu menu;
Expand All @@ -25,7 +26,7 @@ public PurifierScreen(PurifierMenu menu, Inventory inventory, Component text) {
private static final ResourceLocation texture = Changed.modResource("textures/gui/purifier.png");

@Override
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
public void render(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(graphics);
super.render(graphics, mouseX, mouseY, partialTicks);
this.renderTooltip(graphics, mouseX, mouseY);
Expand All @@ -42,7 +43,7 @@ protected void renderBg(GuiGraphics graphics, float partialTicks, int gx, int gy
graphics.blit(Changed.modResource("textures/gui/progress_bar_back.png"), this.leftPos + 63, this.topPos + 62, 0, 0, 48, 12, 48, 12);

var slot = menu.slots.get(0);
float progress = (float)menu.data.get(0) / (float) PurifierBlockEntity.getTotalProgress(this.minecraft.level.getRecipeManager(), slot.getItem());
float progress = (float)menu.data.get(0) / PurifierBlockEntity.getTotalProgress(this.minecraft.level.getRecipeManager(), slot.getItem());
graphics.blit(Changed.modResource("textures/gui/progress_bar_front.png"), this.leftPos + 63, this.topPos + 62, 0, 0, (int)(48 * progress), 12, 48, 12);

RenderSystem.disableBlend();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package net.ltxprogrammer.changed.entity.latex;

import net.ltxprogrammer.changed.block.WhiteLatexTransportInterface;
import net.ltxprogrammer.changed.entity.ChangedEntity;
import net.ltxprogrammer.changed.entity.TransfurCause;
import net.ltxprogrammer.changed.entity.animation.StunAnimationParameters;
import net.ltxprogrammer.changed.entity.beast.PureWhiteLatexWolf;
import net.ltxprogrammer.changed.entity.beast.WhiteLatexEntity;
import net.ltxprogrammer.changed.entity.beast.boss.Behemoth;
import net.ltxprogrammer.changed.entity.variant.TransfurVariant;
import net.ltxprogrammer.changed.init.ChangedLootContextParamSets;
import net.ltxprogrammer.changed.init.ChangedRegistry;
import net.ltxprogrammer.changed.entity.variant.TransfurVariantInstance;
import net.ltxprogrammer.changed.init.*;
import net.ltxprogrammer.changed.item.AbstractLatexBucket;
import net.ltxprogrammer.changed.process.ProcessTransfur;
import net.ltxprogrammer.changed.util.EntityUtil;
import net.ltxprogrammer.changed.world.LatexCoverGetter;
import net.ltxprogrammer.changed.world.LatexCoverState;
Expand All @@ -19,8 +25,10 @@
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LightningBolt;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
Expand All @@ -37,6 +45,7 @@
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext;
Expand All @@ -46,6 +55,7 @@
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;

public abstract class LatexType {
Expand Down Expand Up @@ -95,6 +105,42 @@ public void onPlace(LatexCoverState state, Level level, BlockPos blockPos, Latex

public void onRemove(LatexCoverState state, Level level, BlockPos blockPos, LatexCoverState oldState, boolean flag) {}

public void onStruckByLighting(LatexCoverState strikePositionCoverState, Level level, BlockPos strikePosition, LightningBolt lightningBolt) {
if (!level.isClientSide() && level instanceof ServerLevel serverLevel) {
Set<LatexCoverState.LatexNode> latexNodes = LatexCoverState.collectConnectedLatex(serverLevel, strikePosition, 16);

List<LivingEntity> entities = level.getEntitiesOfClass(
LivingEntity.class,
new AABB(strikePosition).inflate(24),
entity -> entity instanceof PureWhiteLatexWolf || entity instanceof Behemoth
|| ProcessTransfur.getPlayerTransfurVariantSafe(EntityUtil.playerOrNull(entity)).map(TransfurVariantInstance::getChangedEntity).orElse(null) instanceof WhiteLatexEntity
);
for (LivingEntity living : entities) {
boolean entityInWhiteLatex = WhiteLatexTransportInterface.isEntityInWhiteLatex(living);
if (entityInWhiteLatex || latexNodes.stream().map(LatexCoverState.LatexNode::pos).anyMatch((pos -> living.blockPosition().equals(pos)))) {
if (living.addEffect(
new MobEffectInstance(
ChangedEffects.SHOCK.get(),
20 * 4, // 4 seconds
0,
true, // can be considered "ambient" in this context
true // can bee seen by the player
)
)) {
ChangedAnimationEvents.broadcastEntityAnimation(living, ChangedAnimationEvents.SHOCK_STUN.get(), StunAnimationParameters.INSTANCE);
}
}
}

// Latex is Weak to Shock, and a LightingBolt is a very powerful shock soo it die when struck by it
if (strikePositionCoverState.isAir()) return;
LatexCoverState.setAtAndUpdate(level, strikePosition, ChangedLatexTypes.NONE.get().defaultCoverState());
for (Direction value : Direction.values()) {
LatexCoverState.setAtAndUpdate(level, strikePosition.relative(value), ChangedLatexTypes.NONE.get().defaultCoverState()); // Cross like removal
}
}
}

public void animateTick(LatexCoverState state, Level level, BlockPos pos, RandomSource random) {}

public abstract ResourceLocation getLootTable();
Expand Down Expand Up @@ -201,11 +247,11 @@ public Object getRenderPropertiesInternal() {
public void initializeClient(Consumer<IClientLatexTypeExtensions> consumer) {}

public void randomTick(LatexCoverState state, ServerLevel level, BlockPos blockPos, RandomSource random) {}

public void entityInside(LatexCoverState state, Level level, BlockPos blockPos, Entity entity) {}

public void spawnAfterBreak(LatexCoverState state, ServerLevel level, BlockPos blockPos, ItemStack itemStack, boolean dropXp) {}

public List<ItemStack> getDrops(LatexCoverState coverState, LootParams.Builder builder) {
ResourceLocation resourcelocation = this.getLootTable();
if (resourcelocation == BuiltInLootTables.EMPTY) {
Expand Down Expand Up @@ -323,4 +369,4 @@ public boolean isAir() {
return true;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.stats.Stats;
import net.minecraft.tags.FluidTags;
Expand All @@ -38,6 +39,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.ForgeMod;
Expand Down Expand Up @@ -539,6 +541,11 @@ protected double clamp(double min, double max, double x) {
}

public static void syncEntityPosRotWithEntity(LivingEntity set, LivingEntity get) {
if (get.level() instanceof ServerLevel getServerLevel) {
Level setLevel = set.level();
if (getServerLevel != setLevel) set.changeDimension(getServerLevel);
}

set.setDeltaMovement(get.getDeltaMovement());
set.setPos(get.getX(), get.getY(), get.getZ());
set.setXRot(get.getXRot());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package net.ltxprogrammer.changed.mixin.entity;

import net.ltxprogrammer.changed.init.ChangedLatexTypes;
import net.ltxprogrammer.changed.world.LatexCoverState;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LightningBolt;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LightningRodBlock;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(LightningBolt.class)
public abstract class LightingBoltMixin extends Entity {
@Shadow protected abstract BlockPos getStrikePosition();

public LightingBoltMixin(EntityType<?> entityType, Level level) {
super(entityType, level);
}

@Inject(method = "spawnFire", at = @At("HEAD"), cancellable = true) // This trigger is better
private void latexCoverIsStruckByLighting(CallbackInfo ci) {
BlockPos strikePosition = this.getStrikePosition();
Level level = level();
LatexCoverState strikePositionCoverState = LatexCoverState.getAt(level, strikePosition);
LightningBolt self = (LightningBolt) (Object) this;
if (!strikePositionCoverState.isAir()) {
ci.cancel();
strikePositionCoverState.onStruckByLighting(level, strikePosition, self);
}
}
}
Loading