Skip to content

Commit

Permalink
fix #1048
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexModGuy committed May 3, 2024
1 parent a5dd875 commit 2e8fc8b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ public void setBossBarRender(UUID bossBar, int renderType) {
}

public void renderVanillaMapDecoration(MapDecoration mapDecoration, int index){
ClientEvents.renderVanillaMapDecoration(mapDecoration, index);
ClientEvents.renderVanillaMapDecoration(mapDecoration, index + 1);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@

public class ClientEvents {

public static final ResourceLocation POTION_EFFECT_HUD_OVERLAYS = new ResourceLocation(AlexsCaves.MODID, "textures/misc/potion_effect_hud_overlays.png");
public static final ResourceLocation BOSS_BAR_HUD_OVERLAYS = new ResourceLocation(AlexsCaves.MODID, "textures/misc/boss_bar_hud_overlays.png");
public static final ResourceLocation DINOSAUR_HUD_OVERLAYS = new ResourceLocation(AlexsCaves.MODID, "textures/misc/dinosaur_hud_overlays.png");
public static final ResourceLocation ARMOR_HUD_OVERLAYS = new ResourceLocation(AlexsCaves.MODID, "textures/misc/armor_hud_overlays.png");
private static final ResourceLocation POTION_EFFECT_HUD_OVERLAYS = new ResourceLocation(AlexsCaves.MODID, "textures/misc/potion_effect_hud_overlays.png");
private static final ResourceLocation BOSS_BAR_HUD_OVERLAYS = new ResourceLocation(AlexsCaves.MODID, "textures/misc/boss_bar_hud_overlays.png");
private static final ResourceLocation DINOSAUR_HUD_OVERLAYS = new ResourceLocation(AlexsCaves.MODID, "textures/misc/dinosaur_hud_overlays.png");
private static final ResourceLocation ARMOR_HUD_OVERLAYS = new ResourceLocation(AlexsCaves.MODID, "textures/misc/armor_hud_overlays.png");
private static final ResourceLocation SUBMARINE_SHADER = new ResourceLocation(AlexsCaves.MODID, "shaders/post/submarine_light.json");
private static final ResourceLocation WATCHER_SHADER = new ResourceLocation(AlexsCaves.MODID, "shaders/post/watcher_perspective.json");
private static final ResourceLocation TRAIL_TEXTURE = new ResourceLocation(AlexsCaves.MODID, "textures/particle/teletor_trail.png");
Expand All @@ -94,6 +94,11 @@ public class ClientEvents {
private static Vec3 lastSampledFogColor = Vec3.ZERO;
private static Vec3 lastSampledWaterFogColor = Vec3.ZERO;

public static PoseStack lastVanillaMapPoseStack;
public static MultiBufferSource lastVanillaMapRenderBuffer;
public static int lastVanillaMapRenderPackedLight;
private static final RenderType UNDERGROUND_CABIN_MAP_ICONS = RenderType.text(new ResourceLocation(AlexsCaves.MODID, "textures/misc/underground_cabin_map_icons.png"));

@SubscribeEvent
public void setupEntityRotations(EventLivingRenderer.SetupRotations event) {
if (event.getEntity() instanceof MagneticEntityAccessor magnetic) {
Expand Down Expand Up @@ -1006,11 +1011,6 @@ public void outlineColor(EventGetOutlineColor event) {
}
}

public static PoseStack lastVanillaMapPoseStack;
public static MultiBufferSource lastVanillaMapRenderBuffer;
public static int lastVanillaMapRenderPackedLight;
static final RenderType UNDERGROUND_CABIN_MAP_ICONS = RenderType.text(new ResourceLocation(AlexsCaves.MODID, "textures/misc/underground_cabin_map_icons.png"));

public static void renderVanillaMapDecoration(MapDecoration mapdecoration, int k) {
if(mapdecoration.getType() == ACVanillaMapUtil.UNDERGROUND_CABIN_MAP_DECORATION){
MultiBufferSource multiBufferSource = lastVanillaMapRenderBuffer == null ? Minecraft.getInstance().renderBuffers().bufferSource() : lastVanillaMapRenderBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.minecraft.world.Difficulty;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.control.MoveControl;
Expand Down Expand Up @@ -157,7 +158,7 @@ public void tick() {
if (this.getSummonTime() > 0) {
if (summonedProgress < 20.0F) {
if (summonedProgress == 0) {
if(!level().isClientSide){
if (!level().isClientSide) {
this.level().broadcastEntityEvent(this, (byte) 61);
}
this.playSound(ACSoundRegistry.MAGIC_CONCH_SUMMON.get());
Expand All @@ -170,11 +171,11 @@ public void tick() {
}
}
if (getSummonTime() > 0) {
if(!level().isClientSide){
if (!level().isClientSide) {
setSummonTime(getSummonTime() - 1);
}
if (getSummonTime() == 0) {
if(!level().isClientSide){
if (!level().isClientSide) {
this.level().broadcastEntityEvent(this, (byte) 61);
}
this.playSound(ACSoundRegistry.MAGIC_CONCH_SUMMON.get());
Expand Down Expand Up @@ -467,6 +468,11 @@ public void calculateEntityAnimation(boolean flying) {
}
}

@Override
public boolean isInvulnerableTo(DamageSource damageSource) {
return super.isInvulnerableTo(damageSource) || damageSource.is(DamageTypes.IN_WALL);
}

@Override
public boolean hurt(DamageSource damageSource, float damageValue) {
boolean sup = super.hurt(damageSource, damageValue);
Expand Down Expand Up @@ -541,11 +547,11 @@ protected void checkAndDealMeleeDamage(LivingEntity target, float multiplier, fl

public abstract Animation getTradingAnimation();

public boolean soundsAngry(){
public boolean soundsAngry() {
return this.entityData.get(SOUNDS_ANGRY);
}

public void setSoundsAngry(boolean angrySounding){
public void setSoundsAngry(boolean angrySounding) {
this.entityData.set(SOUNDS_ANGRY, angrySounding);
}

Expand Down

0 comments on commit 2e8fc8b

Please sign in to comment.