@@ -149,6 +149,12 @@ public class RenderListener {
149
149
new SlayerArmorProgress (new ItemStack (Items .leather_helmet ))
150
150
};
151
151
152
+ private static final List <ItemDiff > DUMMY_PICKUP_LOG = Collections .unmodifiableList (Arrays .asList (
153
+ new ItemDiff (ColorCode .DARK_PURPLE + "Forceful Ember Chestplate" , 1 , new ItemStack (Items .chainmail_chestplate )),
154
+ new ItemDiff ("Boat" , -1 , new ItemStack (Items .boat )),
155
+ new ItemDiff (ColorCode .BLUE + "Aspect of the End" , 1 , new ItemStack (Items .diamond_sword ))
156
+ ));
157
+
152
158
private static final Pattern DUNGEON_STAR_PATTERN = Pattern .compile ("(?:(?:§[a-f0-9])?✪)+(?:§[a-f0-9]?[➊-➒])?" );
153
159
154
160
private static EntityZombie revenant ;
@@ -2521,7 +2527,7 @@ public static void renderItem(ItemStack item, float x, float y, float scale) {
2521
2527
RenderHelper .enableGUIStandardItemLighting ();
2522
2528
2523
2529
GlStateManager .pushMatrix ();
2524
- if (scale > 1 ) {
2530
+ if (scale != 1 ) {
2525
2531
GlStateManager .scale (scale , scale , 1F );
2526
2532
}
2527
2533
GlStateManager .translate (x / scale , y / scale , 0 );
@@ -2551,24 +2557,31 @@ public static void renderItemAndOverlay(ItemStack item, String name, float x, fl
2551
2557
GlStateManager .disableDepth ();
2552
2558
}
2553
2559
2554
- private static final List <ItemDiff > DUMMY_PICKUP_LOG = Collections .unmodifiableList (Arrays .asList (
2555
- new ItemDiff (ColorCode .DARK_PURPLE + "Forceful Ember Chestplate" , 1 , new ItemStack (Items .chainmail_chestplate )),
2556
- new ItemDiff ("Boat" , -1 , new ItemStack (Items .boat )),
2557
- new ItemDiff (ColorCode .BLUE + "Aspect of the End" , 1 , new ItemStack (Items .diamond_sword ))
2558
- ));
2559
-
2560
+ @ SuppressWarnings ("IntegerDivisionInFloatingPointContext" )
2560
2561
public void drawItemPickupLog (float scale , ButtonLocation buttonLocation ) {
2561
- float x = main .getConfigValuesManager ().getActualX (Feature .ITEM_PICKUP_LOG );
2562
- float y = main .getConfigValuesManager ().getActualY (Feature .ITEM_PICKUP_LOG );
2562
+ Feature feature = Feature .ITEM_PICKUP_LOG ;
2563
+ float x = main .getConfigValuesManager ().getActualX (feature );
2564
+ float y = main .getConfigValuesManager ().getActualY (feature );
2563
2565
2564
- boolean downwards = Feature .ITEM_PICKUP_LOG .getAnchorPoint ().isOnTop ();
2566
+ boolean downwards = feature .getAnchorPoint ().isOnTop ();
2567
+ boolean renderItemStack = feature .isEnabled (FeatureSetting .RENDER_ITEM_ON_LOG );
2565
2568
2566
- int lineHeight = 8 + 1 ; // 1 pixel spacer
2567
- int height = lineHeight * 3 - 1 ;
2569
+ int heightSpacer = renderItemStack ? 6 : 1 ;
2570
+ int lineHeight = MC .fontRendererObj .FONT_HEIGHT + heightSpacer ; // + pixel spacer
2571
+ int height = lineHeight * DUMMY_PICKUP_LOG .size ();
2568
2572
int width = MC .fontRendererObj .getStringWidth ("+ 1x Forceful Ember Chestplate" );
2569
2573
2574
+ if (renderItemStack ) {
2575
+ width += 18 ;
2576
+ }
2577
+
2570
2578
x = transformX (x , width , scale , false );
2571
2579
y = transformY (y , height , scale );
2580
+ // X/Y Alignment
2581
+ if (renderItemStack ) {
2582
+ x += 9 ;
2583
+ y += (heightSpacer / 2 ) * DUMMY_PICKUP_LOG .size ();
2584
+ }
2572
2585
2573
2586
if (buttonLocation != null ) {
2574
2587
buttonLocation .checkHoveredAndDrawBox (x , x + width , y , y + height , scale );
@@ -2582,18 +2595,29 @@ public void drawItemPickupLog(float scale, ButtonLocation buttonLocation) {
2582
2595
if (buttonLocation != null ) {
2583
2596
log = DUMMY_PICKUP_LOG ;
2584
2597
}
2598
+ String spacing = renderItemStack ? " " : " " ; // space width is 4
2585
2599
for (ItemDiff itemDiff : log ) {
2586
- String text = String .format (
2587
- "%s %sx §r%s" ,
2588
- itemDiff .getAmount () > 0 ? "§a+" : "§c-" ,
2589
- Math .abs (itemDiff .getAmount ()), itemDiff .getDisplayName ()
2590
- );
2591
- float stringY = y + (i * lineHeight );
2592
- if (!downwards ) {
2593
- stringY = y + height - (i * lineHeight ) - 8 ;
2600
+ float stringY ;
2601
+ if (downwards ) {
2602
+ stringY = y + (i * lineHeight ) + heightSpacer / 2 ;
2603
+ } else {
2604
+ stringY = y + height - (i * lineHeight ) - 9 - heightSpacer / 2 ;
2594
2605
}
2595
2606
2607
+ String countText = String .format (
2608
+ "%s %sx" ,
2609
+ itemDiff .getAmount () > 0 ? "§a+" : "§c-" ,
2610
+ Math .abs (itemDiff .getAmount ())
2611
+ );
2612
+ String text = countText + spacing + "§r" + itemDiff .getDisplayName ();
2596
2613
DrawUtils .drawText (text , x , stringY , 0xFFFFFFFF );
2614
+ if (renderItemStack ) {
2615
+ renderItem (
2616
+ itemDiff .getItemStack (),
2617
+ x + MC .fontRendererObj .getStringWidth (countText ) + 2 ,
2618
+ stringY - heightSpacer / 2 - 1
2619
+ );
2620
+ }
2597
2621
i ++;
2598
2622
}
2599
2623
0 commit comments