mirror of
https://git.webmc.xyz/Starlike-Client/Starlike-Client
synced 2025-06-04 01:42:01 -09:00
Starlike v0.3.1
This commit is contained in:
parent
ba94674c6a
commit
428b80afc6
50
.github/workflows/build.yml
vendored
50
.github/workflows/build.yml
vendored
@ -21,31 +21,26 @@ jobs:
|
||||
run: ./gradlew generateJavaScript
|
||||
- name: Compile assets.epk
|
||||
run: bash ./CompileEPK.sh
|
||||
- name: Generate offline download - standard
|
||||
if: github.ref != 'refs/heads/main'
|
||||
- name: Generate offline download
|
||||
run: bash ./MakeOfflineDownload.sh
|
||||
- name: Generate offline download - signed
|
||||
if: github.ref == 'refs/heads/main'
|
||||
- name: Prepare web files
|
||||
run: |
|
||||
source ./SIGNED_CLIENT.env &&
|
||||
SIGNED_CLIENT_INPUT="${{ vars.SIGNED_CLIENT_INPUT }}${{ secrets.SIGNED_CLIENT_SECRET }}" &&
|
||||
echo "$SIGNED_CLIENT_INPUT" | bash ./MakeSignedClient.sh &&
|
||||
echo "$SIGNED_CLIENT_INPUT" | bash ./MakeSignedClient.sh
|
||||
mkdir -p ${{ runner.temp }}/gh-pages
|
||||
cp -t ${{ runner.temp }}/gh-pages \
|
||||
javascript/assets.epk \
|
||||
javascript/classes.js \
|
||||
javascript/classes.js.map \
|
||||
javascript/index.html
|
||||
cp javascript/Starlike_Client_Offline.html ${{ runner.temp }}/gh-pages/offline.html
|
||||
- name: Upload web files
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: web
|
||||
path: |
|
||||
javascript/assets.epk
|
||||
javascript/classes.js
|
||||
javascript/classes.js.map
|
||||
javascript/favicon.png
|
||||
javascript/index.html
|
||||
path: ${{ runner.temp }}/gh-pages/
|
||||
retention-days: 1
|
||||
compression-level: 9
|
||||
- name: Upload offline download - standard
|
||||
if: github.ref != 'refs/heads/main'
|
||||
- name: Upload offline download
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@ -53,34 +48,13 @@ jobs:
|
||||
path: javascript/Starlike_Client_Offline.html
|
||||
retention-days: 1
|
||||
compression-level: 9
|
||||
- name: Upload offline download - signed
|
||||
if: github.ref == 'refs/heads/main'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: offline_signed
|
||||
path: javascript/Starlike_Client_Offline_Signed.html
|
||||
retention-days: 1
|
||||
compression-level: 9
|
||||
- name: Prepare GitHub Pages
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
mkdir -p ${{ runner.temp }}/gh-pages
|
||||
cp -t ${{ runner.temp }}/gh-pages \
|
||||
javascript/assets.epk \
|
||||
javascript/classes.js \
|
||||
javascript/classes.js.map \
|
||||
javascript/favicon.png \
|
||||
javascript/index.html
|
||||
cp javascript/Starlike_Client_Offline_Signed.html ${{ runner.temp }}/gh-pages/offline.html
|
||||
cp javascript/Starlike_Client_Offline_Signed.html.dat ${{ runner.temp }}/gh-pages/latest_update.dat
|
||||
- name: Deploy to GitHub Pages
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ${{ runner.temp }}/gh-pages
|
||||
cname: starlikeclient.com
|
||||
cname: starlike.zumbiepig.dev
|
||||
force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
|
||||
|
@ -1,3 +1,4 @@
|
||||
SIGNED_CLIENT_INTEGER="300"
|
||||
SIGNED_CLIENT_VERSION="0.3.0"
|
||||
SIGNED_CLIENT_CHANGELOG="Find the changelog in the Discord server!"
|
||||
SIGNED_CLIENT_INTEGER="301"
|
||||
SIGNED_CLIENT_VERSION="0.3.1"
|
||||
SIGNED_CLIENT_CHANGELOG="View the changelog in the Discord server"
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -44,6 +44,13 @@
|
||||
Code used within EaglercraftX
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Other Helpers
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Cirs?? - Wiki Contributor
|
||||
- A_Person - Boosted the server seven times :)
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
Project Name: TeaVM
|
||||
|
@ -34,7 +34,6 @@ Freak off in 30 mins
|
||||
i wanna join
|
||||
Mom said it was my turn on the xbox
|
||||
what's the wifi password
|
||||
ill check this in about 30-60 min
|
||||
bruh
|
||||
I like turtles
|
||||
nigga
|
||||
@ -85,7 +84,6 @@ I FUCKNG hate curious George
|
||||
i hate neigbors
|
||||
#zumbie on talk tuah podcast
|
||||
Lick Lick
|
||||
This channel will close at 4:00PM (no this is not a splash). You will still be able to react after this time, so get your messages in!
|
||||
Start spamming splash screen ideas
|
||||
Peyton is gay
|
||||
no spam
|
||||
@ -104,7 +102,6 @@ Jenny and Warden Hawk Tuah!
|
||||
(╯°□°)╯︵ ┻━┻
|
||||
10 likes = my pfp be Zombie Pigman fr
|
||||
Jfkxicjglckfhtldj
|
||||
same rules, 5 👍 to get added
|
||||
better than 1.8
|
||||
Justin Client
|
||||
Simga!
|
||||
@ -117,13 +114,52 @@ skibidi toilet
|
||||
placeholder i forgot to remove lmao
|
||||
¯\_(ツ)_/¯
|
||||
Make this a title screen splash
|
||||
do i change to 4 👍
|
||||
Minecraftforfree.com
|
||||
The Digital Millennium Copyright Act (DMCA) is a US law that protects copyright holders from online theft and infringement.
|
||||
The Digital Millennium Copyright Act (DMCA) is a 1998 United States copyright law that implements two 1996 treaties of the World Intellectual Property Organization (WIPO). It criminalizes production and dissemination of technology, devices, or services intended to circumvent measures that control access to copyrighted works (commonly known as digital rights management or DRM). It also criminalizes the act of circumventing an access control, whether or not there is actual infringement of copyright itself. [citation needed] In addition, the DMCA heightens the penalties for copyright infringement on the Internet.[1][2] Passed on October 12, 1998, by a unanimous vote in the United States Senate and signed into law by President Bill Clinton on October 28, 1998, the DMCA amended Title 17 of the United States Code to extend the reach of copyright, while limiting the liability of the providers of online services for copyright infringement by their users.
|
||||
funny splash
|
||||
Oiled up?
|
||||
lax1dude vs microsoft
|
||||
Hi everyone - random discord person
|
||||
gg
|
||||
get this to 4 likes guys
|
||||
get this to 4 likes guys
|
||||
STOP PINGING WTF.
|
||||
welcome to starlike, the client that pings too much and has too many blocks.
|
||||
FREE MINECRAFT TUTORIAL 100% NOT FAKE NO VIRUS
|
||||
BOTTLE FLIP MONSTER SCHOOL 2016 REAL 100%
|
||||
SalC1
|
||||
nigga 2: the revival
|
||||
this splash text has been delayed until part 2
|
||||
this splash text has been delayed again
|
||||
this splash text is now available
|
||||
spashtext
|
||||
zombie
|
||||
Get this comment to 15 likes I'll suck a black guys dick
|
||||
if e=mc² than why is minecraft cubes???
|
||||
#georgeonchatgpt
|
||||
sponsored by raid shadow legends
|
||||
Hi
|
||||
George when he realizes starlike is open source
|
||||
Don’t say the n-word!
|
||||
Imagine lagging
|
||||
how many licks untill the lolipop turns you gay
|
||||
If you are reading this, you love big black oiled up muscular men deep inside of you
|
||||
Trizzler isn't a femboy
|
||||
Curious George got a little too curious and realized that Starlike is open source.
|
||||
skibidi toilet is my life
|
||||
Look up e621 on google
|
||||
Monkeys
|
||||
skibidi toilet fnaw skin coming soon
|
||||
Pen!s twister
|
||||
Don’t lock this channel
|
||||
The One Piece is Real
|
||||
Σ
|
||||
average eagler skid be like
|
||||
Judge by color
|
||||
September 11
|
||||
✅ Locked down **title-screen-splash-text**
|
||||
in the last 8
|
||||
give me sigma role!!!!
|
||||
😭
|
||||
give me sigma role!!!
|
||||
cool
|
||||
bruh
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB |
File diff suppressed because one or more lines are too long
@ -344,7 +344,7 @@ public class GameSettings {
|
||||
* + GUI scale
|
||||
*/
|
||||
public int guiScale = 3;
|
||||
public int particleSetting;
|
||||
public int particleSetting = 2;
|
||||
public String language;
|
||||
public boolean forceUnicodeFont;
|
||||
public boolean hudFps = true;
|
||||
@ -354,7 +354,7 @@ public class GameSettings {
|
||||
public boolean hudStats = false;
|
||||
public boolean hud24h = false;
|
||||
public boolean chunkFix = true;
|
||||
public boolean fog = true;
|
||||
public boolean fog = false;
|
||||
public int fxaa = 0;
|
||||
public boolean shaders = false;
|
||||
public boolean shadersAODisable = false;
|
||||
@ -365,7 +365,7 @@ public class GameSettings {
|
||||
public boolean hasHiddenPhishWarning = false;
|
||||
|
||||
public boolean enableProfanityFilter = false;
|
||||
public boolean hasShownProfanityFilter = false;
|
||||
public boolean hasShownProfanityFilter = true;
|
||||
public float touchControlOpacity = 1.0f;
|
||||
public boolean hideDefaultUsernameWarning = false;
|
||||
|
||||
|
@ -11,6 +11,7 @@ import net.minecraft.item.ItemMap;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.item.ItemShears;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.starlikeclient.minecraft.items.ItemBackpack;
|
||||
import net.starlikeclient.minecraft.items.ItemChisel;
|
||||
|
||||
/**
|
||||
@ -253,7 +254,9 @@ public class Items {
|
||||
public static ItemArmor netherite_chestplate;
|
||||
public static ItemArmor netherite_leggings;
|
||||
public static ItemArmor netherite_boots;
|
||||
public static ItemChisel chisel;
|
||||
public static ItemChisel chisel;
|
||||
//public static ItemBackpack leather_backpack;
|
||||
|
||||
|
||||
static void doBootstrap() {
|
||||
if (!Bootstrap.isRegistered()) {
|
||||
@ -477,6 +480,8 @@ public class Items {
|
||||
netherite_leggings = (ItemArmor) getRegisteredItem("starlike:netherite_leggings");
|
||||
netherite_boots = (ItemArmor) getRegisteredItem("starlike:netherite_boots");
|
||||
chisel = (ItemChisel) getRegisteredItem("starlike:chisel");
|
||||
//leather_backpack = (ItemBackpack) getRegisteredItem("starlike:leather_backpack");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,7 +344,8 @@ public abstract class Container {
|
||||
inventoryplayer.setItemStack((ItemStack) null);
|
||||
|
||||
if (!playerIn.worldObj.isRemote) {
|
||||
((EntityPlayerMP) playerIn).playerNetServerHandler.sendPacket(new S30PacketWindowItems(playerIn.inventoryContainer.windowId, playerIn.inventoryContainer.getInventory()));
|
||||
((EntityPlayerMP) playerIn).playerNetServerHandler.sendPacket(new S30PacketWindowItems(
|
||||
playerIn.inventoryContainer.windowId, playerIn.inventoryContainer.getInventory()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,8 @@ public class ContainerBeacon extends Container {
|
||||
if (!entityplayer.inventory.addItemStackToInventory(itemstack)) {
|
||||
entityplayer.dropPlayerItemWithRandomChoice(itemstack, false);
|
||||
}
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(
|
||||
entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,10 +12,10 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.server.S30PacketWindowItems;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.network.play.server.S30PacketWindowItems;
|
||||
|
||||
/**
|
||||
* + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source
|
||||
@ -203,7 +203,8 @@ public class ContainerEnchantment extends Container {
|
||||
}
|
||||
}
|
||||
}
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(
|
||||
entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,8 @@ public class ContainerMerchant extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(
|
||||
entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,8 @@ public class ContainerPlayer extends Container {
|
||||
this.craftResult.setInventorySlotContents(0, (ItemStack) null);
|
||||
|
||||
if (!entityplayer.worldObj.isRemote) {
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(
|
||||
entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,9 +17,9 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.server.S30PacketWindowItems;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.network.play.server.S30PacketWindowItems;
|
||||
|
||||
/**
|
||||
* + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source
|
||||
@ -155,7 +155,8 @@ public class ContainerRepair extends Container {
|
||||
}
|
||||
}
|
||||
}
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(
|
||||
entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,8 @@ public class ContainerWorkbench extends Container {
|
||||
}
|
||||
}
|
||||
}
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(
|
||||
entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,12 @@ public class BlockPos extends Vec3i {
|
||||
public int getZ() {
|
||||
return this.z;
|
||||
}
|
||||
|
||||
public void setPos(int i, int j, int k) {
|
||||
this.x = i;
|
||||
this.y = j;
|
||||
this.z = k;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -165,7 +165,7 @@ public enum EnumFacing implements IStringSerializable {
|
||||
/**
|
||||
* + All facings in D-U-N-S-W-E order
|
||||
*/
|
||||
private static final EnumFacing[] VALUES = new EnumFacing[6];
|
||||
public static final EnumFacing[] VALUES = new EnumFacing[6];
|
||||
/**
|
||||
* + All Facings with horizontal axis in order S-W-N-E
|
||||
*/
|
||||
|
@ -418,123 +418,137 @@ public abstract class World implements IBlockAccess {
|
||||
}
|
||||
|
||||
public boolean checkLight(BlockPos pos) {
|
||||
boolean flag = false;
|
||||
if (!this.provider.getHasNoSky()) {
|
||||
flag |= this.checkLightFor(EnumSkyBlock.SKY, pos);
|
||||
if (provider.getHasNoSky()) {
|
||||
return this.checkLightFor(EnumSkyBlock.BLOCK, pos);
|
||||
}
|
||||
|
||||
flag = flag | this.checkLightFor(EnumSkyBlock.BLOCK, pos);
|
||||
return flag;
|
||||
return this.checkLightFor(EnumSkyBlock.SKY, pos) | this.checkLightFor(EnumSkyBlock.BLOCK, pos);
|
||||
}
|
||||
|
||||
public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) {
|
||||
if (!this.isAreaLoaded(pos, 17, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int queueSize = 0;
|
||||
int currentIndex = 0;
|
||||
|
||||
int baseX = pos.getX();
|
||||
int baseY = pos.getY();
|
||||
int baseZ = pos.getZ();
|
||||
|
||||
int currentLight = this.getLightFor(lightType, pos);
|
||||
int computedLight = this.getRawLight(pos, lightType);
|
||||
if (computedLight == currentLight) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (computedLight > currentLight) {
|
||||
this.lightUpdateBlockList[queueSize++] = 133152;
|
||||
} else {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int k = this.getLightFor(lightType, pos);
|
||||
int l = this.getRawLight(pos, lightType);
|
||||
int i1 = pos.getX();
|
||||
int j1 = pos.getY();
|
||||
int k1 = pos.getZ();
|
||||
if (l > k) {
|
||||
this.lightUpdateBlockList[j++] = 133152;
|
||||
} else if (l < k) {
|
||||
this.lightUpdateBlockList[j++] = 133152 | k << 18;
|
||||
this.lightUpdateBlockList[queueSize++] = 133152 | currentLight << 18;
|
||||
|
||||
while (i < j) {
|
||||
int l1 = this.lightUpdateBlockList[i++];
|
||||
int i2 = (l1 & 63) - 32 + i1;
|
||||
int j2 = (l1 >> 6 & 63) - 32 + j1;
|
||||
int k2 = (l1 >> 12 & 63) - 32 + k1;
|
||||
int l2 = l1 >> 18 & 15;
|
||||
BlockPos blockpos = new BlockPos(i2, j2, k2);
|
||||
int i3 = this.getLightFor(lightType, blockpos);
|
||||
if (i3 == l2) {
|
||||
this.setLightFor(lightType, blockpos, 0);
|
||||
if (l2 > 0) {
|
||||
int j3 = MathHelper.abs_int(i2 - i1);
|
||||
int k3 = MathHelper.abs_int(j2 - j1);
|
||||
int l3 = MathHelper.abs_int(k2 - k1);
|
||||
if (j3 + k3 + l3 < 17) {
|
||||
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
|
||||
while (currentIndex < queueSize) {
|
||||
int packed = this.lightUpdateBlockList[currentIndex++];
|
||||
int relX = (packed & 63) - 32;
|
||||
int relY = ((packed >> 6) & 63) - 32;
|
||||
int relZ = ((packed >> 12) & 63) - 32;
|
||||
int light = packed >> 18 & 15;
|
||||
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int m = 0; m < facings.length; ++m) {
|
||||
EnumFacing enumfacing = facings[m];
|
||||
int i4 = i2 + enumfacing.getFrontOffsetX();
|
||||
int j4 = j2 + enumfacing.getFrontOffsetY();
|
||||
int k4 = k2 + enumfacing.getFrontOffsetZ();
|
||||
blockpos$mutableblockpos.func_181079_c(i4, j4, k4);
|
||||
int l4 = Math.max(1,
|
||||
this.getBlockState(blockpos$mutableblockpos).getBlock().getLightOpacity());
|
||||
i3 = this.getLightFor(lightType, blockpos$mutableblockpos);
|
||||
if (i3 == l2 - l4 && j < this.lightUpdateBlockList.length) {
|
||||
this.lightUpdateBlockList[j++] = i4 - i1 + 32 | j4 - j1 + 32 << 6
|
||||
| k4 - k1 + 32 << 12 | l2 - l4 << 18;
|
||||
}
|
||||
int worldX = relX + baseX;
|
||||
int worldY = relY + baseY;
|
||||
int worldZ = relZ + baseZ;
|
||||
|
||||
BlockPos blockPos = new BlockPos(worldX, worldY, worldZ);
|
||||
int currentBlockLight = this.getLightFor(lightType, blockPos);
|
||||
|
||||
if (currentBlockLight == light) {
|
||||
this.setLightFor(lightType, blockPos, 0);
|
||||
|
||||
if (light > 0) {
|
||||
int manhattan = Math.abs(relX) + Math.abs(relY) + Math.abs(relZ);
|
||||
if (manhattan < 17) {
|
||||
BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos();
|
||||
EnumFacing[] facings = EnumFacing.values();
|
||||
|
||||
for (EnumFacing facing : facings) {
|
||||
int adjX = worldX + facing.getFrontOffsetX();
|
||||
int adjY = worldY + facing.getFrontOffsetY();
|
||||
int adjZ = worldZ + facing.getFrontOffsetZ();
|
||||
|
||||
mutablePos.func_181079_c(adjX, adjY, adjZ);
|
||||
|
||||
int opacity = Math.max(1, this.getBlockState(mutablePos).getBlock().getLightOpacity());
|
||||
int neighborLight = this.getLightFor(lightType, mutablePos);
|
||||
|
||||
if (neighborLight == light - opacity && queueSize < this.lightUpdateBlockList.length) {
|
||||
this.lightUpdateBlockList[queueSize++] = ((adjX - baseX + 32) & 63)
|
||||
| ((adjY - baseY + 32) & 63) << 6 | ((adjZ - baseZ + 32) & 63) << 12
|
||||
| (light - opacity) << 18;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
i = 0;
|
||||
}
|
||||
|
||||
while (i < j) {
|
||||
int i5 = this.lightUpdateBlockList[i++];
|
||||
int j5 = (i5 & 63) - 32 + i1;
|
||||
int k5 = (i5 >> 6 & 63) - 32 + j1;
|
||||
int l5 = (i5 >> 12 & 63) - 32 + k1;
|
||||
BlockPos blockpos1 = new BlockPos(j5, k5, l5);
|
||||
int i6 = this.getLightFor(lightType, blockpos1);
|
||||
int j6 = this.getRawLight(blockpos1, lightType);
|
||||
if (j6 != i6) {
|
||||
this.setLightFor(lightType, blockpos1, j6);
|
||||
if (j6 > i6) {
|
||||
int k6 = Math.abs(j5 - i1);
|
||||
int l6 = Math.abs(k5 - j1);
|
||||
int i7 = Math.abs(l5 - k1);
|
||||
boolean flag = j < this.lightUpdateBlockList.length - 6;
|
||||
if (k6 + l6 + i7 < 17 && flag) {
|
||||
if (this.getLightFor(lightType, blockpos1.west()) < j6) {
|
||||
this.lightUpdateBlockList[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6)
|
||||
+ (l5 - k1 + 32 << 12);
|
||||
}
|
||||
currentIndex = 0;
|
||||
}
|
||||
|
||||
if (this.getLightFor(lightType, blockpos1.east()) < j6) {
|
||||
this.lightUpdateBlockList[j++] = j5 + 1 - i1 + 32 + (k5 - j1 + 32 << 6)
|
||||
+ (l5 - k1 + 32 << 12);
|
||||
}
|
||||
while (currentIndex < queueSize) {
|
||||
int packed = this.lightUpdateBlockList[currentIndex++];
|
||||
int relX = (packed & 63) - 32;
|
||||
int relY = ((packed >> 6) & 63) - 32;
|
||||
int relZ = ((packed >> 12) & 63) - 32;
|
||||
|
||||
if (this.getLightFor(lightType, blockpos1.down()) < j6) {
|
||||
this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - 1 - j1 + 32 << 6)
|
||||
+ (l5 - k1 + 32 << 12);
|
||||
}
|
||||
int worldX = relX + baseX;
|
||||
int worldY = relY + baseY;
|
||||
int worldZ = relZ + baseZ;
|
||||
|
||||
if (this.getLightFor(lightType, blockpos1.up()) < j6) {
|
||||
this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 + 1 - j1 + 32 << 6)
|
||||
+ (l5 - k1 + 32 << 12);
|
||||
}
|
||||
BlockPos blockPos = new BlockPos(worldX, worldY, worldZ);
|
||||
int currentBlockLight = this.getLightFor(lightType, blockPos);
|
||||
int computedBlockLight = this.getRawLight(blockPos, lightType);
|
||||
|
||||
if (this.getLightFor(lightType, blockpos1.north()) < j6) {
|
||||
this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6)
|
||||
+ (l5 - 1 - k1 + 32 << 12);
|
||||
}
|
||||
if (computedBlockLight != currentBlockLight) {
|
||||
this.setLightFor(lightType, blockPos, computedBlockLight);
|
||||
|
||||
if (this.getLightFor(lightType, blockpos1.south()) < j6) {
|
||||
this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6)
|
||||
+ (l5 + 1 - k1 + 32 << 12);
|
||||
}
|
||||
if (computedBlockLight > currentBlockLight) {
|
||||
int manhattan = Math.abs(relX) + Math.abs(relY) + Math.abs(relZ);
|
||||
if (manhattan < 17 && queueSize < this.lightUpdateBlockList.length - 6) {
|
||||
if (this.getLightFor(lightType, blockPos.west()) < computedBlockLight) {
|
||||
this.lightUpdateBlockList[queueSize++] = ((worldX - 1 - baseX + 32) & 63)
|
||||
| ((worldY - baseY + 32) & 63) << 6 | ((worldZ - baseZ + 32) & 63) << 12;
|
||||
}
|
||||
|
||||
if (this.getLightFor(lightType, blockPos.east()) < computedBlockLight) {
|
||||
this.lightUpdateBlockList[queueSize++] = ((worldX + 1 - baseX + 32) & 63)
|
||||
| ((worldY - baseY + 32) & 63) << 6 | ((worldZ - baseZ + 32) & 63) << 12;
|
||||
}
|
||||
|
||||
if (this.getLightFor(lightType, blockPos.down()) < computedBlockLight) {
|
||||
this.lightUpdateBlockList[queueSize++] = ((worldX - baseX + 32) & 63)
|
||||
| ((worldY - 1 - baseY + 32) & 63) << 6 | ((worldZ - baseZ + 32) & 63) << 12;
|
||||
}
|
||||
|
||||
if (this.getLightFor(lightType, blockPos.up()) < computedBlockLight) {
|
||||
this.lightUpdateBlockList[queueSize++] = ((worldX - baseX + 32) & 63)
|
||||
| ((worldY + 1 - baseY + 32) & 63) << 6 | ((worldZ - baseZ + 32) & 63) << 12;
|
||||
}
|
||||
|
||||
if (this.getLightFor(lightType, blockPos.north()) < computedBlockLight) {
|
||||
this.lightUpdateBlockList[queueSize++] = ((worldX - baseX + 32) & 63)
|
||||
| ((worldY - baseY + 32) & 63) << 6 | ((worldZ - 1 - baseZ + 32) & 63) << 12;
|
||||
}
|
||||
|
||||
if (this.getLightFor(lightType, blockPos.south()) < computedBlockLight) {
|
||||
this.lightUpdateBlockList[queueSize++] = ((worldX - baseX + 32) & 63)
|
||||
| ((worldY - baseY + 32) & 63) << 6 | ((worldZ + 1 - baseZ + 32) & 63) << 12;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -198,6 +198,22 @@ public class Chunk {
|
||||
return j >= this.heightMap[k << 4 | i];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks light levels for a block and its neighbors
|
||||
*
|
||||
* @param centerPos The position of the block to check
|
||||
*/
|
||||
private void checkLightForBlockAndNeighbors(BlockPos centerPos) {
|
||||
for (EnumFacing facing : EnumFacing.values()) {
|
||||
BlockPos neighborPos = centerPos.offset(facing);
|
||||
if (worldObj.getBlockState(neighborPos).getBlock().getLightValue() > 0) {
|
||||
worldObj.checkLight(neighborPos);
|
||||
}
|
||||
}
|
||||
|
||||
worldObj.checkLight(centerPos);
|
||||
}
|
||||
|
||||
/**
|
||||
* + Checks the height of a block next to a sky-visible block and schedules a
|
||||
* lighting update as necessary.
|
||||
@ -226,36 +242,33 @@ public class Chunk {
|
||||
* generation.
|
||||
*/
|
||||
public void enqueueRelightChecks() {
|
||||
BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4);
|
||||
final BlockPos chunkStart = new BlockPos(xPosition << 4, 0, zPosition << 4);
|
||||
final int MAX_QUEUE_SIZE = 4096;
|
||||
final int SECTION_SIZE = 16;
|
||||
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
if (this.queuedLightChecks >= 4096) {
|
||||
for (int section = 0; section < 8; section++) {
|
||||
if (queuedLightChecks >= MAX_QUEUE_SIZE) {
|
||||
return;
|
||||
}
|
||||
|
||||
int j = this.queuedLightChecks % 16;
|
||||
int k = this.queuedLightChecks / 16 % 16;
|
||||
int l = this.queuedLightChecks / 256;
|
||||
++this.queuedLightChecks;
|
||||
int ySection = queuedLightChecks % SECTION_SIZE;
|
||||
int xOffset = (queuedLightChecks / SECTION_SIZE) % SECTION_SIZE;
|
||||
int zOffset = queuedLightChecks / 256;
|
||||
queuedLightChecks++;
|
||||
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i1 = 0; i1 < 16; ++i1) {
|
||||
BlockPos blockpos1 = blockpos.add(k, (j << 4) + i1, l);
|
||||
boolean flag = i1 == 0 || i1 == 15 || k == 0 || k == 15 || l == 0 || l == 15;
|
||||
if (this.storageArrays[j] == null && flag || this.storageArrays[j] != null
|
||||
&& this.storageArrays[j].getBlockByExtId(k, i1, l).getMaterial() == Material.air) {
|
||||
for (int m = 0; m < facings.length; ++m) {
|
||||
BlockPos blockpos2 = blockpos1.offset(facings[m]);
|
||||
if (this.worldObj.getBlockState(blockpos2).getBlock().getLightValue() > 0) {
|
||||
this.worldObj.checkLight(blockpos2);
|
||||
}
|
||||
}
|
||||
for (int y = 0; y < SECTION_SIZE; y++) {
|
||||
BlockPos columnPos = chunkStart.add(xOffset, (ySection << 4) + y, zOffset);
|
||||
|
||||
this.worldObj.checkLight(blockpos1);
|
||||
boolean isBorder = y == 0 || y == 15 || xOffset == 0 || xOffset == 15 || zOffset == 0 || zOffset == 15;
|
||||
|
||||
boolean needsRelight = (storageArrays[ySection] == null && isBorder) || (storageArrays[ySection] != null
|
||||
&& storageArrays[ySection].getBlockByExtId(xOffset, y, zOffset).getMaterial() == Material.air);
|
||||
|
||||
if (needsRelight) {
|
||||
checkLightForBlockAndNeighbors(columnPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@ public class EaglercraftVersion {
|
||||
/// Customize these to fit your fork:
|
||||
|
||||
public static final String projectForkName = "Starlike Client";
|
||||
public static final String projectForkVersion = "0.3.0";
|
||||
public static final String projectForkVersion = "0.3.1";
|
||||
public static final String projectForkVendor = "SpeedSlicer and zumbiepig";
|
||||
|
||||
public static final String projectForkURL = "";
|
||||
@ -32,7 +32,7 @@ public class EaglercraftVersion {
|
||||
public static final boolean enableUpdateService = true;
|
||||
|
||||
public static final String updateBundlePackageName = "dev.zumbiepig.starlikeclient.client";
|
||||
public static final int updateBundlePackageVersionInt = 300; // (0.2.1 would be 000201 or just 201)
|
||||
public static final int updateBundlePackageVersionInt = 301; // (0.2.1 would be 000201 or just 201)
|
||||
|
||||
public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName;
|
||||
|
||||
|
@ -0,0 +1,69 @@
|
||||
package net.starlikeclient.minecraft.guis.inventory;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.InventoryBasic;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.starlikeclient.minecraft.items.ItemBackpack;
|
||||
|
||||
public class BackpackInventory extends InventoryBasic {
|
||||
private final ItemStack backpackItem;
|
||||
|
||||
public BackpackInventory(ItemStack backpackItem) {
|
||||
super("Backpack", false, 32);
|
||||
this.backpackItem = backpackItem;
|
||||
loadInventoryFromNBT();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
saveInventoryToNBT();
|
||||
super.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory(EntityPlayer player) {
|
||||
saveInventoryToNBT();
|
||||
super.closeInventory(player);
|
||||
ItemBackpack.onInventoryClosed();
|
||||
}
|
||||
|
||||
public void loadInventoryFromNBT() {
|
||||
if (backpackItem != null && backpackItem.hasTagCompound()) {
|
||||
NBTTagCompound nbt = backpackItem.getTagCompound();
|
||||
NBTTagList itemList = nbt.getTagList("BackpackItems", 10);
|
||||
|
||||
for (int i = 0; i < itemList.tagCount(); i++) {
|
||||
NBTTagCompound slotTag = itemList.getCompoundTagAt(i);
|
||||
int slot = slotTag.getByte("Slot") & 255;
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(slotTag);
|
||||
if (slot >= 0 && slot < getSizeInventory()) {
|
||||
setInventorySlotContents(slot, stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void saveInventoryToNBT() {
|
||||
if (backpackItem == null) return;
|
||||
|
||||
NBTTagCompound nbt = backpackItem.hasTagCompound() ?
|
||||
backpackItem.getTagCompound() : new NBTTagCompound();
|
||||
|
||||
NBTTagList itemList = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < getSizeInventory(); i++) {
|
||||
ItemStack stack = getStackInSlot(i);
|
||||
if (stack != null) {
|
||||
NBTTagCompound slotTag = new NBTTagCompound();
|
||||
slotTag.setByte("Slot", (byte)i);
|
||||
stack.writeToNBT(slotTag);
|
||||
itemList.appendTag(slotTag);
|
||||
}
|
||||
}
|
||||
|
||||
nbt.setTag("BackpackItems", itemList);
|
||||
backpackItem.setTagCompound(nbt);
|
||||
}
|
||||
}
|
@ -10,10 +10,10 @@ import net.minecraft.inventory.InventoryBasic;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.play.server.S30PacketWindowItems;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.starlikeclient.minecraft.guis.crafting.SmithingManager;
|
||||
import net.minecraft.network.play.server.S30PacketWindowItems;
|
||||
|
||||
public class ContainerSmithing extends Container {
|
||||
private final IInventory smithingInventory;
|
||||
@ -112,7 +112,8 @@ public class ContainerSmithing extends Container {
|
||||
}
|
||||
}
|
||||
}
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
((EntityPlayerMP) entityplayer).playerNetServerHandler.sendPacket(new S30PacketWindowItems(
|
||||
entityplayer.inventoryContainer.windowId, entityplayer.inventoryContainer.getInventory()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import net.starlikeclient.minecraft.blocks.BlockDeepslate;
|
||||
import net.starlikeclient.minecraft.blocks.BlockMosaic;
|
||||
import net.starlikeclient.minecraft.blocks.BlockSmithing;
|
||||
import net.starlikeclient.minecraft.blocks.BlockSteelGrate;
|
||||
import net.starlikeclient.minecraft.items.ItemBackpack;
|
||||
import net.starlikeclient.minecraft.items.ItemChisel;
|
||||
|
||||
public class ItemsStarlike {
|
||||
@ -806,6 +807,7 @@ public class ItemsStarlike {
|
||||
(new ItemArmor(ItemArmor.ArmorMaterial.NETHERITE, 5, 3)).setUnlocalizedName("netherite_boots")
|
||||
.setCreativeTab(CreativeTabs.tabStarlike));
|
||||
Item.registerItem(1053, (String) "starlike:chisel", (new ItemChisel()).setUnlocalizedName("chisel"));
|
||||
Item.registerItem(1054, (String) "starlike:leather_backpack", (new ItemBackpack()).setUnlocalizedName("leather_backpack"));
|
||||
|
||||
//autogenerateregisterblock
|
||||
Item.registerItemBlock(Blocks.tuff_tiles);
|
||||
@ -966,6 +968,7 @@ public class ItemsStarlike {
|
||||
Item.registerItemBlock(Blocks.decorated_acacia_log);
|
||||
Item.registerItemBlock(Blocks.chiseled_deep_ocean_bricks);
|
||||
Item.registerItemBlock(Blocks.andesite_bricks);
|
||||
|
||||
}
|
||||
|
||||
public static void renderItems(RenderItem e) {
|
||||
@ -1021,6 +1024,7 @@ public class ItemsStarlike {
|
||||
e.registerItem(Items.netherite_leggings, "starlike:netherite_leggings");
|
||||
e.registerItem(Items.netherite_boots, "starlike:netherite_boots");
|
||||
e.registerItem(Items.chisel, "starlike:chisel");
|
||||
//e.registerItem(Items.leather_backpack, "starlike:leather_backpack");
|
||||
|
||||
//autogeneraterenderitem
|
||||
e.registerBlock(Blocks.tuff_tiles, "starlike:tuff_tiles");
|
||||
|
@ -60,7 +60,7 @@ public class RecipesStarlike {
|
||||
new ItemStack(Items.netherite_scrap, 1), new ItemStack(Items.netherite_scrap, 1),
|
||||
new ItemStack(Items.gold_ingot, 1), new ItemStack(Items.gold_ingot, 1),
|
||||
new ItemStack(Items.gold_ingot, 1), new ItemStack(Items.gold_ingot, 1) });
|
||||
e.addRecipe(new ItemStack(Items.chisel, 1), new Object[] { " #", " / ", "/ ", Character.valueOf('#'),
|
||||
e.addRecipe(new ItemStack(Items.chisel, 1), new Object[] { "#", "/", "/", Character.valueOf('#'),
|
||||
Items.steel, Character.valueOf('/'), Items.stick });
|
||||
e.addRecipe(new ItemStack(Blocks.smithing_table), new Object[] { "//", "##", "##", Character.valueOf('/'),
|
||||
Items.iron_ingot, Character.valueOf('#'), Blocks.planks });
|
||||
@ -152,4 +152,4 @@ public class RecipesStarlike {
|
||||
e.addSmithingRecipe(new ItemStack(Items.diamond_leggings), new ItemStack(Items.netherite_leggings));
|
||||
e.addSmithingRecipe(new ItemStack(Items.diamond_boots), new ItemStack(Items.netherite_boots));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,40 @@
|
||||
package net.starlikeclient.minecraft.items;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.starlikeclient.minecraft.guis.inventory.BackpackInventory;
|
||||
|
||||
public class ItemBackpack extends Item {
|
||||
private static BackpackInventory openInventory;
|
||||
|
||||
public ItemBackpack() {
|
||||
this.setUnlocalizedName("backpack");
|
||||
this.setCreativeTab(CreativeTabs.tabMisc);
|
||||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
||||
if (!world.isRemote) {
|
||||
System.out.println("Opening backpack...");
|
||||
|
||||
openInventory = new BackpackInventory(itemStack);
|
||||
|
||||
player.displayGUIChest(openInventory);
|
||||
|
||||
System.out.println("Backpack opened.");
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
// Add this method to handle inventory closing
|
||||
public static void onInventoryClosed() {
|
||||
if (openInventory != null) {
|
||||
openInventory.saveInventoryToNBT();
|
||||
openInventory = null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user