1.21.3 support
This commit is contained in:
		
							parent
							
								
									854ce7201c
								
							
						
					
					
						commit
						8f9a6005f5
					
				
					 13 changed files with 31 additions and 28 deletions
				
			
		|  | @ -27,7 +27,7 @@ public class Moonlight implements ModInitializer | |||
| 	public static final Moonlight INSTANCE = new Moonlight(); | ||||
| 	public static final Logger LOGGER = LoggerFactory.getLogger("Moonlight"); | ||||
| 	public static final String clientTag = ColorUtils.aqua + "Moonlight Meadows"; | ||||
| 	public static final String versionTag = ColorUtils.magenta + "v0.3.0"; | ||||
| 	public static final String versionTag = ColorUtils.magenta + "v0.3.1"; | ||||
| 	public static Config CONFIG = new Config(); | ||||
| 
 | ||||
| 	@Override | ||||
|  |  | |||
|  | @ -14,6 +14,6 @@ public class NoFall extends Module | |||
|     @Override | ||||
|     public void tick() | ||||
|     { | ||||
|         if(mc.player.fallDistance >= 2.5) mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(true)); | ||||
|         if(mc.player.fallDistance >= 2.5) mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(true, false)); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -23,22 +23,22 @@ public class Reach extends Module | |||
|     public void onEnable() | ||||
|     { | ||||
|     	super.onEnable(); | ||||
|     	oldBe = mc.player.getAttributeInstance(EntityAttributes.PLAYER_BLOCK_INTERACTION_RANGE).getBaseValue(); | ||||
|     	oldEe = mc.player.getAttributeInstance(EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE).getBaseValue(); | ||||
|     	oldBe = mc.player.getAttributeInstance(EntityAttributes.BLOCK_INTERACTION_RANGE).getBaseValue(); | ||||
|     	oldEe = mc.player.getAttributeInstance(EntityAttributes.ENTITY_INTERACTION_RANGE).getBaseValue(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void tick() | ||||
|     {	 | ||||
|     	mc.player.getAttributeInstance(EntityAttributes.PLAYER_BLOCK_INTERACTION_RANGE).setBaseValue(blockRange.value); | ||||
|     	mc.player.getAttributeInstance(EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE).setBaseValue(entityRange.value); | ||||
|     	mc.player.getAttributeInstance(EntityAttributes.BLOCK_INTERACTION_RANGE).setBaseValue(blockRange.value); | ||||
|     	mc.player.getAttributeInstance(EntityAttributes.ENTITY_INTERACTION_RANGE).setBaseValue(entityRange.value); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onDisable() | ||||
|     { | ||||
|         super.onDisable(); | ||||
|         mc.player.getAttributeInstance(EntityAttributes.PLAYER_BLOCK_INTERACTION_RANGE).setBaseValue(oldBe); | ||||
|     	mc.player.getAttributeInstance(EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE).setBaseValue(oldEe); | ||||
|         mc.player.getAttributeInstance(EntityAttributes.BLOCK_INTERACTION_RANGE).setBaseValue(oldBe); | ||||
|     	mc.player.getAttributeInstance(EntityAttributes.ENTITY_INTERACTION_RANGE).setBaseValue(oldEe); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -20,20 +20,20 @@ public class Speed extends Module | |||
|     public void onEnable() | ||||
|     { | ||||
|     	super.onEnable(); | ||||
|     	old = mc.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED).getBaseValue(); | ||||
|     	old = mc.player.getAttributeInstance(EntityAttributes.MOVEMENT_SPEED).getBaseValue(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void tick() | ||||
|     {	 | ||||
|         mc.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED).setBaseValue(speed.value/10d); | ||||
|         mc.player.getAttributeInstance(EntityAttributes.MOVEMENT_SPEED).setBaseValue(speed.value/10d); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onDisable() | ||||
|     { | ||||
|         super.onDisable(); | ||||
|         mc.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED).setBaseValue(old); | ||||
|         mc.player.getAttributeInstance(EntityAttributes.MOVEMENT_SPEED).setBaseValue(old); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -20,19 +20,19 @@ public class Step extends Module | |||
|     public void onEnable() | ||||
|     { | ||||
|     	super.onEnable(); | ||||
|     	old = mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).getBaseValue(); | ||||
|     	old = mc.player.getAttributeInstance(EntityAttributes.STEP_HEIGHT).getBaseValue(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void tick() | ||||
|     {	 | ||||
|         mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).setBaseValue(stepHeight.value); | ||||
|         mc.player.getAttributeInstance(EntityAttributes.STEP_HEIGHT).setBaseValue(stepHeight.value); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onDisable() | ||||
|     { | ||||
|         super.onDisable(); | ||||
|         mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).setBaseValue(old); | ||||
|         mc.player.getAttributeInstance(EntityAttributes.STEP_HEIGHT).setBaseValue(old); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -7,6 +7,7 @@ import me.kawaiizenbo.moonlight.module.ModuleManager; | |||
| import me.kawaiizenbo.moonlight.module.Module; | ||||
| import net.minecraft.client.font.TextRenderer; | ||||
| import net.minecraft.client.gui.DrawContext; | ||||
| import net.minecraft.client.render.RenderLayer; | ||||
| import net.minecraft.util.Identifier; | ||||
| 
 | ||||
| public class CategoryPane  | ||||
|  | @ -44,7 +45,7 @@ public class CategoryPane | |||
|         } | ||||
|         drawContext.fill(x, y, x+width, collapsed ? y+16 : y+height, category.color); | ||||
|         drawContext.fill(x+2, y+2, x+(width-2), y+14, hovered(mouseX, mouseY) ? 0xFF333333 : 0xFF222222); | ||||
|         drawContext.drawGuiTexture(icon, x+2, y+2, 12, 12); | ||||
|         drawContext.drawGuiTexture(RenderLayer::getGuiTextured, icon, x+2, y+2, 12, 12); | ||||
|         drawContext.drawText(textRenderer, category.name, x+16, y+4, 0xFFFFFFFF, false); | ||||
|         if (!collapsed) | ||||
|         { | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ import me.kawaiizenbo.moonlight.ui.hud.HUDModule; | |||
| import net.minecraft.client.MinecraftClient; | ||||
| import net.minecraft.client.font.TextRenderer; | ||||
| import net.minecraft.client.gui.DrawContext; | ||||
| import net.minecraft.client.render.RenderLayer; | ||||
| import net.minecraft.util.Identifier; | ||||
| 
 | ||||
| public class HUDModuleButton  | ||||
|  | @ -24,7 +25,7 @@ public class HUDModuleButton | |||
| 		this.y = y; | ||||
| 		drawContext.fill(x, y, x + width, y + height, hovered(mouseX, mouseY) ? 0xFF333333 : 0xFF222222); | ||||
| 		drawContext.drawText(textRenderer, module.name, x+2, y+2, module.enabled ? 0x55FFFF : 0xFFFFFF, false); | ||||
| 		if (!module.settings.isEmpty()) drawContext.drawGuiTexture(Identifier.of("moonlight", "settings"), x+width-12, y, 12, 12); | ||||
| 		if (!module.settings.isEmpty()) drawContext.drawGuiTexture(RenderLayer::getGuiTextured, Identifier.of("moonlight", "settings"), x+width-12, y, 12, 12); | ||||
| 	} | ||||
| 	 | ||||
| 	public boolean hovered(int mouseX, int mouseY)  | ||||
|  |  | |||
|  | @ -6,6 +6,7 @@ import me.kawaiizenbo.moonlight.ui.hud.HUDModule; | |||
| import me.kawaiizenbo.moonlight.ui.hud.HUDModuleManager; | ||||
| import net.minecraft.client.font.TextRenderer; | ||||
| import net.minecraft.client.gui.DrawContext; | ||||
| import net.minecraft.client.render.RenderLayer; | ||||
| import net.minecraft.util.Identifier; | ||||
| 
 | ||||
| public class HUDModuleList  | ||||
|  | @ -39,7 +40,7 @@ public class HUDModuleList | |||
|         } | ||||
|         drawContext.fill(x, y, x+width, collapsed ? y+16 : y+height, 0xFF55FFFF); | ||||
|         drawContext.fill(x+2, y+2, x+(width-2), y+14, hovered(mouseX, mouseY) ? 0xFF333333 : 0xFF222222); | ||||
|         drawContext.drawGuiTexture(Identifier.of("moonlight", "hud"), x+2, y+2, 12, 12); | ||||
|         drawContext.drawGuiTexture(RenderLayer::getGuiTextured, Identifier.of("moonlight", "hud"), x+2, y+2, 12, 12); | ||||
|         drawContext.drawText(textRenderer, "HUD Modules", x+16, y+4, 0xFFFFFFFF, false); | ||||
|         if (!collapsed) | ||||
|         { | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ public class ArmorDisplay extends HUDModule | |||
| 		{ | ||||
| 			ItemStack piece = mc.player.getInventory().getStack(i); | ||||
| 			drawContext.drawItem(piece, x, y+yOffset); | ||||
| 			drawContext.drawItemInSlot(textRenderer, piece, x, y+yOffset); | ||||
| 			drawContext.drawStackOverlay(textRenderer, piece, x, y+yOffset); | ||||
| 			yOffset += 16; | ||||
| 		} | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 kawaiizenbo
						kawaiizenbo