Kajetan Johannes Hammerle 5 年之前
父节点
当前提交
ba557912a5

+ 62 - 4
src/main/java/me/km/Client.java

@@ -214,9 +214,67 @@ public class Client
             }
         }
         
-        System.out.println(String.format("%d cluster %d blocks", cluster, blocks));
-        double whole = cluster * 32 + blocks * 16;
-        System.out.println(whole);
-        System.out.println(whole / (16 * 16 * 256 * 16));
+        org.apache.logging.log4j.Logger logger = org.apache.logging.log4j.LogManager.getLogger();
+        logger.info("------------------------------------");
+        logger.info(String.format("cluster: %d", cluster));
+        logger.info(String.format("blocks: %d", blocks));
+        logger.info(String.format("compression rate: %f",  (16 * 16 * 256 * 16) / (cluster * 64.0 + blocks * 24.0)));
+        
+        cluster = 0;
+        blocks = 0;
+
+        for(int x = 0; x < 16; x++)
+        {
+            for(int z = 0; z < 16; z++)
+            {
+                cluster++;
+                pos.setPos(x, 0, z);
+                blocks++;
+                net.minecraft.block.Block current = c.getBlockState(pos).getBlock();
+                for(int y = 0; y < 256; y++)
+                {
+                    pos.setPos(x, y, z);
+                    net.minecraft.block.Block next = c.getBlockState(pos).getBlock();
+                    if(current != next)
+                    {
+                        current = next;
+                        blocks++;
+                    }
+                }
+            }
+        }
+        
+        logger.info("------");
+        logger.info(String.format("cluster %d blocks", cluster, blocks));
+        logger.info(String.format("cluster: %d", cluster));
+        logger.info(String.format("blocks: %d", blocks));
+        logger.info(String.format("compression rate: %f",  (16 * 16 * 256 * 16) / (cluster * 64.0 + blocks * 24.0)));
+        
+        cluster = 1;
+        blocks = 1;
+        pos.setPos(0, 0, 0);
+        net.minecraft.block.Block current = c.getBlockState(pos).getBlock();
+        for(int y = 0; y < 256; y++)
+        {
+            for(int x = 0; x < 16; x++)
+            {
+                for(int z = 0; z < 16; z++)
+                {
+                    pos.setPos(x, y, z);
+                    net.minecraft.block.Block next = c.getBlockState(pos).getBlock();
+                    if(current != next)
+                    {
+                        current = next;
+                        blocks++;
+                    }
+                }
+            }
+        }
+        
+        logger.info("------");
+        logger.info(String.format("cluster %d blocks", cluster, blocks));
+        logger.info(String.format("cluster: %d", cluster));
+        logger.info(String.format("blocks: %d", blocks));
+        logger.info(String.format("compression rate: %f",  (16 * 16 * 256 * 16) / (cluster * 64.0 + blocks * 24.0)));
     }*/
 }

+ 1 - 1
src/main/java/me/km/entities/HumanSkinLoader.java

@@ -43,7 +43,7 @@ public class HumanSkinLoader
         {
             downloadSkin(name, image ->
             {
-                ResourceLocation rloc = manager.getDynamicTextureLocation("skin_" + name, new DynamicTexture(image));
+                ResourceLocation rloc = manager.getDynamicTextureLocation("skin_" + name.toLowerCase(), new DynamicTexture(image));
                 skins.put(name, rloc);
                 loading.remove(name);
             });

+ 3 - 3
src/main/java/me/km/plots/ProtectionEvents.java

@@ -109,7 +109,7 @@ public class ProtectionEvents
         }
     }
 
-    @SubscribeEvent
+    @SubscribeEvent(priority = EventPriority.HIGHEST)
     public void onThrowableImpact(ProjectileImpactEvent.Throwable e)
     {
         if(e.getRayTraceResult().getType() == RayTraceResult.Type.ENTITY)
@@ -134,7 +134,7 @@ public class ProtectionEvents
         }
     }
     
-    @SubscribeEvent
+    @SubscribeEvent(priority = EventPriority.HIGHEST)
     public void onThrowableImpact(ProjectileImpactEvent.Arrow e)
     {
         if(e.getRayTraceResult().getType() == RayTraceResult.Type.ENTITY)
@@ -206,7 +206,7 @@ public class ProtectionEvents
         e.setCanceled(true);
     }
     
-    @SubscribeEvent
+    @SubscribeEvent(priority = EventPriority.HIGHEST)
     public void onAttackVillager(LivingAttackEvent e)
     { 
         if(e.getEntityLiving().getType() == EntityType.VILLAGER && !e.getSource().isCreativePlayer())

+ 0 - 1
src/main/java/me/km/snuviscript/ScriptEvents.java

@@ -2,7 +2,6 @@ package me.km.snuviscript;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.List;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;
 import me.hammerle.snuviscript.code.Script;